nut-h8-3068f-ram.ld 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* Generic linker script for H8/3068F. Uses only internal Flash and RAM. */
  2. /* Program code (.text section) is located in the internal RAM. It is */
  3. /* startup routine (NutEntry) task to copy the code from Flash into RAM. */
  4. /* Author: Jan Dubiec <jdx@slackware.pl> */
  5. OUTPUT_ARCH(h8300h)
  6. ENTRY(_NutEntry)
  7. MEMORY
  8. {
  9. rom (rx) : ORIGIN = 0x000000, LENGTH = 384k
  10. ram (rwx) : ORIGIN = 0xffbf20, LENGTH = 16k
  11. }
  12. SECTIONS
  13. {
  14. /* 256 byte interrupt vector area */
  15. .vects 0x000000 :
  16. {
  17. _vects = .;
  18. *(.vects);
  19. } > rom
  20. /* startup code area */
  21. .init 0x000100 :
  22. {
  23. *(.init)
  24. } > rom
  25. .fini :
  26. {
  27. *(.fini)
  28. } > rom
  29. .got :
  30. {
  31. *(.got)
  32. *(.got.plt)
  33. } > rom
  34. .rodata :
  35. {
  36. *(.rodata)
  37. *(.rodata.*)
  38. _erodata = .;
  39. } > rom
  40. .eh_frame_hdr :
  41. {
  42. *(.eh_frame_hdr)
  43. } > ram
  44. .eh_frame :
  45. {
  46. *(.eh_frame)
  47. } > rom
  48. .jcr :
  49. {
  50. *(.jcr)
  51. } > rom
  52. .gcc_exc :
  53. {
  54. *(.gcc_exc)
  55. } > rom
  56. .tors :
  57. {
  58. __CTOR_LIST__ = .;
  59. LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
  60. ___ctors = . ;
  61. *(.ctors)
  62. ___ctors_end = . ;
  63. LONG(0)
  64. __CTOR_END__ = .;
  65. __DTOR_LIST__ = .;
  66. LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
  67. ___dtors = . ;
  68. *(.dtors)
  69. ___dtors_end = . ;
  70. LONG(0)
  71. __DTOR_END__ = .;
  72. . = ALIGN(2);
  73. _mdata = .;
  74. PROVIDE(___mdata_end = .);
  75. } > rom
  76. /* program code area */
  77. .text : AT (_mdata)
  78. {
  79. PROVIDE(___text_start = .);
  80. *(.text)
  81. . = ALIGN(2);
  82. _etext = .;
  83. PROVIDE(___text_end = .);
  84. } > ram
  85. /* ROM image of the initialized data area */
  86. .data : {
  87. PROVIDE(___data_start = .);
  88. _data = .;
  89. *(.data)
  90. _edata = .;
  91. PROVIDE(___data_end = .);
  92. } > ram
  93. /* uninitialized data area */
  94. .bss :
  95. {
  96. PROVIDE(___bss_start = .);
  97. _bss = .;
  98. *(.bss)
  99. *(COMMON)
  100. . = ALIGN(0x02);
  101. _ebss = .;
  102. _end = .;
  103. PROVIDE(___bss_end = .);
  104. } > ram
  105. /* set stack pointer to the end of internal RAM */
  106. PROVIDE(___stack = 0xffff20);
  107. .stab . (NOLOAD) :
  108. {
  109. [ .stab ]
  110. }
  111. .stabstr . (NOLOAD) :
  112. {
  113. [ .stabstr ]
  114. }
  115. /DISCARD/ :
  116. {
  117. *(.comment)
  118. }
  119. }