i386beos.sc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. # Linker script for PE.
  2. #
  3. # Copyright (C) 2014-2022 Free Software Foundation, Inc.
  4. #
  5. # Copying and distribution of this file, with or without modification,
  6. # are permitted in any medium without royalty provided the copyright
  7. # notice and this notice are preserved.
  8. if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
  9. RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
  10. fi
  11. # We can't easily and portably get an unquoted $ in a shell
  12. # substitution, so we do this instead.
  13. if test "${RELOCATING}"; then
  14. R_TEXT='*(.text$*)'
  15. R_DATA='*(.data$*)'
  16. R_RDATA='*(.rdata$*)'
  17. R_IDATA='
  18. *(.idata$2)
  19. *(.idata$3)
  20. /* These zeroes mark the end of the import list. */
  21. LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
  22. *(.idata$4)
  23. *(.idata$5)
  24. *(.idata$6)
  25. *(.idata$7)'
  26. R_CRT='*(.CRT$*)'
  27. R_RSRC='*(.rsrc$*)'
  28. R_EXC='*(.exc$*)'
  29. else
  30. R_TEXT=
  31. R_DATA=
  32. R_RDATA=
  33. R_IDATA=
  34. R_CRT=
  35. R_RSRC=
  36. R_EXC=
  37. fi
  38. cat <<EOF
  39. /* Copyright (C) 2014-2022 Free Software Foundation, Inc.
  40. Copying and distribution of this script, with or without modification,
  41. are permitted in any medium without royalty provided the copyright
  42. notice and this notice are preserved. */
  43. ${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
  44. ${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
  45. ${LIB_SEARCH_DIRS}
  46. ${RELOCATING+ENTRY (__start)}
  47. ${RELOCATING+header = .;}
  48. ${RELOCATING+__fltused = .; /* set up floating pt for MS .obj\'s */}
  49. ${RELOCATING+__ldused = .;}
  50. SECTIONS
  51. {
  52. .text ${RELOCATING+ __image_base__ + __section_alignment__ } :
  53. {
  54. ${RELOCATING+ __text_start__ = . ;}
  55. ${RELOCATING+ KEEP (*(SORT_NONE(.init)))}
  56. *(.text)
  57. ${R_TEXT}
  58. *(.glue_7t)
  59. *(.glue_7)
  60. ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
  61. LONG (-1); *(.ctors); *(.ctor); LONG (0); }
  62. ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
  63. LONG (-1); *(.dtors); *(.dtor); LONG (0); }
  64. ${RELOCATING+ KEEP (*(SORT_NONE(.fini)))}
  65. ${RELOCATING+/* ??? Why is .gcc_exc here? */}
  66. ${RELOCATING+ *(.gcc_exc)}
  67. ${RELOCATING+ etext = .;}
  68. ${RELOCATING+ __text_end__ = .;}
  69. *(.gcc_except_table)
  70. }
  71. /* The Cygwin32 library uses a section to avoid copying certain data
  72. on fork. This used to be named ".data$nocopy". The linker used
  73. to include this between __data_start__ and __data_end__, but that
  74. breaks building the cygwin32 dll. Instead, we name the section
  75. ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
  76. .data ${RELOCATING+BLOCK(__section_alignment__)} :
  77. {
  78. ${RELOCATING+__data_start__ = . ;}
  79. *(.data)
  80. *(.data2)
  81. ${R_DATA}
  82. ${RELOCATING+__data_end__ = . ;}
  83. ${RELOCATING+*(.data_cygwin_nocopy)}
  84. }
  85. .bss ${RELOCATING+BLOCK(__section_alignment__)} :
  86. {
  87. ${RELOCATING+__bss_start__ = . ;}
  88. *(.bss)
  89. *(COMMON)
  90. /* link.exe apparently pulls in .obj's because of UNDEF common
  91. symbols, which is not the coff way, but that's MS for you. */
  92. *(.CRT\$XCA)
  93. *(.CRT\$XCZ)
  94. *(.CRT\$XIA)
  95. *(.CRT\$XIZ)
  96. ${RELOCATING+__bss_end__ = . ;}
  97. }
  98. .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
  99. {
  100. *(.rdata)
  101. ${R_RDATA}
  102. *(.eh_frame)
  103. }
  104. .edata ${RELOCATING+BLOCK(__section_alignment__)} :
  105. {
  106. *(.edata)
  107. }
  108. /DISCARD/ :
  109. {
  110. *(.debug\$S)
  111. *(.debug\$T)
  112. *(.debug\$F)
  113. *(.drectve)
  114. *(.debug*)
  115. }
  116. .idata ${RELOCATING+BLOCK(__section_alignment__)} :
  117. {
  118. /* This cannot currently be handled with grouped sections.
  119. See pe.em:sort_sections. */
  120. ${R_IDATA}
  121. }
  122. .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
  123. {
  124. ${R_CRT}
  125. }
  126. .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
  127. {
  128. /* end is deprecated, don't use it */
  129. ${RELOCATING+ end = .;}
  130. ${RELOCATING+ _end = .;}
  131. ${RELOCATING+ __end__ = .;}
  132. }
  133. .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
  134. {
  135. *(.reloc)
  136. }
  137. .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
  138. {
  139. *(.rsrc)
  140. ${R_RSRC}
  141. }
  142. .exc ${RELOCATING+BLOCK(__section_alignment__)} :
  143. {
  144. *(.exc)
  145. ${R_EXC}
  146. }
  147. .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
  148. {
  149. [ .stab ]
  150. }
  151. .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
  152. {
  153. [ .stabstr ]
  154. }
  155. EOF
  156. . $srcdir/scripttempl/DWARF.sc
  157. cat <<EOF
  158. }
  159. EOF