elf32lppc.xde 9.9 KB

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