diff --git a/fx9860g.ld b/fx9860g.ld index 14df6ef..9b02184 100644 --- a/fx9860g.ld +++ b/fx9860g.ld @@ -15,12 +15,14 @@ MEMORY { /* Userspace mapping of the add-in (G1A header takes 0x200 bytes) */ rom (rx): o = 0x00300200, l = 500k - /* This is mapped to RAM; 8k on SH3, apparently 32k on SH4 */ - ram (rw): o = 0x08100000, l = 8k - /* gint's VBR space, mentioned here for completeness */ - vbr (rwx): o = 0x8800e000, l = 5k - /* Some RAM region from P1 area; gint's data will reside here */ - rram (rwx): o = 0x8800f400, l = 3k + /* This is mapped to RAM; 8k on SH3, 32k on SH4. Since gint uses the + last 2k for its VBR and mapped code, 6k are left */ + ram (rw): o = 0x08100200, l = 6k + /* This is the VBR space. The [ram] region is mapped to 8801c000. This + region is used at load time and mentioned here for completeness */ + vbr (rwx): o = 0x8801da00, l = 1536 + /* These first bits of RAM are used for gint's perma-mapped code */ + rram (rwx): o = 0x8801c000, l = 512 /* On-chip IL memory */ ilram (rwx): o = 0xe5200000, l = 4k /* On-chip X and Y memory */ @@ -133,13 +135,15 @@ SECTIONS /* Read-write data going to RAM: - Data sections generated by the compiler (.data and .data.*) - - Data sections from fxlib, "D" */ + - Data sections from fxlib, "D" + - Data sections from gint (.gint.data) */ .data ALIGN(4) : ALIGN(4) { _ldata = LOADADDR(.data); _rdata = . ; *(.data .data.*) *(D) + *(.gint.data .gint.data.sh3) . = ALIGN(16); } > ram AT> rom @@ -152,6 +156,16 @@ SECTIONS _sdata = SIZEOF(.data) + SIZEOF(.data.4); + /* gint's uninitialized BSS section */ + .gint.bss (NOLOAD) : { + /* Since it's uninitialized, the location doesn't matter */ + *(.gint.bss) + + . = ALIGN(16); + } > ram :NONE + + _sgbss = SIZEOF(.gint.bss); + /* On-chip memory sections: IL, X and Y memory */ . = ORIGIN(ilram); @@ -192,8 +206,6 @@ SECTIONS /* ** RRAM sections - ** 8800e000:5k VBR space - ** 8800f400:3k .gint.data and .gint.bss */ /* VBR address: let's just start at the beginning of the RRAM area. @@ -204,14 +216,11 @@ SECTIONS . = ORIGIN(rram); - /* gint's data section, going to Real RAM. This section contains many - small objects from the library (static/global variables, etc) */ + /* Code that must remain permanently mapped (.gint.mapped) */ .gint.data ALIGN(4) : ALIGN(4) { _lgdata = LOADADDR(.gint.data); _rgdata = . ; - *(.gint.data .gint.data.*) - /* Also code that must remain permanently mapped! */ *(.gint.mapped) @@ -220,17 +229,6 @@ SECTIONS _sgdata = SIZEOF(.gint.data); - /* gint's uninitialized BSS section, going to Real RAM. All the large - data arrays will be located here */ - .gint.bss (NOLOAD) : { - /* Since it's uninitialized, the location doesn't matter */ - *(.gint.bss .gint.bss.*) - - . = ALIGN(16); - } > rram :NONE - - _sgbss = SIZEOF(.gint.bss); - /*