i386coff.sc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Linker script for 386 COFF. This works on SVR3.2 and SCO Unix 3.2.2.
  2. # Ian Taylor <ian@cygnus.com>.
  3. #
  4. # Copyright (C) 2014-2015 Free Software Foundation, Inc.
  5. #
  6. # Copying and distribution of this file, with or without modification,
  7. # are permitted in any medium without royalty provided the copyright
  8. # notice and this notice are preserved.
  9. test -z "$ENTRY" && ENTRY=_start
  10. # These are substituted in as variables in order to get '}' in a shell
  11. # conditional expansion.
  12. INIT='.init : { *(.init) }'
  13. FINI='.fini : { *(.fini) }'
  14. cat <<EOF
  15. /* Copyright (C) 2014-2015 Free Software Foundation, Inc.
  16. Copying and distribution of this script, with or without modification,
  17. are permitted in any medium without royalty provided the copyright
  18. notice and this notice are preserved. */
  19. OUTPUT_FORMAT("${OUTPUT_FORMAT}")
  20. ${LIB_SEARCH_DIRS}
  21. ${RELOCATING+ENTRY (${ENTRY})}
  22. SECTIONS
  23. {
  24. .text ${RELOCATING+ SIZEOF_HEADERS} : {
  25. ${RELOCATING+ *(.init)}
  26. *(.text)
  27. ${RELOCATING+ *(.fini)}
  28. ${RELOCATING+ etext = .};
  29. }
  30. .data ${RELOCATING+ 0x400000 + (. & 0xffc00fff)} : {
  31. *(.data)
  32. ${RELOCATING+ edata = .};
  33. }
  34. .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
  35. {
  36. *(.bss)
  37. *(COMMON)
  38. ${RELOCATING+ end = .};
  39. }
  40. ${RELOCATING- ${INIT}}
  41. ${RELOCATING- ${FINI}}
  42. .stab 0 ${RELOCATING+(NOLOAD)} :
  43. {
  44. [ .stab ]
  45. }
  46. .stabstr 0 ${RELOCATING+(NOLOAD)} :
  47. {
  48. [ .stabstr ]
  49. }
  50. }
  51. EOF