sh.sc 1.5 KB

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