2007/559: new symbol visibilities - EXPORTED, SINGLETON, and ELIMINATE

Rod Evans Rod.Evans at sun.com
Tue Oct 2 13:03:00 PDT 2007


Nicolas Williams wrote:

> A few questions:
> 
>    Can one interpose on singleton symbols using LD_PRELOAD?  I assume
>    yes, or at most that the interposers in the pre-loaded object must be
>    labelled singleton as well.

An interposer can win, it still provides the *first* symbol.

>    Will dlsym(RTLD_NEXT, <singleton symbol>) return the next symbol?  Or
>    the one bound symbol (it is a singleton, after all)?
> 
>    If multiple objects define the same singleton symbol, will dlsym()
>    called with a handle for each of those objects resolve the same
>    symbol to the first definition, or to each object's version?

It doesn't matter how a symbol is located, via relocation of via dlsym()
(or what flag you use in dlsym()), the effect should be that same, in
that all references get bound to one definition.

>    Presumably libraries designed so that multiple versions can be
>    present in one process (I think that's feasible, with some
>    constraints) must not use singleton symbols.

Correct.

-- 

Rod.



More information about the opensolaris-arc mailing list