This is the mail archive of the binutils@sources.redhat.com 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]

preventing ld from discarding all symbols from archive files


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



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