h8300sn.sc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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(h8300sn)
  22. ${RELOCATING+ENTRY ("_start")}
  23. MEMORY
  24. {
  25. /* 0xc4 is a magic entry. We should have the linker just
  26. skip over it one day... */
  27. vectors : o = 0x0000, l = 0xc4
  28. magicvectors : o = 0xc4, l = 0x3c
  29. ram : o = 0x0100, l = 0xfdfc
  30. /* The stack starts at the top of main ram. */
  31. topram : o = 0xfefc, l = 0x4
  32. /* At the very top of the address space is the 8-bit area. */
  33. eight : o = 0xff00, l = 0x100
  34. }
  35. SECTIONS
  36. {
  37. .vectors :
  38. {
  39. /* Use something like this to place a specific
  40. function's address into the vector table.
  41. SHORT (ABSOLUTE (_foobar)). */
  42. *(.vectors)
  43. } ${RELOCATING+ > vectors}
  44. .text :
  45. {
  46. *(.rodata)
  47. *(.text)
  48. *(.strings)
  49. ${RELOCATING+ _etext = . ; }
  50. } ${RELOCATING+ > ram}
  51. ${CONSTRUCTING+${TORS}}
  52. .data :
  53. {
  54. *(.data)
  55. *(.tiny)
  56. ${RELOCATING+ _edata = . ; }
  57. } ${RELOCATING+ > ram}
  58. .bss :
  59. {
  60. ${RELOCATING+ _bss_start = . ;}
  61. *(.bss)
  62. *(COMMON)
  63. ${RELOCATING+ _end = . ; }
  64. } ${RELOCATING+ >ram}
  65. .stack :
  66. {
  67. ${RELOCATING+ _stack = . ; }
  68. *(.stack)
  69. } ${RELOCATING+ > topram}
  70. .eight :
  71. {
  72. *(.eight)
  73. } ${RELOCATING+ > eight}
  74. .stab 0 ${RELOCATING+(NOLOAD)} :
  75. {
  76. [ .stab ]
  77. }
  78. .stabstr 0 ${RELOCATING+(NOLOAD)} :
  79. {
  80. [ .stabstr ]
  81. }
  82. }
  83. EOF