1*4882a593Smuzhiyun/* SPDX-License-Identifier: GPL-2.0 */ 2*4882a593Smuzhiyun/* 3*4882a593Smuzhiyun * Linker script for vDSO. This is an ELF shared object prelinked to 4*4882a593Smuzhiyun * its virtual address, and with only one read-only segment. 5*4882a593Smuzhiyun * This script controls its layout. 6*4882a593Smuzhiyun */ 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunSECTIONS 9*4882a593Smuzhiyun{ 10*4882a593Smuzhiyun . = VDSO_PRELINK + SIZEOF_HEADERS; 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun .hash : { *(.hash) } :text 13*4882a593Smuzhiyun .gnu.hash : { *(.gnu.hash) } 14*4882a593Smuzhiyun .dynsym : { *(.dynsym) } 15*4882a593Smuzhiyun .dynstr : { *(.dynstr) } 16*4882a593Smuzhiyun .gnu.version : { *(.gnu.version) } 17*4882a593Smuzhiyun .gnu.version_d : { *(.gnu.version_d) } 18*4882a593Smuzhiyun .gnu.version_r : { *(.gnu.version_r) } 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun .note : { *(.note.*) } :text :note 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr 23*4882a593Smuzhiyun .eh_frame : { KEEP (*(.eh_frame)) } :text 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun .dynamic : { *(.dynamic) } :text :dynamic 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun .rodata : { *(.rodata*) } :text 28*4882a593Smuzhiyun .data : { 29*4882a593Smuzhiyun *(.data*) 30*4882a593Smuzhiyun *(.sdata*) 31*4882a593Smuzhiyun *(.got.plt) *(.got) 32*4882a593Smuzhiyun *(.gnu.linkonce.d.*) 33*4882a593Smuzhiyun *(.bss*) 34*4882a593Smuzhiyun *(.dynbss*) 35*4882a593Smuzhiyun *(.gnu.linkonce.b.*) 36*4882a593Smuzhiyun } 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun .altinstructions : { *(.altinstructions) } 39*4882a593Smuzhiyun .altinstr_replacement : { *(.altinstr_replacement) } 40*4882a593Smuzhiyun 41*4882a593Smuzhiyun /* 42*4882a593Smuzhiyun * Align the actual code well away from the non-instruction data. 43*4882a593Smuzhiyun * This is the best thing for the I-cache. 44*4882a593Smuzhiyun */ 45*4882a593Smuzhiyun . = ALIGN(0x100); 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun .text : { *(.text*) } :text =0x90909090 48*4882a593Smuzhiyun} 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun/* 51*4882a593Smuzhiyun * Very old versions of ld do not recognize this name token; use the constant. 52*4882a593Smuzhiyun */ 53*4882a593Smuzhiyun#define PT_GNU_EH_FRAME 0x6474e550 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun/* 56*4882a593Smuzhiyun * We must supply the ELF program headers explicitly to get just one 57*4882a593Smuzhiyun * PT_LOAD segment, and set the flags explicitly to make segments read-only. 58*4882a593Smuzhiyun */ 59*4882a593SmuzhiyunPHDRS 60*4882a593Smuzhiyun{ 61*4882a593Smuzhiyun text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */ 62*4882a593Smuzhiyun dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ 63*4882a593Smuzhiyun note PT_NOTE FLAGS(4); /* PF_R */ 64*4882a593Smuzhiyun eh_frame_hdr PT_GNU_EH_FRAME; 65*4882a593Smuzhiyun} 66