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

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