1 /* SPDX-License-Identifier: GPL-2.0 */
3 * This is the infamous ld script for the 32 bits vdso
8 #include <asm-generic/vmlinux.lds.h>
10 #ifdef __LITTLE_ENDIAN__
11 OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle")
13 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
15 OUTPUT_ARCH(powerpc:common)
19 PROVIDE(_vdso_datapage = . - 3 * PAGE_SIZE);
22 .hash : { *(.hash) } :text
23 .gnu.hash : { *(.gnu.hash) }
24 .dynsym : { *(.dynsym) }
25 .dynstr : { *(.dynstr) }
26 .gnu.version : { *(.gnu.version) }
27 .gnu.version_d : { *(.gnu.version_d) }
28 .gnu.version_r : { *(.gnu.version_r) }
30 .note : { *(.note.*) } :text :note
34 *(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*)
41 VDSO_ftr_fixup_start = .;
42 __ftr_fixup : { *(__ftr_fixup) }
43 VDSO_ftr_fixup_end = .;
46 VDSO_mmu_ftr_fixup_start = .;
47 __mmu_ftr_fixup : { *(__mmu_ftr_fixup) }
48 VDSO_mmu_ftr_fixup_end = .;
51 VDSO_lwsync_fixup_start = .;
52 __lwsync_fixup : { *(__lwsync_fixup) }
53 VDSO_lwsync_fixup_end = .;
57 VDSO_fw_ftr_fixup_start = .;
58 __fw_ftr_fixup : { *(__fw_ftr_fixup) }
59 VDSO_fw_ftr_fixup_end = .;
63 * Other stuff is appended to the text segment:
65 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
66 .rodata1 : { *(.rodata1) }
68 .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
69 .eh_frame : { KEEP (*(.eh_frame)) } :text
70 .gcc_except_table : { *(.gcc_except_table) }
71 .fixup : { *(.fixup) }
73 .dynamic : { *(.dynamic) } :text :dynamic
74 .got : { *(.got) } :text
77 .rela.dyn : { *(.rela .rela*) }
90 *(.data .data.* .gnu.linkonce.d.* .sdata*)
91 *(.bss .sbss .dynbss .dynsbss)
97 * Very old versions of ld do not recognize this name token; use the constant.
99 #define PT_GNU_EH_FRAME 0x6474e550
102 * We must supply the ELF program headers explicitly to get just one
103 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
107 text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
108 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
109 note PT_NOTE FLAGS(4); /* PF_R */
110 eh_frame_hdr PT_GNU_EH_FRAME;
114 * This controls what symbols we export from the DSO.
118 VDSO_VERSION_STRING {
120 __kernel_get_syscall_map;
121 __kernel_gettimeofday;
122 __kernel_clock_gettime;
123 __kernel_clock_gettime64;
124 __kernel_clock_getres;
127 __kernel_sync_dicache;
129 __kernel_sigtramp_rt32;
130 #if defined(CONFIG_PPC64) || !defined(CONFIG_SMP)
140 * Make the sigreturn code visible to the kernel.
142 VDSO_sigtramp32 = __kernel_sigtramp32;
143 VDSO_sigtramp_rt32 = __kernel_sigtramp_rt32;