1*6b1a9d38SRichard Henderson/* 2*6b1a9d38SRichard Henderson * Linker script for linux x86-64 replacement vdso. 3*6b1a9d38SRichard Henderson * 4*6b1a9d38SRichard Henderson * Copyright 2023 Linaro, Ltd. 5*6b1a9d38SRichard Henderson * 6*6b1a9d38SRichard Henderson * SPDX-License-Identifier: GPL-2.0-or-later 7*6b1a9d38SRichard Henderson */ 8*6b1a9d38SRichard Henderson 9*6b1a9d38SRichard HendersonVERSION { 10*6b1a9d38SRichard Henderson LINUX_2.6 { 11*6b1a9d38SRichard Henderson global: 12*6b1a9d38SRichard Henderson clock_gettime; 13*6b1a9d38SRichard Henderson __vdso_clock_gettime; 14*6b1a9d38SRichard Henderson gettimeofday; 15*6b1a9d38SRichard Henderson __vdso_gettimeofday; 16*6b1a9d38SRichard Henderson getcpu; 17*6b1a9d38SRichard Henderson __vdso_getcpu; 18*6b1a9d38SRichard Henderson time; 19*6b1a9d38SRichard Henderson __vdso_time; 20*6b1a9d38SRichard Henderson clock_getres; 21*6b1a9d38SRichard Henderson __vdso_clock_getres; 22*6b1a9d38SRichard Henderson 23*6b1a9d38SRichard Henderson local: *; 24*6b1a9d38SRichard Henderson }; 25*6b1a9d38SRichard Henderson} 26*6b1a9d38SRichard Henderson 27*6b1a9d38SRichard Henderson 28*6b1a9d38SRichard HendersonPHDRS { 29*6b1a9d38SRichard Henderson phdr PT_PHDR FLAGS(4) PHDRS; 30*6b1a9d38SRichard Henderson load PT_LOAD FLAGS(7) FILEHDR PHDRS; /* FLAGS=RWX */ 31*6b1a9d38SRichard Henderson dynamic PT_DYNAMIC FLAGS(4); 32*6b1a9d38SRichard Henderson eh_frame_hdr PT_GNU_EH_FRAME; 33*6b1a9d38SRichard Henderson note PT_NOTE FLAGS(4); 34*6b1a9d38SRichard Henderson} 35*6b1a9d38SRichard Henderson 36*6b1a9d38SRichard HendersonSECTIONS { 37*6b1a9d38SRichard Henderson . = SIZEOF_HEADERS; 38*6b1a9d38SRichard Henderson 39*6b1a9d38SRichard Henderson /* 40*6b1a9d38SRichard Henderson * The following, including the FILEHDRS and PHDRS, are modified 41*6b1a9d38SRichard Henderson * when we relocate the binary. We want them to be initially 42*6b1a9d38SRichard Henderson * writable for the relocation; we'll force them read-only after. 43*6b1a9d38SRichard Henderson */ 44*6b1a9d38SRichard Henderson .note : { *(.note*) } :load :note 45*6b1a9d38SRichard Henderson .dynamic : { *(.dynamic) } :load :dynamic 46*6b1a9d38SRichard Henderson .dynsym : { *(.dynsym) } :load 47*6b1a9d38SRichard Henderson .data : { 48*6b1a9d38SRichard Henderson /* 49*6b1a9d38SRichard Henderson * There ought not be any real read-write data. 50*6b1a9d38SRichard Henderson * But since we manipulated the segment layout, 51*6b1a9d38SRichard Henderson * we have to put these sections somewhere. 52*6b1a9d38SRichard Henderson */ 53*6b1a9d38SRichard Henderson *(.data*) 54*6b1a9d38SRichard Henderson *(.sdata*) 55*6b1a9d38SRichard Henderson *(.got.plt) *(.got) 56*6b1a9d38SRichard Henderson *(.gnu.linkonce.d.*) 57*6b1a9d38SRichard Henderson *(.bss*) 58*6b1a9d38SRichard Henderson *(.dynbss*) 59*6b1a9d38SRichard Henderson *(.gnu.linkonce.b.*) 60*6b1a9d38SRichard Henderson } 61*6b1a9d38SRichard Henderson 62*6b1a9d38SRichard Henderson .rodata : { *(.rodata*) } 63*6b1a9d38SRichard Henderson .hash : { *(.hash) } 64*6b1a9d38SRichard Henderson .gnu.hash : { *(.gnu.hash) } 65*6b1a9d38SRichard Henderson .dynstr : { *(.dynstr) } 66*6b1a9d38SRichard Henderson .gnu.version : { *(.gnu.version) } 67*6b1a9d38SRichard Henderson .gnu.version_d : { *(.gnu.version_d) } 68*6b1a9d38SRichard Henderson .gnu.version_r : { *(.gnu.version_r) } 69*6b1a9d38SRichard Henderson .eh_frame_hdr : { *(.eh_frame_hdr) } :load :eh_frame_hdr 70*6b1a9d38SRichard Henderson .eh_frame : { *(.eh_frame) } :load 71*6b1a9d38SRichard Henderson 72*6b1a9d38SRichard Henderson .text : { *(.text*) } :load =0x90909090 73*6b1a9d38SRichard Henderson} 74