h8300s.sc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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(h8300s)
  22. ${RELOCATING+ENTRY ("_start")}
  23. /* The memory size is 256KB to coincide with the simulator.
  24. Don't change either without considering the other. */
  25. MEMORY
  26. {
  27. /* 0xc4 is a magic entry. We should have the linker just
  28. skip over it one day... */
  29. vectors : o = 0x0000, l = 0xc4
  30. magicvectors : o = 0xc4, l = 0x3c
  31. /* We still only use 256k as the main ram size. */
  32. ram : o = 0x0100, l = 0x3fefc
  33. /* The stack starts at the top of main ram. */
  34. topram : o = 0x3fffc, l = 0x4
  35. /* This holds variables in the "tiny" sections. */
  36. tiny : o = 0xff8000, l = 0x7f00
  37. /* At the very top of the address space is the 8-bit area. */
  38. eight : o = 0xffff00, l = 0x100
  39. }
  40. SECTIONS
  41. {
  42. .vectors :
  43. {
  44. /* Use something like this to place a specific
  45. function's address into the vector table.
  46. LONG (ABSOLUTE (_foobar)). */
  47. *(.vectors)
  48. } ${RELOCATING+ > vectors}
  49. .text :
  50. {
  51. *(.rodata)
  52. *(.text)
  53. *(.strings)
  54. ${RELOCATING+ _etext = . ; }
  55. } ${RELOCATING+ > ram}
  56. ${CONSTRUCTING+${TORS}}
  57. .data :
  58. {
  59. *(.data)
  60. ${RELOCATING+ _edata = . ; }
  61. } ${RELOCATING+ > ram}
  62. .bss :
  63. {
  64. ${RELOCATING+ _bss_start = . ;}
  65. *(.bss)
  66. *(COMMON)
  67. ${RELOCATING+ _end = . ; }
  68. } ${RELOCATING+ >ram}
  69. .stack :
  70. {
  71. ${RELOCATING+ _stack = . ; }
  72. *(.stack)
  73. } ${RELOCATING+ > topram}
  74. .tiny :
  75. {
  76. *(.tiny)
  77. } ${RELOCATING+ > tiny}
  78. .eight :
  79. {
  80. *(.eight)
  81. } ${RELOCATING+ > eight}
  82. .stab 0 ${RELOCATING+(NOLOAD)} :
  83. {
  84. [ .stab ]
  85. }
  86. .stabstr 0 ${RELOCATING+(NOLOAD)} :
  87. {
  88. [ .stabstr ]
  89. }
  90. }
  91. EOF