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

Re: GNU dlopen(3) differs from POSIX/IEEE



On 07/01/2016 04:46 PM, Florian Weimer wrote:
> * Carlos O'Donell:
> 
>>> ld(1) on a GNU/Linux machine says:
>>> ---
>>> -z lazy
>>>
>>> When generating an executable or shared library, mark it to tell the
>>> dynamic linker to defer function call resolution to the point when
>>> the function is called (lazy binding)
>>> ---
>>
>> Note that those man page is part of the linux man pages project and
>> are not canonical documentation for the glibc project.
> 
> This particular ld manual page seems to be derived from the
> ld/binutils Info documentation, which promises the same behavior.

The binutils manual should not dictate glibc behaviour.

Patch sent to binutils:
https://sourceware.org/ml/binutils/2016-07/msg00104.html
 
> I am not sure what the exact semantics of lazy binding should be.

The semantics of lazy binding are purposely vague to avoid constraining
the implementation. The reference to the symbol will be resolved at 
some point between load and call.

Do we need stricter semantics? Do the stricter semantics give us something
in return for the constraints we place on the implementation?

> With IFUNCs, lazy binding is observable, and we know from Fedora's
> BIND_NOW experiment that some applications assume that undefined
> functions which are never called do not cause any trouble whatsoever.
 
The IFUNC observes lazy binding only indirectly in that the resolver
is called one or more times depending on (a) number of object references
to the resolver and (b) number of threads concurrently updating GOT/PLT
entries and calling the ifunc resolver.

If there are relevant issues from Fedora's BIND_NOW testing that relate
to gnu-gabi, then we should raise them in a new thread.

-- 
Cheers,
Carlos.