This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Failed at -Wl,-nmagic
Hi Nick,
> Well it appears that you are using a Code Sourcery toolchain, so you should
> really ask them. ?But there are a few things that you can try:
The same error occurs if I use another mipsel-linux toolchain. It
doesn't seem to be due to the distribution of the gcc toolchain.
>
> ?* Does the linking work if you just drop the "-Wl,--nmagic" from
> ? ?above command line ? ?If it does, then the most likely culprit
> ? ?is the spec file that gcc is using to generate the linker command
> ? ?line. ?Have a look at that and see if anything stands out.
> ?* Are you using the most recent version of the linker ? ?(v2.20 or
> ? ?else the head of the mainline development sources). ?If not then
> ? ?please try them.
The version of the linker is:
GNU ld (Sourcery G++ Lite 4.3-154) 2.19.51.20090205
> ?* If you add "-Wl,--verbose" to the command line you should see
> ? ?where the linker searches for the gcc_s library. ?Perhaps you
> ? ?can work out which search path is missing.
There is a libgcc_s.so in the search path of the linker. There is no libgcc_s.a.
What confused me is that the -nmagic option seems okay for flat code
wihout any default libraries. For example:
mipsel-linux-gcc -Os -G0 -mips32r2 -fno-pic -fno-builtin -c myapp.c
mipsel-linux-ld -nmagic myapp.o -o myapp.app
Is it relative between some defulat library and the alignment of
sections? It doesn't sound reasonable.
PRC
Dec 2,2009