sh.sc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. }${RELOCATING+ > 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. EOF
  23. test -n "${RELOCATING}" && cat <<EOF
  24. MEMORY
  25. {
  26. ram : o = 0x1000, l = 512k
  27. }
  28. EOF
  29. cat <<EOF
  30. SECTIONS
  31. {
  32. .text :
  33. {
  34. *(.text)
  35. *(.strings)
  36. ${RELOCATING+ _etext = . ; }
  37. } ${RELOCATING+ > ram}
  38. ${CONSTRUCTING+${TORS}}
  39. .data :
  40. {
  41. *(.data)
  42. ${RELOCATING+*(.gcc_exc*)}
  43. ${RELOCATING+___EH_FRAME_BEGIN__ = . ;}
  44. ${RELOCATING+*(.eh_fram*)}
  45. ${RELOCATING+___EH_FRAME_END__ = . ;}
  46. ${RELOCATING+LONG(0);}
  47. ${RELOCATING+ _edata = . ; }
  48. } ${RELOCATING+ > ram}
  49. .bss :
  50. {
  51. ${RELOCATING+ _bss_start = . ; }
  52. *(.bss)
  53. *(COMMON)
  54. ${RELOCATING+ _end = . ; }
  55. } ${RELOCATING+ > ram}
  56. .stack ${RELOCATING+ 0x30000 } :
  57. {
  58. ${RELOCATING+ _stack = . ; }
  59. *(.stack)
  60. } ${RELOCATING+ > ram}
  61. .stab 0 ${RELOCATING+(NOLOAD)} :
  62. {
  63. *(.stab)
  64. }
  65. .stabstr 0 ${RELOCATING+(NOLOAD)} :
  66. {
  67. *(.stabstr)
  68. }
  69. }
  70. EOF