Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * This is the infamous ld script for the 32 bits vdso
0004  * library
0005  */
0006 #include <asm/vdso.h>
0007 #include <asm/page.h>
0008 #include <asm-generic/vmlinux.lds.h>
0009 
0010 #ifdef __LITTLE_ENDIAN__
0011 OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle")
0012 #else
0013 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
0014 #endif
0015 OUTPUT_ARCH(powerpc:common)
0016 
0017 SECTIONS
0018 {
0019     PROVIDE(_vdso_datapage = . - 2 * PAGE_SIZE);
0020     . = 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.* __ftr_alt_*)
0035     }                               :text
0036     PROVIDE(__etext = .);
0037     PROVIDE(_etext = .);
0038     PROVIDE(etext = .);
0039 
0040     . = ALIGN(8);
0041     VDSO_ftr_fixup_start = .;
0042     __ftr_fixup : { *(__ftr_fixup) }
0043     VDSO_ftr_fixup_end = .;
0044 
0045     . = ALIGN(8);
0046     VDSO_mmu_ftr_fixup_start = .;
0047     __mmu_ftr_fixup : { *(__mmu_ftr_fixup) }
0048     VDSO_mmu_ftr_fixup_end = .;
0049 
0050     . = ALIGN(8);
0051     VDSO_lwsync_fixup_start = .;
0052     __lwsync_fixup  : { *(__lwsync_fixup) }
0053     VDSO_lwsync_fixup_end = .;
0054 
0055 #ifdef CONFIG_PPC64
0056     . = ALIGN(8);
0057     VDSO_fw_ftr_fixup_start = .;
0058     __fw_ftr_fixup  : { *(__fw_ftr_fixup) }
0059     VDSO_fw_ftr_fixup_end = .;
0060 #endif
0061 
0062     /*
0063      * Other stuff is appended to the text segment:
0064      */
0065     .rodata     : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
0066     .rodata1    : { *(.rodata1) }
0067 
0068     .eh_frame_hdr   : { *(.eh_frame_hdr) }      :text   :eh_frame_hdr
0069     .eh_frame   : { KEEP (*(.eh_frame)) }   :text
0070     .gcc_except_table : { *(.gcc_except_table) }
0071     .fixup      : { *(.fixup) }
0072 
0073     .dynamic    : { *(.dynamic) }       :text   :dynamic
0074     .got        : { *(.got) }           :text
0075     .plt        : { *(.plt) }
0076 
0077     _end = .;
0078     __end = .;
0079     PROVIDE(end = .);
0080 
0081     STABS_DEBUG
0082     DWARF_DEBUG
0083     ELF_DETAILS
0084 
0085     /DISCARD/   : {
0086         *(.note.GNU-stack)
0087         *(.data .data.* .gnu.linkonce.d.* .sdata*)
0088         *(.bss .sbss .dynbss .dynsbss)
0089         *(.got1)
0090     }
0091 }
0092 
0093 /*
0094  * Very old versions of ld do not recognize this name token; use the constant.
0095  */
0096 #define PT_GNU_EH_FRAME 0x6474e550
0097 
0098 /*
0099  * We must supply the ELF program headers explicitly to get just one
0100  * PT_LOAD segment, and set the flags explicitly to make segments read-only.
0101  */
0102 PHDRS
0103 {
0104     text        PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
0105     dynamic     PT_DYNAMIC FLAGS(4);        /* PF_R */
0106     note        PT_NOTE FLAGS(4);       /* PF_R */
0107     eh_frame_hdr    PT_GNU_EH_FRAME;
0108 }
0109 
0110 /*
0111  * This controls what symbols we export from the DSO.
0112  */
0113 VERSION
0114 {
0115     VDSO_VERSION_STRING {
0116     global:
0117         __kernel_get_syscall_map;
0118         __kernel_gettimeofday;
0119         __kernel_clock_gettime;
0120         __kernel_clock_gettime64;
0121         __kernel_clock_getres;
0122         __kernel_time;
0123         __kernel_get_tbfreq;
0124         __kernel_sync_dicache;
0125         __kernel_sigtramp32;
0126         __kernel_sigtramp_rt32;
0127 #if defined(CONFIG_PPC64) || !defined(CONFIG_SMP)
0128         __kernel_getcpu;
0129 #endif
0130 
0131     local: *;
0132     };
0133 }
0134 
0135 /*
0136  * Make the sigreturn code visible to the kernel.
0137  */
0138 VDSO_sigtramp32     = __kernel_sigtramp32;
0139 VDSO_sigtramp_rt32  = __kernel_sigtramp_rt32;