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 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. }
  24. SECTIONS
  25. {
  26. /*
  27. ** ROM sections
  28. */
  29. /* First address to be mapped to ROM (including G1A header) */
  30. _brom = 0x00300000;
  31. /* Size of ROM mappings */
  32. _srom = 0x200
  33. + SIZEOF(.text) + SIZEOF(.rodata)
  34. + SIZEOF(.gint.drivers) + SIZEOF(.gint.blocks);
  35. /* Machine code going to ROM:
  36. - Initialization sections (.pretext.entry and .pretext)
  37. - Compiler-provided constructors (.ctors) and destructors (.dtors)
  38. - All text from .text and .text.* (including user code)
  39. - Code sections from fxlib, named "C" and "P" */
  40. .pretext : {
  41. *(.pretext.entry)
  42. *(.pretext)
  43. _btors = . ;
  44. *(.ctors .ctors.*)
  45. _mtors = . ;
  46. *(.dtors .dtors.*)
  47. _etors = . ;
  48. } > rom
  49. .text : {
  50. *(.text .text.*)
  51. *(C P)
  52. } > rom
  53. /* Interrupt handlers going to ROM:
  54. - gint's interrupt handler blocks (.gint.blocks)
  55. Although gint's blocks end up in VBR space, they are selected and
  56. installed on-the-fly by the library and the drivers, so we can't
  57. just put them in the vbr region and wait for the copy */
  58. .gint.blocks : {
  59. KEEP(*(.gint.blocks));
  60. } > rom
  61. /* Driver data going to ROM:
  62. - Exposed driver interfaces (.gint.drivers)
  63. The driver information is required to start and configure the
  64. driver, even if the symbols are not referenced */
  65. .gint.drivers : {
  66. _bdrv = . ;
  67. KEEP(*(.gint.drivers.0));
  68. KEEP(*(.gint.drivers.1));
  69. KEEP(*(.gint.drivers.2));
  70. KEEP(*(.gint.drivers.3));
  71. KEEP(*(.gint.drivers.4));
  72. KEEP(*(.gint.drivers.5));
  73. KEEP(*(.gint.drivers.6));
  74. _edrv = . ;
  75. } > rom
  76. /* Read-only data going to ROM:
  77. - Resources or assets from fxconv or similar converters
  78. - Data marked read-only by the compiler (.rodata and .rodata.*) */
  79. .rodata : SUBALIGN(4) {
  80. *(.rodata .rodata.*)
  81. } > rom
  82. /*
  83. ** RAM sections
  84. */
  85. . = ORIGIN(ram);
  86. /* BSS stuff going to RAM:
  87. - Data marked BSS by the compiler
  88. - BSS sections from fxlib, namely "B" and "R"
  89. The BSS section is to be stripped from the ELF file later, and wiped
  90. at startup. */
  91. .bss (NOLOAD) : {
  92. _rbss = . ;
  93. *(.bss COMMON)
  94. *(B R)
  95. . = ALIGN(16);
  96. } > ram :NONE
  97. _sbss = SIZEOF(.bss);
  98. /* Read-write data going to RAM:
  99. - Data sections generated by the compiler (.data and .data.*)
  100. - Data sections from fxlib, "D" */
  101. .data ALIGN(4) : ALIGN(4) {
  102. _ldata = LOADADDR(.data);
  103. _rdata = . ;
  104. *(.data .data.*)
  105. *(D)
  106. . = ALIGN(16);
  107. } > ram AT> rom
  108. /* Read-write data sub-aligned to 4 bytes (mainly from fxconv) */
  109. .data.4 : SUBALIGN(4) {
  110. *(.data.4)
  111. . = ALIGN(16);
  112. } > ram AT> rom
  113. _sdata = SIZEOF(.data) + SIZEOF(.data.4);
  114. /*
  115. ** RRAM sections
  116. ** 8800e000:4k VBR space
  117. ** 8800f000:4k .gint.data and .gint.bss
  118. */
  119. /* VBR address: let's just start at the beginning of the RRAM area.
  120. There's an unused 0x100-byte gap at the start of the VBR space.
  121. The VBR space is already a large block (> 2 kiB), so I'm cutting off
  122. the gap to spare some memory */
  123. _gint_vbr = 0x8800df00;
  124. . = ORIGIN(rram);
  125. /* gint's data section, going to Real RAM. This section contains many
  126. small objects from the library (static/global variables, etc) */
  127. .gint.data ALIGN(4) : ALIGN(4) {
  128. _lgdata = LOADADDR(.gint.data);
  129. _rgdata = . ;
  130. *(.gint.data .gint.data.*)
  131. . = ALIGN(16);
  132. } > rram AT> rom
  133. _sgdata = SIZEOF(.gint.data);
  134. /* gint's uninitialized BSS section, going to Real RAM. All the large
  135. data arrays will be located here */
  136. .gint.bss (NOLOAD) : {
  137. /* Since it's uninitialized, the location doesn't matter */
  138. *(.gint.bss .gint.bss.*)
  139. . = ALIGN(16);
  140. } > rram :NONE
  141. _sgbss = SIZEOF(.gint.bss);
  142. /*
  143. ** Other sections
  144. */
  145. /* Unwanted sections going to meet Dave Null:
  146. - Debug sections, often come out of libgcc
  147. - Java classes registration (why are there even here?)
  148. - Asynchronous unwind tables: no C++ exception handling for now ^^
  149. - Comments or anything the compiler might put in its assembler
  150. - A stack section sometimes generated for build/version.o */
  151. /DISCARD/ : {
  152. *(.debug_info .debug_abbrev .debug_loc .debug_aranges
  153. .debug_ranges .debug_line .debug_str)
  154. *(.jcr)
  155. *(.eh_frame_hdr)
  156. *(.eh_frame)
  157. *(.comment)
  158. }
  159. }