mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-03 21:51:34 +11:00
Fix symbols for RAM section locations
Using the ld functions is not only more readable, but more accurate. Previous use of the `.` variable could occasionally have off-by-one errors.
This commit is contained in:
parent
9040844854
commit
7a1f554b72
24
agb/gba.ld
24
agb/gba.ld
|
@ -36,33 +36,27 @@ SECTIONS {
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} > rom
|
} > rom
|
||||||
|
|
||||||
__iwram_rom_start = .;
|
|
||||||
.iwram : {
|
.iwram : {
|
||||||
__iwram_data_start = ABSOLUTE(.);
|
|
||||||
|
|
||||||
*(.iwram .iwram.*);
|
*(.iwram .iwram.*);
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
|
||||||
*(.text_iwram .text_iwram.*);
|
*(.text_iwram .text_iwram.*);
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
|
||||||
__iwram_data_end = ABSOLUTE(.);
|
|
||||||
} > iwram AT>rom
|
} > iwram AT>rom
|
||||||
|
__iwram_data_start = ADDR(.iwram);
|
||||||
|
__iwram_rom_start = LOADADDR(.iwram);
|
||||||
|
__iwram_rom_length_halfwords = (SIZEOF(.iwram) + 1) / 2;
|
||||||
|
|
||||||
. = __iwram_rom_start + (__iwram_data_end - __iwram_data_start);
|
|
||||||
|
|
||||||
__ewram_rom_start = .;
|
|
||||||
.ewram : {
|
.ewram : {
|
||||||
__ewram_data_start = ABSOLUTE(.);
|
|
||||||
|
|
||||||
*(.ewram .ewram.*);
|
*(.ewram .ewram.*);
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
|
||||||
*(.data .data.*);
|
*(.data .data.*);
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
|
||||||
__ewram_data_end = ABSOLUTE(.);
|
|
||||||
} > ewram AT>rom
|
} > ewram AT>rom
|
||||||
|
__ewram_data_start = ADDR(.ewram);
|
||||||
|
__ewram_rom_start = LOADADDR(.ewram);
|
||||||
|
__ewram_rom_length_halfwords = (SIZEOF(.ewram) + 1) / 2;
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
*(.bss .bss.*);
|
*(.bss .bss.*);
|
||||||
|
@ -70,12 +64,6 @@ SECTIONS {
|
||||||
__iwram_end = ABSOLUTE(.);
|
__iwram_end = ABSOLUTE(.);
|
||||||
} > iwram
|
} > iwram
|
||||||
|
|
||||||
__iwram_rom_length_bytes = __iwram_data_end - __iwram_data_start;
|
|
||||||
__iwram_rom_length_halfwords = (__iwram_rom_length_bytes + 1) / 2;
|
|
||||||
|
|
||||||
__ewram_rom_length_bytes = __ewram_data_end - __ewram_data_start;
|
|
||||||
__ewram_rom_length_halfwords = (__ewram_rom_length_bytes + 1) / 2;
|
|
||||||
|
|
||||||
.shstrtab : {
|
.shstrtab : {
|
||||||
*(.shstrtab)
|
*(.shstrtab)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue