[PATCH v3 21/32] elf: _dl_rtld_map should not exist in static builds

Florian Weimer fweimer@redhat.com
Sun Feb 2 17:32:18 GMT 2025


* Joseph Myers:

> On Thu, 7 Dec 2023, Florian Weimer wrote:
>
>> We have separate objects for SHARED and !SHARED, so there is no need
>> to make the rtld link map equality check somehow work in static
>> builds.  Instead, hide the _dl_rtld_map reference in the new
>> is_rtld_link_map function, and simply define that to return false
>> for !SHARED because the static linked loader does not have a link
>> map.
>
> Probably this should replace all comparisons with &GL(dl_rtld_map) with 
> calls to is_rtld_link_map (unless there's a specific reason such a 
> replacement is problematic in a given case), even if no SHARED conditional 
> is involved?  I don't think it does at present.  Maybe patch 11 (which I 
> still need to review) was meant to remove dl-dst.h (which it doesn't; nor 
> does it remove the include of dl-dst.h from elf/dl-origin.c), which would 
> deal with IS_RTLD there.  But what about sysdeps/x86/dl-prop.h and 
> sysdeps/x86_64/dl-cet.c, or a few such comparisons in rtld.c itself?

As noted before, this was fixed up when this change was integrated (in a
variant form) previously.

Thanks,
Florian



More information about the Libc-alpha mailing list