public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Erik Leunissen <e.leunissen@hccnet.nl>
To: binutils@sourceware.org
Subject: Strange linking error
Date: Wed, 12 Jul 2006 22:17:00 -0000	[thread overview]
Message-ID: <44B574E1.50908@hccnet.nl> (raw)

I perceive an incompatibility with the following linker options when 
linking an object file into a shared object (ELF):

     --fatal-warnings
     -Map somefilename (or -M)

When supplying either, the link succeeds, and the link map is written.
In the case of "--fatal-warnings" being supplied (without -Map), there 
are no warnings written to stdout or stderr.
In the case of "-Map" being supplied (without --fatal-warnings), there 
are also no warnings written to stdout or stderr.

When supplying both[*], the link fails, the link map is written 
(identical contents as the successful case), and the following error is 
emitted:

     "collect2: ld returned 1 exit status"

This error message does not say why the exit status is 1, so here is 
where I get lost. Does anybody have a clue what's going on?

Thanks in advance,

Erik Leunissen


[*] below you find the complete invocation of "gcc -v" from make:

gcc -v -shared -Wl,-O2,-x,--fatal-warnings,-s,-Map,./linkmap.$$ -o 
/home/erik/Develop/stealth/bin/linux-x86/foo.so 
/home/erik/Develop/stealth/bin/linux-x86/foo.o 
-Wl,-Bstatic,-L/usr/local/lib,-ltclstub8.4 -Wl,-Bdynamic

Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.1/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr 
--with-local-prefix=/usr/local --infodir=/usr/share/info 
--mandir=/usr/share/man --libdir=/usr/lib 
--enable-languages=c,c++,f77,objc,java,ada --disable-checking 
--enable-libgcj --with-gxx-include-dir=/usr/include/g++ 
--with-slibdir=/lib --with-system-zlib --enable-shared 
--enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.1 (SuSE Linux)
  /usr/lib/gcc-lib/i586-suse-linux/3.3.1/collect2 --eh-frame-hdr -m 
elf_i386 -shared -o /home/erik/Develop/stealth/bin/linux-x86/foo.so 
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../crti.o 
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/crtbeginS.o 
-L/usr/lib/gcc-lib/i586-suse-linux/3.3.1 
-L/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../../i586-suse-linux/lib 
-L/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../.. -O2 -x 
--fatal-warnings -s -Map ./linkmap.8837 
/home/erik/Develop/stealth/bin/linux-x86/foo.o -Bstatic -L/usr/local/lib 
-ltclstub8.4 -Bdynamic -lgcc -lc -lgcc 
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/crtendS.o 
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../crtn.o
collect2: ld returned 1 exit status
make: *** [/home/erik/Develop/stealth/bin/linux-x86/foo.so] Error 1

== end of message ==

             reply	other threads:[~2006-07-12 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12 22:17 Erik Leunissen [this message]
2006-07-15 13:01 ` Alan Modra
2006-07-17 15:42   ` Erik Leunissen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44B574E1.50908@hccnet.nl \
    --to=e.leunissen@hccnet.nl \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).