summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-01-20 22:46:29 +0000
committerMike Frysinger <vapier@gentoo.org>2006-01-20 22:46:29 +0000
commit1ad608ee1614eb90e4236a39595be4f28c9c2901 (patch)
tree056cf65b54d0fca0bef75d42f0089f397ca35bb5
parent5d42830b0ba602c12fa3dfc6f7c1d4bcb1e2e7be (diff)
grab some macros for internal ldso usage and fix strong_alias/hidden_strong_alias when .set support is disabled
-rw-r--r--include/libc-symbols.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index cff465788..7c680cd9c 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -273,6 +273,31 @@
link_warning (name, \
"warning: " #name " is not implemented and will always fail")
+/* Handling on non-exported internal names. We have to do this only
+ for shared code. */
+#ifdef SHARED
+# define INTUSE(name) name##_internal
+# define INTDEF(name) strong_alias (name, name##_internal)
+# define INTVARDEF(name) \
+ _INTVARDEF (name, name##_internal)
+# if defined HAVE_VISIBILITY_ATTRIBUTE
+# define _INTVARDEF(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name), \
+ visibility ("hidden")));
+# else
+# define _INTVARDEF(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+# endif
+# define INTDEF2(name, newname) strong_alias (name, newname##_internal)
+# define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
+#else
+# define INTUSE(name) name
+# define INTDEF(name)
+# define INTVARDEF(name)
+# define INTDEF2(name, newname)
+# define INTVARDEF2(name, newname)
+#endif
+
/* The following macros are used for PLT bypassing within libc.so
(and if needed other libraries similarly).
First of all, you need to have the function prototyped somewhere,
@@ -416,7 +441,7 @@
.hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
# else
-# define strong_alias(original, alias) \
+# define hidden_strong_alias(original, alias) \
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
.hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)