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.

fx9860g.ld 5.8KB

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