/*1* Linker script for vDSO. This is an ELF shared object prelinked to2* its virtual address, and with only one read-only segment.3* This script controls its layout.4*/56#if defined(BUILD_VDSO64)7# define SHDR_SIZE 648#elif defined(BUILD_VDSO32)9# define SHDR_SIZE 4010#else11# error unknown VDSO target12#endif1314#define NUM_FAKE_SHDRS 71516SECTIONS17{18/*19* User/kernel shared data is before the vDSO. This may be a little20* uglier than putting it after the vDSO, but it avoids issues with21* non-allocatable things that dangle past the end of the PT_LOAD22* segment. Page size is 8192 for both 64-bit and 32-bit vdso binaries23*/2425vvar_start = . -8192;26vvar_data = vvar_start;2728. = SIZEOF_HEADERS;2930.hash : { *(.hash) } :text31.gnu.hash : { *(.gnu.hash) }32.dynsym : { *(.dynsym) }33.dynstr : { *(.dynstr) }34.gnu.version : { *(.gnu.version) }35.gnu.version_d : { *(.gnu.version_d) }36.gnu.version_r : { *(.gnu.version_r) }3738.dynamic : { *(.dynamic) } :text :dynamic3940.rodata : {41*(.rodata*)42*(.data*)43*(.sdata*)44*(.got.plt) *(.got)45*(.gnu.linkonce.d.*)46*(.bss*)47*(.dynbss*)48*(.gnu.linkonce.b.*)4950/*51* Ideally this would live in a C file: kept in here for52* compatibility with x86-64.53*/54VDSO_FAKE_SECTION_TABLE_START = .;55. = . + NUM_FAKE_SHDRS * SHDR_SIZE;56VDSO_FAKE_SECTION_TABLE_END = .;57} :text5859.fake_shstrtab : { *(.fake_shstrtab) } :text606162.note : { *(.note.*) } :text :note6364.eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr65.eh_frame : { KEEP (*(.eh_frame)) } :text666768/*69* Text is well-separated from actual data: there's plenty of70* stuff that isn't used at runtime in between.71*/7273.text : { *(.text*) } :text =0x90909090,7475/DISCARD/ : {76*(.discard)77*(.discard.*)78*(__bug_table)79}80}8182/*83* Very old versions of ld do not recognize this name token; use the constant.84*/85#define PT_GNU_EH_FRAME 0x6474e5508687/*88* We must supply the ELF program headers explicitly to get just one89* PT_LOAD segment, and set the flags explicitly to make segments read-only.90*/91PHDRS92{93text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */94dynamic PT_DYNAMIC FLAGS(4); /* PF_R */95note PT_NOTE FLAGS(4); /* PF_R */96eh_frame_hdr PT_GNU_EH_FRAME;97}9899100