From a0236bea8af2bd16d64558303c83240e2849763e Mon Sep 17 00:00:00 2001 From: RoamerX <20692776+RoamerX@users.noreply.github.com> Date: Thu, 18 Dec 2025 20:07:03 +0800 Subject: [PATCH] Update ld_script_modern.ld --- ld_script_modern.ld | 264 ++++++++++++++++++++++---------------------- 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/ld_script_modern.ld b/ld_script_modern.ld index 4493b73473..47989bd91f 100644 --- a/ld_script_modern.ld +++ b/ld_script_modern.ld @@ -1,132 +1,132 @@ -ENTRY(Start) - -gNumMusicPlayers = 4; -gMaxLines = 0; -gInitialMainCB2 = CB2_InitCopyrightScreenAfterBootup; - -MEMORY -{ - EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K - IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K - ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M -} - -SECTIONS { - - - .ewram ORIGIN(EWRAM) : AT (__ewram_lma) - ALIGN(4) - { - __ewram_start = .; - *(.ewram*) - . = ALIGN(4); - __ewram_end = .; - } > EWRAM - - .ewram.sbss (NOLOAD) : - ALIGN(4) - { - *.o(.sbss); - } > EWRAM - - .iwram ORIGIN(IWRAM) : AT (__iwram_lma) - ALIGN(4) - { - __iwram_start = .; - *(.iwram*); - . = ALIGN(4); - __iwram_end = .; - } > IWRAM - - .iwram.bss (NOLOAD) : - ALIGN(4) - { - *.o(.bss*); - *.o(common_data); - src/*.o(COMMON); - *libc.a:*.o(COMMON); - *libnosys.a:*.o(COMMON); - } > IWRAM - - /* BEGIN ROM DATA */ - - .text ORIGIN(ROM) : - ALIGN(4) - { - src/rom_header.o(.text*); - KEEP(*.o(.text.header_gf)); - KEEP(*.o(.text.header_rhh)); - src/crt0.o(.text); - *libagbsyscall.a:*.o(.text*); - *libgcc.a:*.o(.text*); - *libc.a:*.o(.text*); - *libnosys.a:*.o(.text*); - asm/*.o(.text*); - KEEP(*.o(.text.consts)); - *.o(.text*); - *.o(.eh_frame); - } > ROM =0 - - script_data : - ALIGN(4) - { - data/*.o(script_data); - } > ROM =0 - - .rodata : - ALIGN(4) - { - *.o(.rodata*); - *libgcc.a:*.o(.rodata*); - *libc.a:*.o(.rodata*); - *libc.a:*.o(.data*); - sound/songs/*.o(.rodata); - } > ROM =0 - - .data.iwram : - ALIGN(4) - { - __iwram_lma = .; - . = . + (__iwram_end - __iwram_start); - } > ROM = 0 - - .data.ewram : - ALIGN(4) - { - __ewram_lma = .; - . = . + (__ewram_end - __ewram_start); - } > ROM = 0 - - __rom_end = .; - - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - - /* Discard everything not specifically mentioned above. */ - /DISCARD/ : - { - *(*); - } -} +ENTRY(Start) + +gNumMusicPlayers = 4; +gMaxLines = 0; +gInitialMainCB2 = CB2_InitCopyrightScreenAfterBootup; + +MEMORY +{ + EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K + IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K + ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M +} + +SECTIONS { + + + .ewram ORIGIN(EWRAM) : AT (__ewram_lma) + ALIGN(4) + { + __ewram_start = .; + *(.ewram*) + . = ALIGN(4); + __ewram_end = .; + } > EWRAM + + .ewram.sbss (NOLOAD) : + ALIGN(4) + { + *.o(.sbss); + } > EWRAM + + .iwram ORIGIN(IWRAM) : AT (__iwram_lma) + ALIGN(4) + { + __iwram_start = .; + *(.iwram*); + . = ALIGN(4); + __iwram_end = .; + } > IWRAM + + .iwram.bss (NOLOAD) : + ALIGN(4) + { + *.o(.bss*); + *.o(common_data); + src/*.o(COMMON); + *libc.a:*.o(COMMON); + *libnosys.a:*.o(COMMON); + } > IWRAM + + /* BEGIN ROM DATA */ + + .text ORIGIN(ROM) : + ALIGN(4) + { + src/rom_header.o(.text*); + KEEP(*.o(.text.header_gf)); + KEEP(*.o(.text.header_rhh)); + src/crt0.o(.text); + *libagbsyscall.a:*.o(.text*); + *libgcc.a:*.o(.text*); + *libc.a:*.o(.text*); + *libnosys.a:*.o(.text*); + asm/*.o(.text*); + KEEP(*.o(.text.consts)); + *.o(.text*); + *.o(.eh_frame); + } > ROM =0 + + script_data : + ALIGN(4) + { + data/*.o(script_data); + } > ROM =0 + + .rodata : + ALIGN(4) + { + *.o(.rodata*); + *libgcc.a:*.o(.rodata*); + *libc.a:*.o(.rodata*); + *libc.a:*.o(.data*); + sound/songs/*.o(.rodata); + } > ROM =0 + + .data.iwram : + ALIGN(4) + { + __iwram_lma = .; + . = . + (__iwram_end - __iwram_start); + } > ROM = 0 + + .data.ewram : + ALIGN(4) + { + __ewram_lma = .; + . = . + (__ewram_end - __ewram_start); + } > ROM = 0 + + __rom_end = .; + + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* Discard everything not specifically mentioned above. */ + /DISCARD/ : + { + *(*); + } +}