bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

preventing ld from discarding all symbols from archive files


From: Adam Williams
Subject: preventing ld from discarding all symbols from archive files
Date: Wed, 05 Sep 2001 09:22:05 -0700
User-agent: Mozilla/5.0 (X11; U; Linux 2.4.7 i686; en-US; rv:0.9) Gecko/20010505

If I run the following command:


ld -shared -o sharedlibrary.so part1.a part2.a part3.a


the linker discards every symbol in the .a files and produces an empty
shared library called sharedlibrary.so, not what any sane person wants.

What the linker formally does is treat any object files as targets and
archive files as dependancies, removing all symbols from the archive
files which aren't used in the targets.  Since there are no objects
this clears all the symbols.

Is there any way to force ld to keep all the symbols in the archive
files?  It's really inconvenient to specify the name of all the object
files in multiple directories or require a runtime environment to contain 100 shared libraries.

The following flags have no success:

-Ur
-r
-export-dynamic





reply via email to

[Prev in Thread] Current Thread [Next in Thread]