i386go32.sc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Linker script for i386 go32 (DJGPP)
  2. #
  3. # Copyright (C) 2014-2015 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. test -z "$ENTRY" && ENTRY=start
  9. EXE=${CONSTRUCTING+${RELOCATING+-exe}}
  10. # These are substituted in as variables in order to get '}' in a shell
  11. # conditional expansion.
  12. CTOR='.ctor : {
  13. *(SORT(.ctors.*))
  14. *(.ctor)
  15. }'
  16. DTOR='.dtor : {
  17. *(SORT(.dtors.*))
  18. *(.dtor)
  19. }'
  20. cat <<EOF
  21. /* Copyright (C) 2014-2015 Free Software Foundation, Inc.
  22. Copying and distribution of this script, with or without modification,
  23. are permitted in any medium without royalty provided the copyright
  24. notice and this notice are preserved. */
  25. OUTPUT_FORMAT("${OUTPUT_FORMAT}${EXE}")
  26. ${RELOCATING+ENTRY (${ENTRY})}
  27. SECTIONS
  28. {
  29. .text ${RELOCATING+ ${TARGET_PAGE_SIZE}+SIZEOF_HEADERS} : {
  30. *(.text)
  31. ${RELOCATING+*(.text.*)}
  32. ${RELOCATING+*(.gnu.linkonce.t*)}
  33. *(.const*)
  34. *(.ro*)
  35. ${RELOCATING+*(.gnu.linkonce.r*)}
  36. ${RELOCATING+etext = . ; PROVIDE(_etext = .) ;}
  37. ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
  38. }
  39. .data ${RELOCATING+ ${DATA_ALIGNMENT}} : {
  40. ${RELOCATING+djgpp_first_ctor = . ;
  41. *(SORT(.ctors.*))
  42. *(.ctor)
  43. djgpp_last_ctor = . ;}
  44. ${RELOCATING+djgpp_first_dtor = . ;
  45. *(SORT(.dtors.*))
  46. *(.dtor)
  47. djgpp_last_dtor = . ;}
  48. *(.data)
  49. ${RELOCATING+*(.data.*)}
  50. ${RELOCATING+*(.gcc_exc*)}
  51. ${RELOCATING+___EH_FRAME_BEGIN__ = . ;}
  52. ${RELOCATING+*(.eh_fram*)}
  53. ${RELOCATING+___EH_FRAME_END__ = . ;}
  54. ${RELOCATING+LONG(0);}
  55. ${RELOCATING+*(.gnu.linkonce.d*)}
  56. ${RELOCATING+edata = . ; PROVIDE(_edata = .) ;}
  57. ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
  58. }
  59. ${CONSTRUCTING+${RELOCATING-$CTOR}}
  60. ${CONSTRUCTING+${RELOCATING-$DTOR}}
  61. .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
  62. {
  63. *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
  64. *(COMMON)
  65. ${RELOCATING+ end = . ; PROVIDE(_end = .) ;}
  66. ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});}
  67. }
  68. /* Stabs debugging sections. */
  69. .stab 0 : { *(.stab) }
  70. .stabstr 0 : { *(.stabstr) }
  71. EOF
  72. . $srcdir/scripttempl/DWARF.sc
  73. cat <<EOF
  74. }
  75. EOF