From 466c1ea15f461edb8e3ffaf5d86d708876343bbf Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 3 Jun 2021 08:26:04 +0200 Subject: dlfcn: Rework static dlopen hooks Consolidate all hooks structures into a single one. There are no static dlopen ABI concerns because glibc 2.34 already comes with substantial ABI-incompatible changes in this area. (Static dlopen requires the exact same dynamic glibc version that was used for static linking.) The new approach uses a pointer to the hooks structure into _rtld_global_ro and initalizes it in __rtld_static_init. This avoids a back-and-forth with various callback functions. Reviewed-by: Adhemerval Zanella --- sysdeps/generic/ldsodefs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sysdeps/generic/ldsodefs.h') diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index e383aa1dc3..176394de4d 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -687,6 +687,9 @@ struct rtld_global_ro int (*_dl_discover_osversion) (void); #endif + /* Dynamic linker operations used after static dlopen. */ + const struct dlfcn_hook *_dl_dlfcn_hook; + /* List of auditing interfaces. */ struct audit_ifaces *_dl_audit; unsigned int _dl_naudit; -- cgit v1.2.3