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: Troubles linking with ld


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks. I have rewritten the makefile to include the separate .a
files which worked. I am curious, though, if including a .a within
another .a is possible, what purpose does it serve if the linker
cannot handle it when creating a .so?

Thanks,

SH

On Wed, 08 Feb 2006 02:27:44 -0500 Ian Lance Taylor <ian@airs.com>
wrote:
><securehell@hushmail.com> writes:
>
>> 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.
>
>Yes, it looks like you put an archive file inside another archive
>file.  The linker doesn't understand that.  Archive files that you
>pass to the linker should only contain object files.
>
>You can put the entire contents of one archive into another by
>doing
>something like:
>
>    mkdir tmp
>    cd tmp
>    ar x ../INNERARCHIVE
>    ar rcv ../OUTERARCHIVE *.o
>
>Ian
-----BEGIN PGP SIGNATURE-----
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 2.4

wkYEARECAAYFAkPqMRwACgkQRBFe1uc9INofrwCcDD10RelEmhnkTJ8ptFrWyjDJ/pQA
oIU/NLm6rY6mQZlBBp0v3X9mfi6t
=8HEq
-----END PGP SIGNATURE-----



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