Alternative library and kernel for add-in development on fx-9860G and fx-CG50 under Linux.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fxcg50.ld 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /*
  2. Linker script for fxcg50 add-ins. Most symbols are used in the startup
  3. routine in core/start.c; some others in core/setup.c.
  4. */
  5. /* All fxcg50 have SH4 processors (finally rid of compatibility issues) */
  6. OUTPUT_ARCH(sh4)
  7. /* ELF offers a lot of symbol/section/relocation insights */
  8. OUTPUT_FORMAT(elf32-sh)
  9. /* Located in core/start.c */
  10. ENTRY(_start)
  11. MEMORY
  12. {
  13. /* Userspace mapping of the add-in (without G3A header) */
  14. rom (rx): o = 0x00300000, l = 220k
  15. /* Static RAM; stack grows down from the end of this region.
  16. The first 0x2000 bytes are reserved by gint, see below */
  17. ram (rw): o = 0x08102000, l = 512k
  18. /* gint's VBR space, mentioned here for completeness */
  19. vbr (rwx): o = 0x8c160000, l = 5k
  20. /* Some RAM region from P1 area; gint's data will reside here */
  21. rram (rwx): o = 0x8c161400, l = 3k
  22. /* On-chip IL memory */
  23. ilram (rwx): o = 0xe5200000, l = 4k
  24. /* On-chip X and Y memory */
  25. xram (rwx): o = 0xe5007000, l = 8k
  26. yram (rwx): o = 0xe5017000, l = 8k
  27. }
  28. SECTIONS
  29. {
  30. /*
  31. ** ROM sections
  32. */
  33. /* First address to be mapped to ROM */
  34. _brom = 0x00300000;
  35. /* Size of ROM mappings */
  36. _srom = SIZEOF(.text) + SIZEOF(.rodata)
  37. + SIZEOF(.gint.drivers) + SIZEOF(.gint.blocks);
  38. /* Machine code going to ROM:
  39. - Initialization sections (.pretext.entry and .pretext)
  40. - Compiler-provided constructors (.ctors) and destructors (.dtors)
  41. - All text from .text and .text.* (including user code) */
  42. .text : {
  43. *(.pretext.entry)
  44. *(.pretext)
  45. _btors = . ;
  46. *(.ctors .ctors.*)
  47. _mtors = . ;
  48. *(.dtors .dtors.*)
  49. _etors = . ;
  50. _gint_exch_tlbh_start = . ;
  51. *(.gint.exch_tlbh);
  52. _gint_exch_tlbh_size = ABSOLUTE(. - _gint_exch_tlbh_start);
  53. *(.text .text.*)
  54. } > rom
  55. /* Interrupt handlers going to ROM:
  56. - gint's interrupt handler blocks (.gint.blocks)
  57. Although gint's blocks end up in VBR space, they are installed at
  58. startup by the library/drivers, so we store them here for now */
  59. .gint.blocks : {
  60. KEEP(*(.gint.blocks));
  61. } > rom
  62. /* Driver data going to ROM:
  63. - Exposed driver interfaces (.gint.drivers)
  64. The driver information is required to start and configure the
  65. driver, even if the symbols are not referenced */
  66. .gint.drivers : {
  67. _bdrv = . ;
  68. KEEP(*(.gint.drivers.0));
  69. KEEP(*(.gint.drivers.1));
  70. KEEP(*(.gint.drivers.2));
  71. KEEP(*(.gint.drivers.3));
  72. KEEP(*(.gint.drivers.4));
  73. KEEP(*(.gint.drivers.5));
  74. KEEP(*(.gint.drivers.6));
  75. _edrv = . ;
  76. } > rom
  77. /* Read-only data going to ROM:
  78. - Resources or assets from fxconv or similar converters
  79. - Data marked read-only by the compiler (.rodata and .rodata.*) */
  80. .rodata : SUBALIGN(4) {
  81. /* Put these first, they need to be 4-aligned */
  82. *(.rodata.4)
  83. *(.rodata .rodata.*)
  84. } > rom
  85. /*
  86. ** RAM sections
  87. */
  88. . = ORIGIN(ram);
  89. /* BSS data going to RAM. The BSS section is to be stripped from the
  90. ELF file later, and wiped at startup */
  91. .bss (NOLOAD) : {
  92. _rbss = . ;
  93. *(.bss COMMON)
  94. . = ALIGN(16);
  95. } > ram :NONE
  96. _sbss = SIZEOF(.bss);
  97. /* Read-write data sextions going to RAM (.data and .data.*) */
  98. .data ALIGN(4) : ALIGN(4) {
  99. _ldata = LOADADDR(.data);
  100. _rdata = . ;
  101. *(.data .data.*)
  102. . = ALIGN(16);
  103. } > ram AT> rom
  104. /* Read-write data sub-aligned to 4 bytes (mainly from fxconv) */
  105. .data.4 : SUBALIGN(4) {
  106. *(.data.4)
  107. . = ALIGN(16);
  108. } > ram AT> rom
  109. _sdata = SIZEOF(.data) + SIZEOF(.data.4);
  110. /* On-chip memory sections: IL, X and Y memory */
  111. . = ORIGIN(ilram);
  112. .ilram ALIGN(4) : ALIGN(4) {
  113. _lilram = LOADADDR(.ilram);
  114. _rilram = . ;
  115. *(.ilram)
  116. . = ALIGN(16);
  117. } > ilram AT> rom
  118. . = ORIGIN(xram);
  119. .xram ALIGN(4) : ALIGN(4) {
  120. _lxram = LOADADDR(.xram);
  121. _rxram = . ;
  122. *(.xram)
  123. . = ALIGN(16);
  124. } > xram AT> rom
  125. . = ORIGIN(yram);
  126. .yram ALIGN(4) : ALIGN(4) {
  127. _lyram = LOADADDR(.yram);
  128. _ryram = . ;
  129. *(.yram)
  130. . = ALIGN(16);
  131. } > yram AT> rom
  132. _silram = SIZEOF(.ilram);
  133. _sxram = SIZEOF(.xram);
  134. _syram = SIZEOF(.yram);
  135. /*
  136. ** gint-related sections
  137. ** 8c160000:4k VBR space
  138. ** 8c161000:4k .gint.data and .gint.bss
  139. */
  140. /* VBR address: let's just start at the beginning of the RAM area.
  141. There's an unused 0x100-byte gap at the start of the VBR space.
  142. The VBR space is already a large block (> 2 kiB), so I'm cutting off
  143. the gap to spare some memory */
  144. _gint_vbr = ORIGIN(vbr) - 0x100;
  145. . = ORIGIN(rram);
  146. /* gint's data section, going to static RAM. This section contains many
  147. small objects from the library (static/global variables, etc) */
  148. .gint.data ALIGN(4) : ALIGN(4) {
  149. _lgdata = LOADADDR(.gint.data);
  150. _rgdata = . ;
  151. *(.gint.data .gint.data.*)
  152. . = ALIGN(16);
  153. } > rram AT> rom
  154. _sgdata = SIZEOF(.gint.data);
  155. /* gint's uninitialized BSS section, going to static RAM. All the large
  156. data arrays will be located here */
  157. .gint.bss (NOLOAD) : {
  158. /* Since it's uninitialized, the location doesn't matter */
  159. *(.gint.bss .gint.bss.*)
  160. . = ALIGN(16);
  161. } > rram :NONE
  162. _sgbss = SIZEOF(.gint.bss);
  163. /*
  164. ** Other sections
  165. */
  166. /* Unwanted sections going to meet Dave Null:
  167. - SH3-only data sections
  168. - Debug sections, often come out of libgcc
  169. - Java classes registration (why are there even here?)
  170. - Asynchronous unwind tables: no C++ exception handling for now ^^
  171. - Comments or anything the compiler might put in its assembler */
  172. /DISCARD/ : {
  173. *(.gint.bss.sh3)
  174. *(.gint.data.sh3)
  175. *(.debug_info .debug_abbrev .debug_loc .debug_aranges
  176. .debug_ranges .debug_line .debug_str)
  177. *(.jcr)
  178. *(.eh_frame_hdr)
  179. *(.eh_frame)
  180. *(.comment)
  181. }
  182. }