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

Re: png2/3 problem apparently successfully solved with -Bsymbolic



On Tue, 20 Aug 2002, Luca Barbieri wrote:
> > Well, either this or using versioned symbols is required, and would have
> > almost the same effect.
> Do they work without needing to recompile programs?

They work without a recompile, BUT they fix nothing on that case: the first
symbol found will be used.  They don't worsen the breakage, though.

They do break the ABI in a backwards-compatible manner (old stuff will work
with either versioned or non-versioned libs.  New stuff will want the
versioned libs).

> This is just a way to solve the current problem of having to choose
> between a libpng2 or libpng3 system rather than a long-term plan for
> shared library design.

[...]

> > compile something with -Bsymbolic, you cannot override the symbols it
> > both defines and uses.  So, -Bsymbolic is more prone to cause side-efects
> > than versioned symbols.
> Surely. Are there any known real-world problems that would be caused by
> this?

Yes, if you apply -Bsymbolic to a lib you will need to override symbols for
some trickery.  I don't know if it won't cause trouble for debuggers,
either.

> > >         1. Directly links to the desired version of libpng
> > >         2. Is either the main program or is linked with -Bsymbolic
> > (2) should NOT be needed. At least not if the explanation of -Bsymbolic drow
> > gave me on IRC (which seems to be what the ld info page says about the
> > matter) is correct.
> It is necessary because otherwise the library/program will use the first
> version of libpng in the global search list, which is exactly what we
> want to avoid.

But -Bsymbolic is supposed to apply only to symbols that were defined AND
used (as in inclusive AND) in that module.  Either that, or drow is wrong,
the ld info page is broken:

  "When creating a shared library, bind references to global symbols          
   to the definition within the shared library, if any." -- ld info page

So, you're saying that it applies to all global symbols used within the
library (regardless of wether it defines the symbol or just uses it from
somewhere else) ?

> It won't work. -Bsymbolic affects the search path of the object that it
> is applied to so applying it to just libpng? is not enough (AFAIK) (But
> necessary because, as ridiculous as it may seem, one of the libpngs will
> use symbols from the other one).

The question is: *how* -Bsymbolic affects the search of symbols that are
external to the module it was applied to (as in used by the module, but
defined elsewhere)?

Your information about the issue clearly differs from mine, so that's why I
asked you to test it -- you already have a proper test case to do it at
hand.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh



Reply to: