gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > compiling/linking confusion

#87003 - loading - Sun Jun 11, 2006 10:49 am

if i want to run a c program from like 0x2300000 instead of the standart adress and use libnds how would i do that?

if i have had a simple assembler source i'd type
arm-elf-as -o myasm.o myasm.s
arm-elf-ld -Ttext 0x02300000 -o myasm.elf myasm.o
arm-elf-objcopy -O binary -S myasm.elf myasm.bin

but how to do something similar with all these complex build scripts and stuff? Any simple way to do that?

#87137 - wintermute - Mon Jun 12, 2006 5:30 am

add -Wl,--section-start,.init=0x02300000 to LDFLAGS
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#87147 - chishm - Mon Jun 12, 2006 8:17 am

You'll also need to change the start address of the loaded binary using NDSTOOL flags, but I don't know how to do that without uglifying (sp? ;p) the makefile.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#87172 - loading - Mon Jun 12, 2006 3:01 pm

thank you very much :) works perfectly.