elf64alpha.x 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /* Default linker script, for normal executables */
  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("elf64-alpha", "elf64-alpha",
  7. "elf64-alpha")
  8. OUTPUT_ARCH(alpha)
  9. ENTRY(_start)
  10. SEARCH_DIR("=/usr/local/lib/alpha-linux-gnu"); SEARCH_DIR("=/lib/alpha-linux-gnu"); SEARCH_DIR("=/usr/lib/alpha-linux-gnu"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SEARCH_DIR("=/usr/alpha-linux-gnu/lib");
  11. SECTIONS
  12. {
  13. /* Read-only sections, merged into text segment: */
  14. PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x120000000)); . = SEGMENT_START("text-segment", 0x120000000) + 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.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
  36. .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
  37. .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
  38. .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
  39. .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  40. .rela.iplt :
  41. {
  42. PROVIDE_HIDDEN (__rela_iplt_start = .);
  43. *(.rela.iplt)
  44. PROVIDE_HIDDEN (__rela_iplt_end = .);
  45. }
  46. .rela.plt :
  47. {
  48. *(.rela.plt)
  49. }
  50. .init :
  51. {
  52. KEEP (*(SORT_NONE(.init)))
  53. } =0x0000fe2f1f04ff47
  54. .plt : SPECIAL { *(.plt) }
  55. .text :
  56. {
  57. *(.text.unlikely .text.*_unlikely .text.unlikely.*)
  58. *(.text.exit .text.exit.*)
  59. *(.text.startup .text.startup.*)
  60. *(.text.hot .text.hot.*)
  61. *(SORT(.text.sorted.*))
  62. *(.text .stub .text.* .gnu.linkonce.t.*)
  63. /* .gnu.warning sections are handled specially by elf.em. */
  64. *(.gnu.warning)
  65. } =0x0000fe2f1f04ff47
  66. .fini :
  67. {
  68. KEEP (*(SORT_NONE(.fini)))
  69. } =0x0000fe2f1f04ff47
  70. PROVIDE (__etext = .);
  71. PROVIDE (_etext = .);
  72. PROVIDE (etext = .);
  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. .reginfo : { *(.reginfo) }
  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. . = 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. .plt : SPECIAL { *(.plt) }
  156. .data :
  157. {
  158. *(.data .data.* .gnu.linkonce.d.*)
  159. SORT(CONSTRUCTORS)
  160. }
  161. .data1 : { *(.data1) }
  162. .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
  163. /* We want the small data sections together, so single-instruction offsets
  164. can access them all, and initialized data all before uninitialized, so
  165. we can shorten the on-disk segment size. */
  166. .sdata :
  167. {
  168. *(.sdata .sdata.* .gnu.linkonce.s.*)
  169. }
  170. _edata = .; PROVIDE (edata = .);
  171. . = .;
  172. __bss_start = .;
  173. .sbss :
  174. {
  175. *(.dynsbss)
  176. *(.sbss .sbss.* .gnu.linkonce.sb.*)
  177. *(.scommon)
  178. }
  179. .bss :
  180. {
  181. *(.dynbss)
  182. *(.bss .bss.* .gnu.linkonce.b.*)
  183. *(COMMON)
  184. /* Align here to ensure that the .bss section occupies space up to
  185. _end. Align after .bss to ensure correct alignment even if the
  186. .bss section disappears because there are no input sections.
  187. FIXME: Why do we need it? When there is no .bss section, we do not
  188. pad the .data section. */
  189. . = ALIGN(. != 0 ? 64 / 8 : 1);
  190. }
  191. . = ALIGN(64 / 8);
  192. . = SEGMENT_START("ldata-segment", .);
  193. . = ALIGN(64 / 8);
  194. _end = .; PROVIDE (end = .);
  195. . = DATA_SEGMENT_END (.);
  196. /* Stabs debugging sections. */
  197. .stab 0 : { *(.stab) }
  198. .stabstr 0 : { *(.stabstr) }
  199. .stab.excl 0 : { *(.stab.excl) }
  200. .stab.exclstr 0 : { *(.stab.exclstr) }
  201. .stab.index 0 : { *(.stab.index) }
  202. .stab.indexstr 0 : { *(.stab.indexstr) }
  203. .comment 0 : { *(.comment) }
  204. .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
  205. /* DWARF debug sections.
  206. Symbols in the DWARF debugging sections are relative to the beginning
  207. of the section so we begin them at 0. */
  208. /* DWARF 1 */
  209. .debug 0 : { *(.debug) }
  210. .line 0 : { *(.line) }
  211. /* GNU DWARF 1 extensions */
  212. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  213. .debug_sfnames 0 : { *(.debug_sfnames) }
  214. /* DWARF 1.1 and DWARF 2 */
  215. .debug_aranges 0 : { *(.debug_aranges) }
  216. .debug_pubnames 0 : { *(.debug_pubnames) }
  217. /* DWARF 2 */
  218. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  219. .debug_abbrev 0 : { *(.debug_abbrev) }
  220. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
  221. .debug_frame 0 : { *(.debug_frame) }
  222. .debug_str 0 : { *(.debug_str) }
  223. .debug_loc 0 : { *(.debug_loc) }
  224. .debug_macinfo 0 : { *(.debug_macinfo) }
  225. /* SGI/MIPS DWARF 2 extensions */
  226. .debug_weaknames 0 : { *(.debug_weaknames) }
  227. .debug_funcnames 0 : { *(.debug_funcnames) }
  228. .debug_typenames 0 : { *(.debug_typenames) }
  229. .debug_varnames 0 : { *(.debug_varnames) }
  230. /* DWARF 3 */
  231. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  232. .debug_ranges 0 : { *(.debug_ranges) }
  233. /* DWARF Extension. */
  234. .debug_macro 0 : { *(.debug_macro) }
  235. .debug_addr 0 : { *(.debug_addr) }
  236. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  237. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  238. }