From 7a480adafe1f1f8f5b764ad21a7f8e113c63cb1f Mon Sep 17 00:00:00 2001 From: Michael Panzlaff Date: Sat, 17 Apr 2021 22:46:15 +0200 Subject: [PATCH] modern: add missing sections to linkerscript In order to correctly link a program which uses libc functions a few sections are required to satisfy the linker. This currently adds 0x3C bytes to IWRAM. --- ld_script_modern.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ld_script_modern.txt b/ld_script_modern.txt index b69ada8649..6f8d384534 100644 --- a/ld_script_modern.txt +++ b/ld_script_modern.txt @@ -27,6 +27,8 @@ SECTIONS { /* .bss starts at 0x3000000 */ src/*.o(.bss); gflib/*.o(.bss); + *libc.a:*.o(.bss); + *libnosys.a:*.o(.bss); /* .bss.code starts at 0x3001AA8 */ src/m4a.o(.bss.code); @@ -34,7 +36,8 @@ SECTIONS { /* COMMON starts at 0x30022A8 */ src/*.o(COMMON); gflib/*.o(COMMON); - *libc.a:sbrkr.o(COMMON); + *libc.a:*.o(COMMON); + *libnosys.a:*.o(COMMON); end = .; . = 0x8000; } @@ -82,6 +85,7 @@ SECTIONS { *libagbsyscall.a:*.o(.text*); *libgcc.a:*.o(.text*); *libc.a:*.o(.text*); + *libnosys.a:*.o(.text*); src/libisagbprn.o(.text); } =0