[PATCH v2 02/13] elf, nptl: Resolve recursive lock implementation early

Florian Weimer fweimer@redhat.com
Mon May 10 05:54:12 GMT 2021


* Carlos O'Donell:

> On 5/6/21 2:09 PM, Florian Weimer via Libc-alpha wrote:
>> If libpthread is included in libc, it is not necessary to delay
>> initialization of the lock/unlock function pointers until libpthread
>> is loaded.  This eliminates two unprotected function pointers
>> from _rtld_global and removes some initialization code from
>> libpthread.
>
> This version looks good to me, and the early initialization makes it
> logically easier to follow when reading the code. Despite the removal
> of the unprotected function pointesr in _rtld_global, we still need
> some function pointer in order to lookup the function symbols from libc.so
> and remember their values, but data placement is harder to discover than
> the fixed offset from a public symbol.

Eh, the lookup happens before any user code runs, so it really ought to
be safe. 8-)

Thanks,
Florian



More information about the Libc-alpha mailing list