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