Page 1 of 1

Linker Group Issue

Posted: Tue Jul 27, 2010 5:20 pm
by automaton
I'm having an issue defining abort in my own C library when using a linking group and libgcc.a is outside of the link group. For instance, if my Makefile included:
arm-eabi-ld --entry=__start -T ld.script -o foo.bin foo.o --start-group -lmylib -lmylib2 --end-group "c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.0/libgcc.a"

abort is not found in mylib.a and I will get an undefined reference to `abort' in the following functions: unwind_phase2, __gnu_Unwind_Resume, _Unwind_GetDataRelBase, _Unwind_GetTextRelBase.

The link will complete successfully if I use the following:
arm-eabi-ld --entry=__start -T ld.script -o foo.bin foo.o --start-group -lmylib -lmylib2 "c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.0/libgcc.a" --end-group

With CodeSourcery, my original link command works correctly. Might this be a bug with devkitARM?

Re: Linker Group Issue

Posted: Wed Jul 28, 2010 1:10 pm
by WinterMute
No, this is the default behaviour with gcc for a baremetal arm target. It's possible Codesourcery have modified their build to avoid some circular dependencies.

Is it worth looking at replacing whatever functions are being used from libgcc?