1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

elf: Introduce is_rtld_link_map

Unconditionally define it to false for static builds.

This avoids the awkward use of weak_extern for _dl_rtld_map
in checks that cannot be possibly true on static builds.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer
2024-12-20 15:52:57 +01:00
parent 322e9d4e44
commit 2b1dba3eb3
10 changed files with 28 additions and 56 deletions

View File

@@ -537,7 +537,7 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t sym_map,
if (finaladdr != 0 && map != sym_map && !sym_map->l_relocated
#if !defined RTLD_BOOTSTRAP && defined SHARED
/* Bootstrap map doesn't have l_relocated set for it. */
&& sym_map != &GL(dl_rtld_map)
&& !is_rtld_link_map (sym_map)
#endif
)
offset = sym_map->l_addr;
@@ -662,7 +662,7 @@ resolve_ifunc (Elf64_Addr value,
if (map != sym_map
# if !defined RTLD_BOOTSTRAP && defined SHARED
/* Bootstrap map doesn't have l_relocated set for it. */
&& sym_map != &GL(dl_rtld_map)
&& !is_rtld_link_map (map)
# endif
&& !sym_map->l_relocated)
{