Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * This is the infamous ld script for the 64 bits vdso
0004  * library
0005  */
0006 
0007 #include <asm/page.h>
0008 #include <asm/vdso.h>
0009 
0010 OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
0011 OUTPUT_ARCH(s390:31-bit)
0012 ENTRY(_start)
0013 
0014 SECTIONS
0015 {
0016     PROVIDE(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
0017 #ifdef CONFIG_TIME_NS
0018     PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
0019 #endif
0020     . = VDSO_LBASE + SIZEOF_HEADERS;
0021 
0022     .hash       : { *(.hash) }          :text
0023     .gnu.hash   : { *(.gnu.hash) }
0024     .dynsym     : { *(.dynsym) }
0025     .dynstr     : { *(.dynstr) }
0026     .gnu.version    : { *(.gnu.version) }
0027     .gnu.version_d  : { *(.gnu.version_d) }
0028     .gnu.version_r  : { *(.gnu.version_r) }
0029 
0030     .note       : { *(.note.*) }        :text   :note
0031 
0032     . = ALIGN(16);
0033     .text       : {
0034         *(.text .stub .text.* .gnu.linkonce.t.*)
0035     } :text
0036     PROVIDE(__etext = .);
0037     PROVIDE(_etext = .);
0038     PROVIDE(etext = .);
0039 
0040     /*
0041      * Other stuff is appended to the text segment:
0042      */
0043     .rodata     : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
0044     .rodata1    : { *(.rodata1) }
0045 
0046     .dynamic    : { *(.dynamic) }       :text   :dynamic
0047 
0048     .eh_frame_hdr   : { *(.eh_frame_hdr) }      :text   :eh_frame_hdr
0049     .eh_frame   : { KEEP (*(.eh_frame)) }   :text
0050     .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) }
0051 
0052     .rela.dyn ALIGN(8) : { *(.rela.dyn) }
0053     .got ALIGN(8)   : { *(.got .toc) }
0054     .got.plt ALIGN(8) : { *(.got.plt) }
0055 
0056     _end = .;
0057     PROVIDE(end = .);
0058 
0059     /*
0060      * Stabs debugging sections are here too.
0061      */
0062     .stab          0 : { *(.stab) }
0063     .stabstr       0 : { *(.stabstr) }
0064     .stab.excl     0 : { *(.stab.excl) }
0065     .stab.exclstr  0 : { *(.stab.exclstr) }
0066     .stab.index    0 : { *(.stab.index) }
0067     .stab.indexstr 0 : { *(.stab.indexstr) }
0068     .comment       0 : { *(.comment) }
0069 
0070     /*
0071      * DWARF debug sections.
0072      * Symbols in the DWARF debugging sections are relative to the
0073      * beginning of the section so we begin them at 0.
0074      */
0075     /* DWARF 1 */
0076     .debug      0 : { *(.debug) }
0077     .line       0 : { *(.line) }
0078     /* GNU DWARF 1 extensions */
0079     .debug_srcinfo  0 : { *(.debug_srcinfo) }
0080     .debug_sfnames  0 : { *(.debug_sfnames) }
0081     /* DWARF 1.1 and DWARF 2 */
0082     .debug_aranges  0 : { *(.debug_aranges) }
0083     .debug_pubnames 0 : { *(.debug_pubnames) }
0084     /* DWARF 2 */
0085     .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
0086     .debug_abbrev   0 : { *(.debug_abbrev) }
0087     .debug_line 0 : { *(.debug_line) }
0088     .debug_frame    0 : { *(.debug_frame) }
0089     .debug_str  0 : { *(.debug_str) }
0090     .debug_loc  0 : { *(.debug_loc) }
0091     .debug_macinfo  0 : { *(.debug_macinfo) }
0092     /* SGI/MIPS DWARF 2 extensions */
0093     .debug_weaknames 0 : { *(.debug_weaknames) }
0094     .debug_funcnames 0 : { *(.debug_funcnames) }
0095     .debug_typenames 0 : { *(.debug_typenames) }
0096     .debug_varnames  0 : { *(.debug_varnames) }
0097     /* DWARF 3 */
0098     .debug_pubtypes 0 : { *(.debug_pubtypes) }
0099     .debug_ranges   0 : { *(.debug_ranges) }
0100     .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
0101 
0102     /DISCARD/   : {
0103         *(.note.GNU-stack)
0104         *(.branch_lt)
0105         *(.data .data.* .gnu.linkonce.d.* .sdata*)
0106         *(.bss .sbss .dynbss .dynsbss)
0107     }
0108 }
0109 
0110 /*
0111  * Very old versions of ld do not recognize this name token; use the constant.
0112  */
0113 #define PT_GNU_EH_FRAME 0x6474e550
0114 
0115 /*
0116  * We must supply the ELF program headers explicitly to get just one
0117  * PT_LOAD segment, and set the flags explicitly to make segments read-only.
0118  */
0119 PHDRS
0120 {
0121     text        PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
0122     dynamic     PT_DYNAMIC FLAGS(4);        /* PF_R */
0123     note        PT_NOTE FLAGS(4);       /* PF_R */
0124     eh_frame_hdr    PT_GNU_EH_FRAME;
0125 }
0126 
0127 /*
0128  * This controls what symbols we export from the DSO.
0129  */
0130 VERSION
0131 {
0132     VDSO_VERSION_STRING {
0133     global:
0134         /*
0135          * Has to be there for the kernel to find
0136          */
0137         __kernel_compat_restart_syscall;
0138         __kernel_compat_rt_sigreturn;
0139         __kernel_compat_sigreturn;
0140     local: *;
0141     };
0142 }