[Top][All Lists]

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

Re: Problem with linking ununsed symbols in a shared library

From: Shridhar Daithankar
Subject: Re: Problem with linking ununsed symbols in a shared library
Date: Tue, 5 Apr 2005 20:04:26 +0530
User-agent: KMail/1.7.2

On Tuesday 05 Apr 2005 7:09 pm, Ian Lance Taylor wrote:
> Shridhar Daithankar <address@hidden> writes:
> > The main.c does not have any reference to func4. main.c uses just func1
> > which is available in libtest1.so and does not use any function in
> > libtest2.so. So libtest2.so should not be required at all.
> The linker doesn't know that func1 does not need func4.  The linker
> only sees the defined reference in test1.so to func4.
> You can control this behaviour using the --unresolved-symbols option.
> See the documentation.
> > On HP-UX, the build is organized such that each directory produces an
> > archive library. Some of the directories produce binaries and I have the
> > link command line that is known to work on HP-UX.
> >
> > However specifying same dependent libraries produce aforementioned errors
> > on linux. The linux build is using shared libraries. If the linker could
> > figure the minimum required dependencies, it will be a great help to me
> > here.
> If the build worked using archive libraries on HP-UX, why not use
> archive libraries on Linux?  Shared libraries are similar, but
> different.
> The easy way to use shared libraries in a similar fashion would be to
> use --as-needed and link against every shared library.  Or to link all
> the objects together into a single shared library.

All the options you have suggested are correct but not feasible due to some 
non-technical reasons. 

However I will try to find a middle ground where I can adopt an intermediate 

Thanks for the suggestions.


reply via email to

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