4 * Linker script for vDSO. This is an ELF shared object prelinked to
5 * its virtual address, and with only one read-only segment.
6 * This script controls its layout.
9 #if defined(BUILD_VDSO64)
11 #elif defined(BUILD_VDSO32) || defined(BUILD_VDSOX32)
14 # error unknown VDSO target
17 #define NUM_FAKE_SHDRS 16
23 .hash : { *(.hash) } :text
24 .gnu.hash : { *(.gnu.hash) }
25 .dynsym : { *(.dynsym) }
26 .dynstr : { *(.dynstr) }
27 .gnu.version : { *(.gnu.version) }
28 .gnu.version_d : { *(.gnu.version_d) }
29 .gnu.version_r : { *(.gnu.version_r) }
31 .note : { *(.note.*) } :text :note
33 .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
34 .eh_frame : { KEEP (*(.eh_frame)) } :text
36 .dynamic : { *(.dynamic) } :text :dynamic
42 * Ideally this would live in a C file, but that won't
43 * work cleanly for x32 until we start building the x32
44 * C code using an x32 toolchain.
46 VDSO_FAKE_SECTION_TABLE_START = .;
47 . = . + NUM_FAKE_SHDRS * SHDR_SIZE;
48 VDSO_FAKE_SECTION_TABLE_END = .;
51 .fake_shstrtab : { *(.fake_shstrtab) } :text
63 .altinstructions : { *(.altinstructions) }
64 .altinstr_replacement : { *(.altinstr_replacement) }
67 * Align the actual code well away from the non-instruction data.
68 * This is the best thing for the I-cache.
72 .text : { *(.text*) } :text =0x90909090,
75 * The remainder of the vDSO consists of special pages that are
76 * shared between the kernel and userspace. It needs to be at the
77 * end so that it doesn't overlap the mapping of the actual
84 /* Place all vvars at the offsets in asm/vvar.h. */
85 #define EMIT_VVAR(name, offset) vvar_ ## name = vvar_page + offset;
86 #define __VVAR_KERNEL_LDS
88 #undef __VVAR_KERNEL_LDS
91 . = vvar_page + PAGE_SIZE;
107 * Very old versions of ld do not recognize this name token; use the constant.
109 #define PT_GNU_EH_FRAME 0x6474e550
112 * We must supply the ELF program headers explicitly to get just one
113 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
117 text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
118 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
119 note PT_NOTE FLAGS(4); /* PF_R */
120 eh_frame_hdr PT_GNU_EH_FRAME;