aboutsummaryrefslogtreecommitdiff
path: root/elf/rtld.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-12-20 15:52:57 +0100
committerFlorian Weimer <fweimer@redhat.com>2024-12-20 15:52:57 +0100
commit2b1dba3eb364aa65ce4ee947c39fb8d2d75e69b5 (patch)
tree0036fd9611c8a9cda941c72ef80d16201380e24d /elf/rtld.c
parent322e9d4e443084336ea41a8e7bf72456ab273b73 (diff)
downloadglibc-2b1dba3eb364aa65ce4ee947c39fb8d2d75e69b5.tar.xz
glibc-2b1dba3eb364aa65ce4ee947c39fb8d2d75e69b5.zip
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>
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index b8cc3f605f..44bcf29ff6 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1960,7 +1960,7 @@ dl_main (const ElfW(Phdr) *phdr,
GL(dl_rtld_map).l_next->l_prev = GL(dl_rtld_map).l_prev;
for (i = 1; i < main_map->l_searchlist.r_nlist; ++i)
- if (main_map->l_searchlist.r_list[i] == &GL(dl_rtld_map))
+ if (is_rtld_link_map (main_map->l_searchlist.r_list[i]))
break;
/* Insert the link map for the dynamic loader into the chain in