Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This is the infamous ld script for the 32 bits vdso |
| 3 | * library |
| 4 | */ |
| 5 | #include <asm/vdso.h> |
| 6 | |
Ian Munsie | d72b080 | 2013-09-23 12:05:11 +1000 | [diff] [blame] | 7 | #ifdef __LITTLE_ENDIAN__ |
| 8 | OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle") |
| 9 | #else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
Ian Munsie | d72b080 | 2013-09-23 12:05:11 +1000 | [diff] [blame] | 11 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | OUTPUT_ARCH(powerpc:common) |
| 13 | ENTRY(_start) |
| 14 | |
| 15 | SECTIONS |
| 16 | { |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 17 | . = VDSO32_LBASE + SIZEOF_HEADERS; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 19 | .hash : { *(.hash) } :text |
| 20 | .gnu.hash : { *(.gnu.hash) } |
| 21 | .dynsym : { *(.dynsym) } |
| 22 | .dynstr : { *(.dynstr) } |
| 23 | .gnu.version : { *(.gnu.version) } |
| 24 | .gnu.version_d : { *(.gnu.version_d) } |
| 25 | .gnu.version_r : { *(.gnu.version_r) } |
Benjamin Herrenschmidt | 1b29f9d | 2005-05-01 08:58:43 -0700 | [diff] [blame] | 26 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 27 | .note : { *(.note.*) } :text :note |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 29 | . = ALIGN(16); |
| 30 | .text : { |
Michael Ellerman | fac23fe | 2008-06-24 11:32:54 +1000 | [diff] [blame] | 31 | *(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*) |
Andreas Schwab | 7de8028 | 2009-10-02 23:25:31 +0000 | [diff] [blame] | 32 | } :text |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 33 | PROVIDE(__etext = .); |
| 34 | PROVIDE(_etext = .); |
| 35 | PROVIDE(etext = .); |
| 36 | |
| 37 | . = ALIGN(8); |
| 38 | __ftr_fixup : { *(__ftr_fixup) } |
Benjamin Herrenschmidt | 0909c8c | 2006-10-20 11:47:18 +1000 | [diff] [blame] | 39 | |
Kumar Gala | 2d1b202 | 2008-07-02 01:16:40 +1000 | [diff] [blame] | 40 | . = ALIGN(8); |
Benjamin Herrenschmidt | 7c03d65 | 2008-12-18 19:13:32 +0000 | [diff] [blame] | 41 | __mmu_ftr_fixup : { *(__mmu_ftr_fixup) } |
| 42 | |
| 43 | . = ALIGN(8); |
Kumar Gala | 2d1b202 | 2008-07-02 01:16:40 +1000 | [diff] [blame] | 44 | __lwsync_fixup : { *(__lwsync_fixup) } |
| 45 | |
Benjamin Herrenschmidt | 0909c8c | 2006-10-20 11:47:18 +1000 | [diff] [blame] | 46 | #ifdef CONFIG_PPC64 |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 47 | . = ALIGN(8); |
| 48 | __fw_ftr_fixup : { *(__fw_ftr_fixup) } |
Benjamin Herrenschmidt | 0909c8c | 2006-10-20 11:47:18 +1000 | [diff] [blame] | 49 | #endif |
| 50 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 51 | /* |
| 52 | * Other stuff is appended to the text segment: |
| 53 | */ |
| 54 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } |
| 55 | .rodata1 : { *(.rodata1) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 57 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
| 58 | .eh_frame : { KEEP (*(.eh_frame)) } :text |
| 59 | .gcc_except_table : { *(.gcc_except_table) } |
| 60 | .fixup : { *(.fixup) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 62 | .dynamic : { *(.dynamic) } :text :dynamic |
Andreas Schwab | 7de8028 | 2009-10-02 23:25:31 +0000 | [diff] [blame] | 63 | .got : { *(.got) } :text |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 64 | .plt : { *(.plt) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 66 | _end = .; |
| 67 | __end = .; |
| 68 | PROVIDE(end = .); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 70 | /* |
| 71 | * Stabs debugging sections are here too. |
| 72 | */ |
| 73 | .stab 0 : { *(.stab) } |
| 74 | .stabstr 0 : { *(.stabstr) } |
| 75 | .stab.excl 0 : { *(.stab.excl) } |
| 76 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 77 | .stab.index 0 : { *(.stab.index) } |
| 78 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 79 | .comment 0 : { *(.comment) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 81 | /* |
| 82 | * DWARF debug sections. |
| 83 | * Symbols in the DWARF debugging sections are relative to the beginning |
| 84 | * of the section so we begin them at 0. |
| 85 | */ |
| 86 | /* DWARF 1 */ |
| 87 | .debug 0 : { *(.debug) } |
| 88 | .line 0 : { *(.line) } |
| 89 | /* GNU DWARF 1 extensions */ |
| 90 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 91 | .debug_sfnames 0 : { *(.debug_sfnames) } |
| 92 | /* DWARF 1.1 and DWARF 2 */ |
| 93 | .debug_aranges 0 : { *(.debug_aranges) } |
| 94 | .debug_pubnames 0 : { *(.debug_pubnames) } |
| 95 | /* DWARF 2 */ |
| 96 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
| 97 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 98 | .debug_line 0 : { *(.debug_line) } |
| 99 | .debug_frame 0 : { *(.debug_frame) } |
| 100 | .debug_str 0 : { *(.debug_str) } |
| 101 | .debug_loc 0 : { *(.debug_loc) } |
| 102 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 103 | /* SGI/MIPS DWARF 2 extensions */ |
| 104 | .debug_weaknames 0 : { *(.debug_weaknames) } |
| 105 | .debug_funcnames 0 : { *(.debug_funcnames) } |
| 106 | .debug_typenames 0 : { *(.debug_typenames) } |
| 107 | .debug_varnames 0 : { *(.debug_varnames) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 109 | /DISCARD/ : { |
| 110 | *(.note.GNU-stack) |
| 111 | *(.data .data.* .gnu.linkonce.d.* .sdata*) |
| 112 | *(.bss .sbss .dynbss .dynsbss) |
| 113 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | } |
| 115 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 116 | /* |
| 117 | * Very old versions of ld do not recognize this name token; use the constant. |
| 118 | */ |
| 119 | #define PT_GNU_EH_FRAME 0x6474e550 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 121 | /* |
| 122 | * We must supply the ELF program headers explicitly to get just one |
| 123 | * PT_LOAD segment, and set the flags explicitly to make segments read-only. |
| 124 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | PHDRS |
| 126 | { |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 127 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ |
| 128 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
| 129 | note PT_NOTE FLAGS(4); /* PF_R */ |
| 130 | eh_frame_hdr PT_GNU_EH_FRAME; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | } |
| 132 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | /* |
| 134 | * This controls what symbols we export from the DSO. |
| 135 | */ |
| 136 | VERSION |
| 137 | { |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 138 | VDSO_VERSION_STRING { |
| 139 | global: |
| 140 | /* |
| 141 | * Has to be there for the kernel to find |
| 142 | */ |
| 143 | __kernel_datapage_offset; |
| 144 | |
| 145 | __kernel_get_syscall_map; |
| 146 | __kernel_gettimeofday; |
| 147 | __kernel_clock_gettime; |
| 148 | __kernel_clock_getres; |
| 149 | __kernel_get_tbfreq; |
| 150 | __kernel_sync_dicache; |
| 151 | __kernel_sync_dicache_p5; |
| 152 | __kernel_sigtramp32; |
| 153 | __kernel_sigtramp_rt32; |
Anton Blanchard | 18ad51d | 2012-07-04 20:37:11 +0000 | [diff] [blame] | 154 | #ifdef CONFIG_PPC64 |
| 155 | __kernel_getcpu; |
| 156 | #endif |
Adhemerval Zanella | fcb41a2 | 2013-04-22 09:29:33 +0000 | [diff] [blame] | 157 | __kernel_time; |
Roland McGrath | d4c9f23 | 2007-10-15 20:44:14 -0700 | [diff] [blame] | 158 | |
| 159 | local: *; |
| 160 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | } |