moxie.sc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright (C) 2014-2022 Free Software Foundation, Inc.
  2. #
  3. # Copying and distribution of this file, with or without modification,
  4. # are permitted in any medium without royalty provided the copyright
  5. # notice and this notice are preserved.
  6. TORS=".tors :
  7. {
  8. ___ctors = . ;
  9. *(.ctors)
  10. ___ctors_end = . ;
  11. ___dtors = . ;
  12. *(.dtors)
  13. ___dtors_end = . ;
  14. } > ram"
  15. cat <<EOF
  16. /* Copyright (C) 2014-2022 Free Software Foundation, Inc.
  17. Copying and distribution of this script, with or without modification,
  18. are permitted in any medium without royalty provided the copyright
  19. notice and this notice are preserved. */
  20. OUTPUT_FORMAT("${OUTPUT_FORMAT}")
  21. OUTPUT_ARCH(${ARCH})
  22. SECTIONS
  23. {
  24. .text :
  25. {
  26. *(.text)
  27. ${RELOCATING+KEEP (*(SORT_NONE(.init)))
  28. KEEP (*(SORT_NONE(.fini)))
  29. *(.strings)
  30. _etext = . ; }
  31. } ${RELOCATING+ > ram}
  32. ${CONSTRUCTING+${TORS}}
  33. .data :
  34. {
  35. *(.data)
  36. ${RELOCATING+ _edata = . ; }
  37. } ${RELOCATING+ > ram}
  38. .bss :
  39. {
  40. ${RELOCATING+ _bss_start = . ; }
  41. *(.bss)
  42. *(COMMON)
  43. ${RELOCATING+ _end = . ; }
  44. } ${RELOCATING+ > ram}
  45. .stack ${RELOCATING+ 0x30000 } :
  46. {
  47. ${RELOCATING+ _stack = . ; }
  48. *(.stack)
  49. } ${RELOCATING+ > ram}
  50. .stab 0 ${RELOCATING+(NOLOAD)} :
  51. {
  52. *(.stab)
  53. }
  54. .stabstr 0 ${RELOCATING+(NOLOAD)} :
  55. {
  56. *(.stabstr)
  57. }
  58. }
  59. EOF