This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem linking with static libraries for arm-elf


>  On 4/11/06, Apostol Terziev <stinky@inray.spnet.net> 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.


                        ------Carl

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]