hppalinux.xdce 9.1 KB

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