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.

C/C++ > Archives with devkitARM

#33365 - rmy - Sun Jan 02, 2005 2:37 pm

Hi!

Has anyone had success using static libraries with devkitARM?

I'm doing something similar to:

rm -f libSagaEngine.a
arm-elf-ar -qsvP libSageEngine.a obj1.o obj2.o etc.o
arm-elf-g++ -v -O2 -g -specs=gba.specs -mthumb-interwork -o run.elf GbaStart.o libSagaEngine.a

But it seems like I get some trouble with segments. objdump from the standard linking of .o's differ from the linking from the library.

Adding my file data with:
arm-elf-objcopy --add-section .gfx=res.gfs --set-section-flags .gfx=contents,alloc,load,readonly,data,contents --adjust-section-vma .gfx=0x08280000 run.elf merged.elf

Renders the warnings:

Code:

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: run.elf: warning: Empty loadable segment detected, is this intentional ?

BFD: merged.elf: warning: allocated section `.gfx' not in segment
arm-elf-objcopy -O binary merged.elf merged.gba

(The last line is normal, but has never mattered before).

I do have global variables and object instances in the .a, and also mix ARM and THUMB code in it... Don't know if that is important.

Grateful for any feedback.

-Rune-