diff options
| author | Florian Weimer <fweimer@redhat.com> | 2024-12-20 15:52:57 +0100 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2024-12-20 15:52:57 +0100 |
| commit | 2b1dba3eb364aa65ce4ee947c39fb8d2d75e69b5 (patch) | |
| tree | 0036fd9611c8a9cda941c72ef80d16201380e24d /elf/do-rel.h | |
| parent | 322e9d4e443084336ea41a8e7bf72456ab273b73 (diff) | |
| download | glibc-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/do-rel.h')
| -rw-r--r-- | elf/do-rel.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/elf/do-rel.h b/elf/do-rel.h index afea61cfd2..f9841966d5 100644 --- a/elf/do-rel.h +++ b/elf/do-rel.h @@ -102,16 +102,7 @@ elf_dynamic_do_Rel (struct link_map *map, struct r_scope_elem *scope[], else #endif { - /* This is defined in rtld.c, but nowhere in the static libc.a; make - the reference weak so static programs can still link. This - declaration cannot be done when compiling rtld.c (i.e. #ifdef - RTLD_BOOTSTRAP) because rtld.c contains the common defn for - _dl_rtld_map, which is incompatible with a weak decl in the same - file. */ -# ifndef SHARED - weak_extern (GL(dl_rtld_map)); -# endif - if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */ + if (!is_rtld_link_map (map)) /* Already done in rtld itself. */ # if !defined DO_RELA || defined ELF_MACHINE_REL_RELATIVE /* Rela platforms get the offset from r_addend and this must be copied in the relocation address. Therefore we can skip |
