i386pep.xu 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. /* Script for -Ur */
  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(pe-x86-64)
  7. SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SEARCH_DIR("=/mnt/f/gnu/x64-linux/out/x86_64-pep/lib");
  8. SECTIONS
  9. {
  10. .text :
  11. {
  12. *(.text)
  13. . = ALIGN(8);
  14. /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here,
  15. we do not PROVIDE them. This is because the ctors.o startup
  16. code in libgcc defines them as common symbols, with the
  17. expectation that they will be overridden by the definitions
  18. here. If we PROVIDE the symbols then they will not be
  19. overridden and global constructors will not be run.
  20. See PR 22762 for more details.
  21. This does mean that it is not possible for a user to define
  22. their own __CTOR_LIST__ and __DTOR_LIST__ symbols; if they do,
  23. the content from those variables are included but the symbols
  24. defined here silently take precedence. If they truly need to
  25. be redefined, a custom linker script will have to be used.
  26. (The custom script can just be a copy of this script with the
  27. PROVIDE() qualifiers added).
  28. In particular this means that ld -Ur does not work, because
  29. the proper __CTOR_LIST__ set by ld -Ur is overridden by a
  30. bogus __CTOR_LIST__ set by the final link. See PR 46. */
  31. ___CTOR_LIST__ = .;
  32. __CTOR_LIST__ = .;
  33. LONG (-1); LONG (-1);
  34. KEEP (*(.ctors));
  35. KEEP (*(.ctor));
  36. KEEP (*(SORT_BY_NAME(.ctors.*)));
  37. LONG (0); LONG (0);
  38. /* See comment about __CTOR_LIST__ above. The same reasoning
  39. applies here too. */
  40. ___DTOR_LIST__ = .;
  41. __DTOR_LIST__ = .;
  42. LONG (-1); LONG (-1);
  43. KEEP (*(.dtors));
  44. KEEP (*(.dtor));
  45. KEEP (*(SORT_BY_NAME(.dtors.*)));
  46. LONG (0); LONG (0);
  47. }
  48. /* The Cygwin32 library uses a section to avoid copying certain data
  49. on fork. This used to be named ".data". The linker used
  50. to include this between __data_start__ and __data_end__, but that
  51. breaks building the cygwin32 dll. Instead, we name the section
  52. ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
  53. .data :
  54. {
  55. *(.data)
  56. KEEP(*(.jcr))
  57. }
  58. .rdata :
  59. {
  60. *(.rdata)
  61. . = ALIGN(4);
  62. }
  63. .eh_frame :
  64. {
  65. KEEP (*(.eh_frame))
  66. }
  67. .pdata :
  68. {
  69. KEEP(*(.pdata))
  70. }
  71. .xdata :
  72. {
  73. KEEP(*(.xdata))
  74. }
  75. .bss :
  76. {
  77. *(.bss)
  78. *(COMMON)
  79. }
  80. .edata :
  81. {
  82. *(.edata)
  83. }
  84. /DISCARD/ :
  85. {
  86. *(.debug$S)
  87. *(.debug$T)
  88. *(.debug$F)
  89. *(.drectve)
  90. }
  91. .idata :
  92. {
  93. /* This cannot currently be handled with grouped sections.
  94. See pep.em:sort_sections. */
  95. }
  96. .CRT :
  97. {
  98. /* ___crt_xl_end__ is defined in the TLS Directory support code */
  99. }
  100. /* Windows TLS expects .tls$AAA to be at the start and .tls$ZZZ to be
  101. at the end of the .tls section. This is important because _tls_start MUST
  102. be at the beginning of the section to enable SECREL32 relocations with TLS
  103. data. */
  104. .tls :
  105. {
  106. *(.tls)
  107. }
  108. .endjunk :
  109. {
  110. /* end is deprecated, don't use it */
  111. }
  112. .rsrc : SUBALIGN(4)
  113. {
  114. *(.rsrc)
  115. }
  116. .reloc :
  117. {
  118. *(.reloc)
  119. }
  120. .stab :
  121. {
  122. *(.stab)
  123. }
  124. .stabstr :
  125. {
  126. *(.stabstr)
  127. }
  128. /* DWARF debug sections.
  129. Symbols in the DWARF debugging sections are relative to the beginning
  130. of the section. Unlike other targets that fake this by putting the
  131. section VMA at 0, the PE format will not allow it. */
  132. /* DWARF 1.1 and DWARF 2. */
  133. .debug_aranges :
  134. {
  135. *(.debug_aranges)
  136. }
  137. .zdebug_aranges :
  138. {
  139. *(.zdebug_aranges)
  140. }
  141. .debug_pubnames :
  142. {
  143. *(.debug_pubnames)
  144. }
  145. .zdebug_pubnames :
  146. {
  147. *(.zdebug_pubnames)
  148. }
  149. .debug_pubtypes :
  150. {
  151. *(.debug_pubtypes)
  152. }
  153. .zdebug_pubtypes :
  154. {
  155. *(.zdebug_pubtypes)
  156. }
  157. /* DWARF 2. */
  158. .debug_info :
  159. {
  160. *(.debug_info)
  161. }
  162. .zdebug_info :
  163. {
  164. *(.zdebug_info)
  165. }
  166. .debug_abbrev :
  167. {
  168. *(.debug_abbrev)
  169. }
  170. .zdebug_abbrev :
  171. {
  172. *(.zdebug_abbrev)
  173. }
  174. .debug_line :
  175. {
  176. *(.debug_line)
  177. }
  178. .zdebug_line :
  179. {
  180. *(.zdebug_line)
  181. }
  182. .debug_frame :
  183. {
  184. *(.debug_frame)
  185. }
  186. .zdebug_frame :
  187. {
  188. *(.zdebug_frame)
  189. }
  190. .debug_str :
  191. {
  192. *(.debug_str)
  193. }
  194. .zdebug_str :
  195. {
  196. *(.zdebug_str)
  197. }
  198. .debug_loc :
  199. {
  200. *(.debug_loc)
  201. }
  202. .zdebug_loc :
  203. {
  204. *(.zdebug_loc)
  205. }
  206. .debug_macinfo :
  207. {
  208. *(.debug_macinfo)
  209. }
  210. .zdebug_macinfo :
  211. {
  212. *(.zdebug_macinfo)
  213. }
  214. /* SGI/MIPS DWARF 2 extensions. */
  215. .debug_weaknames :
  216. {
  217. *(.debug_weaknames)
  218. }
  219. .zdebug_weaknames :
  220. {
  221. *(.zdebug_weaknames)
  222. }
  223. .debug_funcnames :
  224. {
  225. *(.debug_funcnames)
  226. }
  227. .zdebug_funcnames :
  228. {
  229. *(.zdebug_funcnames)
  230. }
  231. .debug_typenames :
  232. {
  233. *(.debug_typenames)
  234. }
  235. .zdebug_typenames :
  236. {
  237. *(.zdebug_typenames)
  238. }
  239. .debug_varnames :
  240. {
  241. *(.debug_varnames)
  242. }
  243. .zdebug_varnames :
  244. {
  245. *(.zdebug_varnames)
  246. }
  247. .debug_macro :
  248. {
  249. *(.debug_macro)
  250. }
  251. .zdebug_macro :
  252. {
  253. *(.zdebug_macro)
  254. }
  255. /* DWARF 3. */
  256. .debug_ranges :
  257. {
  258. *(.debug_ranges)
  259. }
  260. .zdebug_ranges :
  261. {
  262. *(.zdebug_ranges)
  263. }
  264. /* DWARF 4. */
  265. .debug_types :
  266. {
  267. *(.debug_types)
  268. }
  269. .zdebug_types :
  270. {
  271. *(.zdebug_types)
  272. }
  273. /* For Go and Rust. */
  274. .debug_gdb_scripts :
  275. {
  276. *(.debug_gdb_scripts)
  277. }
  278. .zdebug_gdb_scripts :
  279. {
  280. *(.zdebug_gdb_scripts)
  281. }
  282. }