Problem linking with static libraries for arm-elf

Carl Miller
Tue Apr 11 16:46:00 GMT 2006

>  On 4/11/06, Apostol Terziev <> wrote:
> >  I'm sorry, I've cut and pasted the compiler output, not the linker one.
> > Here is what the linker says:
> >
> > arm-elf-gcc C:\Progra~1\ARMor\eclipse\gcc\arm-elf\lib\libsys.a
> > ./src/main.o -lsys -nostartfiles -nodefaultlibs -nostdlib -static
> > -LC:\cygwin\home\Administrator\soft\arm-elf\lib
> > -LC:\cygwin\home\Administrator\soft\arm-elf\lib -LC:\Program
> > Files\ARMor\eclipse\gcc\lib\gcc\arm-elf\4.0.2 -Xlinker -Tlpc210x.ld
> > -Xlinker -static -otest.elf
> >  lpc210x.ld:299: undefined symbol `endless_loop' referenced in expression
> > collect2: ld returned 1 exit status
> > make: *** [test.elf] Error 1
> > make: Target `all' not remade because of errors.
On Tue, Apr 11, 2006 at 08:28:26AM -0400, Jay Kulpinski wrote:
> Is it ignoring crt0.o in your libsys.a because you have
> "-nostartfiles" on the command line?  What happens if you rename that
> object to something other than a startup file name?

I would first try just putting main.o before libsys.a on the command
line -- my first suspicion is that it's looking at libsys.a first,
saying, "I've got no unresolved symbols; don't need to pull in any
objects from this library", then moving on to main.o, and never looking
back at libsys.a.

Remember that order is significant in libraries passed by name or with
the -l switch, unless you bracket with --start-group / --end-group.


For unsubscribe information see

More information about the crossgcc mailing list