This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: A patch for elf32.em (Re: GNU/Linux vs. libtool --no-undefined)
On Wed, Feb 07, 2001 at 05:07:07AM -0200, Alexandre Oliva wrote:
> On Feb 7, 2001, Ian Lance Taylor <ian@zembu.com> wrote:
>
> > The original error appears to be warning about an undefined symbol
> > reference from a shared library. Is that so? If it is, then I think
> > the linker should be fixed to not warn about undefined references from
> > shared libraries, even when --no-undefined is used. We care whether
> > each reference is satisfied somewhere. I don't think we care whether
> > each shared library included in the link has all symbols satisfied.
> > Do we?
>
> When my program dlopens B (with RTLD_LAZY, of course :-), it works
> fine, and I'm a happy camper. Until, some day, after refactoring some
> components in A, I exercise some seldom-exercised feature, and the
> program crashes.
You can remove RTLD_LAZY during development.
>
> Some investigation leads to the conclusion that B had an undefined
> symbol that it expected to get from A, but that I had forgotten to
> define in A.
>
> Why didn't --no-undefined work? Should the fact that A is shared or
> static make any difference?
>
Yes. A can change at any time if it is shared. In fact, you don't even
know what A looks like at the runtime when you build B.
--
H.J. Lu (hjl@valinux.com)