elf32lppc.xsce 8.9 KB

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