2 * Linker script for vsyscall DSO. The vsyscall page is an ELF shared
3 * object prelinked to its virtual address, and with only one read-only
4 * segment (that fits in one page). This script controls its layout.
6 #include <asm/asm-offsets.h>
9 #define VDSO_PRELINK 0xffffffffff700000
12 * Symbols we define here called VDSO* get their values into vdso-syms.lds
13 * and become visible to the kernel itself.
15 VDSO64_PRELINK = VDSO_PRELINK;
17 #define VEXTERN(x) VDSO64_ ## x = vdso_ ## x;
23 . = VDSO_PRELINK + SIZEOF_HEADERS;
25 .hash : { *(.hash) } :text
26 .gnu.hash : { *(.gnu.hash) }
27 .dynsym : { *(.dynsym) }
28 .dynstr : { *(.dynstr) }
29 .gnu.version : { *(.gnu.version) }
30 .gnu.version_d : { *(.gnu.version_d) }
31 .gnu.version_r : { *(.gnu.version_r) }
33 /* This linker script is used both with -r and with -shared.
34 For the layouts to match, we need to skip more than enough
35 space for the dynamic symbol table et al. If this amount
36 is insufficient, ld -shared will barf. Just increase it here. */
37 . = VDSO_PRELINK + VDSO_TEXT_OFFSET;
39 .text : { *(.text*) } :text
40 .rodata : { *(.rodata*) } :text
48 .altinstructions : { *(.altinstructions) } :text
49 .altinstr_replacement : { *(.altinstr_replacement) } :text
51 .note : { *(.note.*) } :text :note
52 .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
53 .eh_frame : { KEEP (*(.eh_frame)) } :text
54 .dynamic : { *(.dynamic) } :text :dynamic
63 * We must supply the ELF program headers explicitly to get just one
64 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
68 text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
69 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
70 note PT_NOTE FLAGS(4); /* PF_R */
71 eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */
75 * This controls what symbols we export from the DSO.