This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Troubles linking with ld
- From: <securehell at hushmail dot com>
- To: <drow at false dot org>
- Cc: <binutils at sourceware dot org>
- Date: Tue, 7 Feb 2006 20:53:00 -0500
- Subject: Re: Troubles linking with ld
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
OK so my first shared object library is linking and I can compile
an executable against it. I'm happier.
My next challenge: I actually build 4 different .so libraries. The
first so far has compiled/linked.
The next library is built the same as my previous library with one
exception: When I link the objects I am getting the following error:
gcc -shared -Wl,--whole-archive -fPIC -o libnew2.so file6.o
libfiles12.a libfiles56.a libnew.so -Wl,--no-whole-archive
libfiles12.a: member libfiles12.a(libfiles78.a) in archive is not
an object
So one of the archives is created which includes another archive(s)
but the linking step doesn't like it. By the way, I have verified
that the libfiles78.a is correct with "ar x libfiles12.a
libfiles78.a" and everything looked fine.
Any suggestions?
SH
On Tue, 07 Feb 2006 18:02:33 -0500 Daniel Jacobowitz
<drow@false.org> wrote:
>On Tue, Feb 07, 2006 at 06:00:49PM -0500, securehell@hushmail.com
>wrote:
>> OK, I'll resist the temptation to ask numerous questions about
>why
>> I can't use ld here and just go with your suggestion...
>
>Run gcc -v, see what it's doing. If you don't understand
>everything
>it does, I recommend letting it do it :-)
>
>> gcc -shared -Wl,--whole-archive -fPIC -o libnew.so file5.o
>> libfiles12.a libfiles34.a
>>
>> /usr/lib/gcc/x86_64-redhat-
>> linux/3.4.4/libgcc.a(_muldi3.oS)(.text+0x0): In function
>`__multi3':
>> : multiple definition of `__multi3'
>> /usr/lib/gcc/x86_64-redhat-
>> linux/3.4.4/libgcc.a(_muldi3.oS)(.text+0x0): first defined here
>
>Use -Wl,--no-whole-archive after your own libraries.
>
>
>--
>Daniel Jacobowitz
>CodeSourcery
-----BEGIN PGP SIGNATURE-----
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 2.4
wkYEARECAAYFAkPpTgsACgkQRBFe1uc9INrLSgCgqoPHghECFFLncjlMc8qjBDAR9V8A
oIHV2aMCzKpWpx9BRRMUHgV+6PaV
=IOd3
-----END PGP SIGNATURE-----