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 /sysdeps/mips | |
| 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 'sysdeps/mips')
| -rw-r--r-- | sysdeps/mips/dl-machine.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index 10e30f1e90..7a361edd4d 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -436,16 +436,6 @@ elf_machine_reloc (struct link_map *map, struct r_scope_elem *scope[], const unsigned long int r_type = ELFW(R_TYPE) (r_info); ElfW(Addr) *addr_field = (ElfW(Addr) *) reloc_addr; -#if !defined RTLD_BOOTSTRAP && !defined SHARED - /* 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. */ - weak_extern (GL(dl_rtld_map)); -#endif - switch (r_type) { #if !defined (RTLD_BOOTSTRAP) @@ -534,7 +524,7 @@ elf_machine_reloc (struct link_map *map, struct r_scope_elem *scope[], though it's not ABI compliant. Some day we should bite the bullet and stop doing this. */ #ifndef RTLD_BOOTSTRAP - if (map != &GL(dl_rtld_map)) + if (!is_rtld_link_map (map)) #endif reloc_value += SYMBOL_ADDRESS (map, sym, true); } @@ -553,7 +543,7 @@ elf_machine_reloc (struct link_map *map, struct r_scope_elem *scope[], } else #ifndef RTLD_BOOTSTRAP - if (map != &GL(dl_rtld_map)) + if (!is_rtld_link_map (map)) #endif reloc_value += map->l_addr; @@ -749,7 +739,7 @@ elf_machine_got_rel (struct link_map *map, struct r_scope_elem *scope[], int laz n = map->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val; /* The dynamic linker's local got entries have already been relocated. */ - if (map != &GL(dl_rtld_map)) + if (!is_rtld_link_map (map)) { /* got[0] is reserved. got[1] is also reserved for the dynamic object generated by gnu ld. Skip these reserved entries from relocation. */ |
