Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Linker script for vDSO.  This is an ELF shared object prelinked to
0004  * its virtual address, and with only one read-only segment.
0005  * This script controls its layout.
0006  */
0007 
0008 SECTIONS
0009 {
0010     . = VDSO_PRELINK + SIZEOF_HEADERS;
0011 
0012     .hash       : { *(.hash) }          :text
0013     .gnu.hash   : { *(.gnu.hash) }
0014     .dynsym     : { *(.dynsym) }
0015     .dynstr     : { *(.dynstr) }
0016     .gnu.version    : { *(.gnu.version) }
0017     .gnu.version_d  : { *(.gnu.version_d) }
0018     .gnu.version_r  : { *(.gnu.version_r) }
0019 
0020     .note       : { *(.note.*) }        :text   :note
0021 
0022     .eh_frame_hdr   : { *(.eh_frame_hdr) }      :text   :eh_frame_hdr
0023     .eh_frame   : { KEEP (*(.eh_frame)) }   :text
0024 
0025     .dynamic    : { *(.dynamic) }       :text   :dynamic
0026 
0027     .rodata     : { *(.rodata*) }       :text
0028     .data       : {
0029           *(.data*)
0030           *(.sdata*)
0031           *(.got.plt) *(.got)
0032           *(.gnu.linkonce.d.*)
0033           *(.bss*)
0034           *(.dynbss*)
0035           *(.gnu.linkonce.b.*)
0036     }
0037 
0038     .altinstructions    : { *(.altinstructions) }
0039     .altinstr_replacement   : { *(.altinstr_replacement) }
0040 
0041     /*
0042      * Align the actual code well away from the non-instruction data.
0043      * This is the best thing for the I-cache.
0044      */
0045     . = ALIGN(0x100);
0046 
0047     .text       : { *(.text*) }         :text   =0x90909090
0048 }
0049 
0050 /*
0051  * Very old versions of ld do not recognize this name token; use the constant.
0052  */
0053 #define PT_GNU_EH_FRAME 0x6474e550
0054 
0055 /*
0056  * We must supply the ELF program headers explicitly to get just one
0057  * PT_LOAD segment, and set the flags explicitly to make segments read-only.
0058  */
0059 PHDRS
0060 {
0061     text        PT_LOAD     FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
0062     dynamic     PT_DYNAMIC  FLAGS(4);       /* PF_R */
0063     note        PT_NOTE     FLAGS(4);       /* PF_R */
0064     eh_frame_hdr    PT_GNU_EH_FRAME;
0065 }