From 2b1dba3eb364aa65ce4ee947c39fb8d2d75e69b5 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 20 Dec 2024 15:52:57 +0100 Subject: 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 --- sysdeps/arm/dl-machine.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'sysdeps/arm') diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index 9186831be3..b328287a18 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -351,16 +351,7 @@ elf_machine_rel (struct link_map *map, struct r_scope_elem *scope[], { ElfW(Addr) tmp; # ifndef RTLD_BOOTSTRAP - /* 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 (_dl_rtld_map); -# endif - if (map == &GL(dl_rtld_map)) + if (is_rtld_link_map (map)) /* Undo the relocation done here during bootstrapping. Now we will relocate it anew, possibly using a binding found in the user program or a loaded library -- cgit v1.2.3