From ef5823d955dd7e6b4ffed9f3a8455d131cd7a737 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 20 Dec 2024 15:52:57 +0100 Subject: elf: Move _dl_rtld_map, _dl_rtld_audit_state out of GL This avoids immediate GLIBC_PRIVATE ABI issues if the size of struct link_map or struct auditstate changes. Reviewed-by: Adhemerval Zanella --- sysdeps/generic/ldsodefs.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'sysdeps/generic') diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 2c25c8db46..cec56e2214 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -392,14 +392,6 @@ struct rtld_global /* List of search directories. */ EXTERN struct r_search_path_elem *_dl_all_dirs; - /* Structure describing the dynamic linker itself. */ - EXTERN struct link_map _dl_rtld_map; -#ifdef SHARED - /* Used to store the audit information for the link map of the - dynamic loader. */ - struct auditstate _dl_rtld_auditstate[DL_NNS]; -#endif - /* Get architecture specific definitions. */ #define PROCINFO_DECL #ifndef PROCINFO_CLASS @@ -1323,11 +1315,18 @@ rtld_active (void) return GLRO(dl_init_all_dirs) != NULL; } +/* Pre-allocated link map for the dynamic linker itself. */ +extern struct link_map _dl_rtld_map attribute_hidden; + +/* Used to store the audit information for the link map of the + dynamic loader. */ +extern struct auditstate _dl_rtld_auditstate[DL_NNS] attribute_hidden; + /* Returns true of L is the link map of the dynamic linker itself. */ static inline bool is_rtld_link_map (const struct link_map *l) { - return l == &GL(dl_rtld_map); + return l == &_dl_rtld_map; } static inline struct auditstate * @@ -1335,7 +1334,7 @@ link_map_audit_state (struct link_map *l, size_t index) { if (is_rtld_link_map (l)) /* The auditstate array is stored separately. */ - return &GL (dl_rtld_auditstate) [index]; + return _dl_rtld_auditstate + index; else { /* The auditstate array follows the link map in memory. */ -- cgit v1.2.3