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


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: Failed at -Wl,-nmagic


Hi Pan,

I wanted to turn off page alignment for sections in order to reduce
the output ELF image size, but
got errors:
mips-linux-gnu-gcc -Os -mips32r2 -EL -pipe -W -c myapp.c -o myapp.o
mips-linux-gnu-gcc -Wl,--nmagic -EL -o myapp.app myapp.o
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/mips-linux-gnu/4.3.3/../../../../mips-linux-gnu/bin/ld:
cannot find -lgcc_s

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:


  * 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.

  * 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.

Cheers
  Nick


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