about summary refs log tree commit diff
path: root/sysdeps/generic/ldsodefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/ldsodefs.h')
-rw-r--r--sysdeps/generic/ldsodefs.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 779e438753..08f5829895 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -199,7 +199,11 @@ typedef void (*receiver_fct) (int, const char *, const char *);
 # define GL(name) _##name
 #else
 # define EXTERN
-# define GL(name) _rtld_global._##name
+# ifdef _RTLD_LOCAL
+#  define GL(name) _rtld_local._##name
+# else
+#  define GL(name) _rtld_global._##name
+# endif
 struct rtld_global
 {
 #endif
@@ -371,6 +375,19 @@ struct rtld_global
 #ifdef SHARED
 };
 extern struct rtld_global _rtld_global;
+# ifdef _RTLD_LOCAL
+#  ifdef HAVE_VISIBILITY_ATTRIBUTE
+#   ifdef HAVE_SDATA_SECTION
+#    define __rtld_local_attribute__ \
+	    __attribute__ ((visibility ("hidden"), section (".sdata")))
+#   else
+#    define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
+#   endif
+#  else
+#   define __rtld_local_attribute__
+#  endif
+extern struct rtld_global _rtld_local __rtld_local_attribute__;
+# endif
 #endif
 #undef EXTERN