From 8e547c6783d6619979b246936b4778fe59bc4c3a Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 17 Oct 2023 21:53:50 +0100 Subject: [PATCH] derive the data ends --- agb/gba.ld | 10 +++++++--- book/games/pong/gba.ld | 10 +++++++--- examples/amplitude/gba.ld | 10 +++++++--- examples/combo/gba.ld | 10 +++++++--- examples/hyperspace-roll/gba.ld | 10 +++++++--- examples/the-dungeon-puzzlers-lament/gba.ld | 10 +++++++--- examples/the-hat-chooses-the-wizard/gba.ld | 10 +++++++--- examples/the-purple-night/gba.ld | 10 +++++++--- template/gba.ld | 10 +++++++--- tracker/agb-tracker/gba.ld | 10 +++++++--- 10 files changed, 70 insertions(+), 30 deletions(-) diff --git a/agb/gba.ld b/agb/gba.ld index 47917308..72752f95 100644 --- a/agb/gba.ld +++ b/agb/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/book/games/pong/gba.ld b/book/games/pong/gba.ld index 47917308..72752f95 100644 --- a/book/games/pong/gba.ld +++ b/book/games/pong/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/examples/amplitude/gba.ld b/examples/amplitude/gba.ld index 47917308..72752f95 100644 --- a/examples/amplitude/gba.ld +++ b/examples/amplitude/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/examples/combo/gba.ld b/examples/combo/gba.ld index 47917308..72752f95 100644 --- a/examples/combo/gba.ld +++ b/examples/combo/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/examples/hyperspace-roll/gba.ld b/examples/hyperspace-roll/gba.ld index 47917308..72752f95 100644 --- a/examples/hyperspace-roll/gba.ld +++ b/examples/hyperspace-roll/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/examples/the-dungeon-puzzlers-lament/gba.ld b/examples/the-dungeon-puzzlers-lament/gba.ld index 47917308..72752f95 100644 --- a/examples/the-dungeon-puzzlers-lament/gba.ld +++ b/examples/the-dungeon-puzzlers-lament/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/examples/the-hat-chooses-the-wizard/gba.ld b/examples/the-hat-chooses-the-wizard/gba.ld index 47917308..72752f95 100644 --- a/examples/the-hat-chooses-the-wizard/gba.ld +++ b/examples/the-hat-chooses-the-wizard/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/examples/the-purple-night/gba.ld b/examples/the-purple-night/gba.ld index 47917308..72752f95 100644 --- a/examples/the-purple-night/gba.ld +++ b/examples/the-purple-night/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/template/gba.ld b/template/gba.ld index 47917308..72752f95 100644 --- a/template/gba.ld +++ b/template/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab) diff --git a/tracker/agb-tracker/gba.ld b/tracker/agb-tracker/gba.ld index 47917308..72752f95 100644 --- a/tracker/agb-tracker/gba.ld +++ b/tracker/agb-tracker/gba.ld @@ -22,7 +22,6 @@ __text_start = ORIGIN(rom); SECTIONS { . = __text_start; - .text : { KEEP(*(.crt0)); *(.crt0 .crt0*); @@ -46,6 +45,7 @@ SECTIONS { __iwram_data_start = ADDR(.iwram); __iwram_rom_start = LOADADDR(.iwram); __iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2; + __iwram_end = __iwram_data_start + SIZEOF(.iwram); .ewram : { *(.ewram .ewram.*); @@ -53,6 +53,7 @@ SECTIONS { *(.data .data.*); . = ALIGN(4); + } > ewram AT>rom __ewram_data_start = ADDR(.ewram); __ewram_rom_start = LOADADDR(.ewram); @@ -61,8 +62,11 @@ SECTIONS { .bss : { *(.bss .bss.*); . = ALIGN(4); - __iwram_end = ABSOLUTE(.); - } > iwram + = ABSOLUTE(.); + } > ewram + + __ewram_data_end = __ewram_data_start + SIZEOF(.ewram) + SIZEOF(.bss); + .shstrtab : { *(.shstrtab)