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 --- elf/dl-dst.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'elf/dl-dst.h') diff --git a/elf/dl-dst.h b/elf/dl-dst.h index 07100e5..bff3685 100644 --- a/elf/dl-dst.h +++ b/elf/dl-dst.h @@ -18,11 +18,6 @@ #include "trusted-dirs.h" -#ifdef SHARED -# define IS_RTLD(l) (l) == &GL(dl_rtld_map) -#else -# define IS_RTLD(l) 0 -#endif /* Guess from the number of DSTs the length of the result string. */ #define DL_DST_REQUIRED(l, name, len, cnt) \ ({ \ @@ -44,7 +39,7 @@ auditing, in ld.so. */ \ if ((l)->l_origin == NULL) \ { \ - assert ((l)->l_name[0] == '\0' || IS_RTLD (l)); \ + assert ((l)->l_name[0] == '\0' || is_rtld_link_map (l)); \ (l)->l_origin = _dl_get_origin (); \ dst_len = ((l)->l_origin && (l)->l_origin != (char *) -1 \ ? strlen ((l)->l_origin) : 0); \ -- cgit v1.1