elf32ppc.xe 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /* Script for -z separate-code */
  2. /* Copyright (C) 2014-2020 Free Software Foundation, Inc.
  3. Copying and distribution of this script, with or without modification,
  4. are permitted in any medium without royalty provided the copyright
  5. notice and this notice are preserved. */
  6. OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
  7. "elf32-powerpc")
  8. OUTPUT_ARCH(powerpc:common)
  9. ENTRY(_start)
  10. SEARCH_DIR("=/usr/local/lib/powerpc64-linux-gnu"); SEARCH_DIR("=/lib/powerpc64-linux-gnu"); SEARCH_DIR("=/usr/lib/powerpc64-linux-gnu"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SEARCH_DIR("=/usr/powerpc-linux-gnu/lib32"); SEARCH_DIR("=/usr/powerpc-linux-gnu/lib");
  11. PROVIDE (__stack = 0); PROVIDE (___stack = 0);
  12. SECTIONS
  13. {
  14. PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x01800000)); . = SEGMENT_START("text-segment", 0x01800000) + SIZEOF_HEADERS;
  15. .interp : { *(.interp) }
  16. .note.gnu.build-id : { *(.note.gnu.build-id) }
  17. .hash : { *(.hash) }
  18. .gnu.hash : { *(.gnu.hash) }
  19. .dynsym : { *(.dynsym) }
  20. .dynstr : { *(.dynstr) }
  21. .gnu.version : { *(.gnu.version) }
  22. .gnu.version_d : { *(.gnu.version_d) }
  23. .gnu.version_r : { *(.gnu.version_r) }
  24. .rela.init : { *(.rela.init) }
  25. .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  26. .rela.fini : { *(.rela.fini) }
  27. .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  28. .rela.data.rel.ro : { *(.rela.data.rel.ro .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*) }
  29. .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  30. .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  31. .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  32. .rela.ctors : { *(.rela.ctors) }
  33. .rela.dtors : { *(.rela.dtors) }
  34. .rela.got : { *(.rela.got) }
  35. .rela.branch_lt : { *(.rela.branch_lt) }
  36. .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
  37. .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
  38. .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
  39. .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
  40. .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  41. .rela.iplt :
  42. {
  43. PROVIDE_HIDDEN (__rela_iplt_start = .);
  44. *(.rela.iplt)
  45. PROVIDE_HIDDEN (__rela_iplt_end = .);
  46. }
  47. .rela.plt :
  48. {
  49. *(.rela.plt)
  50. }
  51. . = ALIGN(CONSTANT (MAXPAGESIZE));
  52. .init :
  53. {
  54. KEEP (*(SORT_NONE(.init)))
  55. }
  56. .text :
  57. {
  58. *(.text.unlikely .text.*_unlikely .text.unlikely.*)
  59. *(.text.exit .text.exit.*)
  60. *(.text.startup .text.startup.*)
  61. *(.text.hot .text.hot.*)
  62. *(SORT(.text.sorted.*))
  63. *(.text .stub .text.* .gnu.linkonce.t.*)
  64. /* .gnu.warning sections are handled specially by elf.em. */
  65. *(.gnu.warning)
  66. *(.glink)
  67. }
  68. .fini :
  69. {
  70. KEEP (*(SORT_NONE(.fini)))
  71. }
  72. PROVIDE (__etext = .);
  73. PROVIDE (_etext = .);
  74. PROVIDE (etext = .);
  75. . = ALIGN(CONSTANT (MAXPAGESIZE));
  76. /* Adjust the address for the rodata segment. We want to adjust up to
  77. the same address within the page on the next page up. */
  78. . = SEGMENT_START("rodata-segment", ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)));
  79. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  80. .rodata1 : { *(.rodata1) }
  81. .sdata2 :
  82. {
  83. *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
  84. }
  85. .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
  86. .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  87. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  88. .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  89. .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
  90. /* These sections are generated by the Sun/Oracle C++ compiler. */
  91. .exception_ranges : ONLY_IF_RO { *(.exception_ranges*) }
  92. /* Adjust the address for the data segment. We want to adjust up to
  93. the same address within the page on the next page up. */
  94. . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  95. /* Exception handling */
  96. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  97. .gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
  98. .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  99. .exception_ranges : ONLY_IF_RW { *(.exception_ranges*) }
  100. /* Thread Local Storage sections */
  101. .tdata :
  102. {
  103. PROVIDE_HIDDEN (__tdata_start = .);
  104. *(.tdata .tdata.* .gnu.linkonce.td.*)
  105. }
  106. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  107. .preinit_array :
  108. {
  109. PROVIDE_HIDDEN (__preinit_array_start = .);
  110. KEEP (*(.preinit_array))
  111. PROVIDE_HIDDEN (__preinit_array_end = .);
  112. }
  113. .init_array :
  114. {
  115. PROVIDE_HIDDEN (__init_array_start = .);
  116. KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
  117. KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
  118. PROVIDE_HIDDEN (__init_array_end = .);
  119. }
  120. .fini_array :
  121. {
  122. PROVIDE_HIDDEN (__fini_array_start = .);
  123. KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
  124. KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
  125. PROVIDE_HIDDEN (__fini_array_end = .);
  126. }
  127. .ctors :
  128. {
  129. /* gcc uses crtbegin.o to find the start of
  130. the constructors, so we make sure it is
  131. first. Because this is a wildcard, it
  132. doesn't matter if the user does not
  133. actually link against crtbegin.o; the
  134. linker won't look for a file to match a
  135. wildcard. The wildcard also means that it
  136. doesn't matter which directory crtbegin.o
  137. is in. */
  138. KEEP (*crtbegin.o(.ctors))
  139. KEEP (*crtbegin?.o(.ctors))
  140. /* We don't want to include the .ctor section from
  141. the crtend.o file until after the sorted ctors.
  142. The .ctor section from the crtend file contains the
  143. end of ctors marker and it must be last */
  144. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  145. KEEP (*(SORT(.ctors.*)))
  146. KEEP (*(.ctors))
  147. }
  148. .dtors :
  149. {
  150. KEEP (*crtbegin.o(.dtors))
  151. KEEP (*crtbegin?.o(.dtors))
  152. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  153. KEEP (*(SORT(.dtors.*)))
  154. KEEP (*(.dtors))
  155. }
  156. .jcr : { KEEP (*(.jcr)) }
  157. .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  158. .fixup : { *(.fixup) }
  159. .got1 : { *(.got1) }
  160. .got2 : { *(.got2) }
  161. .dynamic : { *(.dynamic) }
  162. .branch_lt : ALIGN(4) { *(.branch_lt) }
  163. .got : SPECIAL { *(.got) }
  164. . = DATA_SEGMENT_RELRO_END (0, .);
  165. .plt : SPECIAL { *(.plt) }
  166. .data :
  167. {
  168. *(.data .data.* .gnu.linkonce.d.*)
  169. SORT(CONSTRUCTORS)
  170. }
  171. .data1 : { *(.data1) }
  172. .got : SPECIAL { *(.got) }
  173. /* We want the small data sections together, so single-instruction offsets
  174. can access them all, and initialized data all before uninitialized, so
  175. we can shorten the on-disk segment size. */
  176. .sdata :
  177. {
  178. *(.sdata .sdata.* .gnu.linkonce.s.*)
  179. }
  180. _edata = .; PROVIDE (edata = .);
  181. . = .;
  182. __bss_start = .;
  183. .sbss :
  184. {
  185. PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
  186. *(.dynsbss)
  187. *(.sbss .sbss.* .gnu.linkonce.sb.*)
  188. *(.scommon)
  189. PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
  190. }
  191. .plt : SPECIAL { *(.plt) }
  192. .iplt : { *(.iplt) }
  193. .bss :
  194. {
  195. *(.dynbss)
  196. *(.bss .bss.* .gnu.linkonce.b.*)
  197. *(COMMON)
  198. /* Align here to ensure that the .bss section occupies space up to
  199. _end. Align after .bss to ensure correct alignment even if the
  200. .bss section disappears because there are no input sections.
  201. FIXME: Why do we need it? When there is no .bss section, we do not
  202. pad the .data section. */
  203. . = ALIGN(. != 0 ? 32 / 8 : 1);
  204. }
  205. . = ALIGN(32 / 8);
  206. . = SEGMENT_START("ldata-segment", .);
  207. . = ALIGN(32 / 8);
  208. __end = .;
  209. _end = .; PROVIDE (end = .);
  210. . = DATA_SEGMENT_END (.);
  211. /* Stabs debugging sections. */
  212. .stab 0 : { *(.stab) }
  213. .stabstr 0 : { *(.stabstr) }
  214. .stab.excl 0 : { *(.stab.excl) }
  215. .stab.exclstr 0 : { *(.stab.exclstr) }
  216. .stab.index 0 : { *(.stab.index) }
  217. .stab.indexstr 0 : { *(.stab.indexstr) }
  218. .comment 0 : { *(.comment) }
  219. .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
  220. /* DWARF debug sections.
  221. Symbols in the DWARF debugging sections are relative to the beginning
  222. of the section so we begin them at 0. */
  223. /* DWARF 1 */
  224. .debug 0 : { *(.debug) }
  225. .line 0 : { *(.line) }
  226. /* GNU DWARF 1 extensions */
  227. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  228. .debug_sfnames 0 : { *(.debug_sfnames) }
  229. /* DWARF 1.1 and DWARF 2 */
  230. .debug_aranges 0 : { *(.debug_aranges) }
  231. .debug_pubnames 0 : { *(.debug_pubnames) }
  232. /* DWARF 2 */
  233. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  234. .debug_abbrev 0 : { *(.debug_abbrev) }
  235. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
  236. .debug_frame 0 : { *(.debug_frame) }
  237. .debug_str 0 : { *(.debug_str) }
  238. .debug_loc 0 : { *(.debug_loc) }
  239. .debug_macinfo 0 : { *(.debug_macinfo) }
  240. /* SGI/MIPS DWARF 2 extensions */
  241. .debug_weaknames 0 : { *(.debug_weaknames) }
  242. .debug_funcnames 0 : { *(.debug_funcnames) }
  243. .debug_typenames 0 : { *(.debug_typenames) }
  244. .debug_varnames 0 : { *(.debug_varnames) }
  245. /* DWARF 3 */
  246. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  247. .debug_ranges 0 : { *(.debug_ranges) }
  248. /* DWARF Extension. */
  249. .debug_macro 0 : { *(.debug_macro) }
  250. .debug_addr 0 : { *(.debug_addr) }
  251. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  252. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  253. }