[RFC 4/5] elf: Enable RTLD_NODELETE on __libc_unwind_link_get
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Wed Jun 12 17:16:42 GMT 2024
On 12/06/24 06:54, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> The libgcc_s.so can also be sealed. The library is loaded once
>> and not unloaded during process execution (only for memory debug
>> with __libc_unwind_link_freeres).
>
> The unwind-link change to use RTLD_NODELETE could go in separately.
Ok, I will send a separate patch.
>
>> diff --git a/misc/unwind-link.c b/misc/unwind-link.c
>> index 213a0162a4..7267ecbec3 100644
>> --- a/misc/unwind-link.c
>> +++ b/misc/unwind-link.c
>
>> @@ -100,7 +100,8 @@ __libc_unwind_link_get (void)
>>
>> __libc_lock_lock (lock);
>> if (atomic_load_relaxed (&global_libgcc_handle) != NULL)
>> - /* This thread lost the race. Clean up. */
>> + /* This thread lost the race. Drop the l_direct_opencount and issue
>> + the debug log. */
>> __libc_dlclose (local_libgcc_handle);
>> else
>> {
>
> I don't understand what “debug log” means in this context.
Sorry, I meant the __libc_unwind_link_freeres usually triggered by
memory profilers. With sealing the dlclose won't unmap the memory.
More information about the Libc-alpha
mailing list