This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] respect HAVE_ASM_SET_DIRECTIVE when defining weak_alias()


the current libc-symbols.h code does not respect the HAVE_ASM_SET_DIRECTIVE 
define when setting up the weak_alias() macros for assembler files.  attached 
patch fixes this.
-mike
2006-05-04  Bernd Schmidt  <bernds_cb1@t-online.de>

	* include/libc-symbols.h [HAVE_ASM_SET_DIRECTIVE]: Update weak_alias()
	to utilize .set where appropriate.

--- include/libc-symbols.h
+++ include/libc-symbols.h
@@ -176,18 +176,31 @@
 
 #  else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
 
-#   ifdef HAVE_ASM_GLOBAL_DOT_NAME
-#    define weak_alias(original, alias)					\
+#   ifdef HAVE_ASM_SET_DIRECTIVE
+#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
+#     define weak_alias(original, alias)				\
+  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP				\
+  .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP	\
+  .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP				\
+  .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
+#    else
+#     define weak_alias(original, alias)				\
+  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP				\
+  .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
+#    endif
+#   else /* ! HAVE_ASM_SET_DIRECTIVE */
+#    ifdef HAVE_ASM_GLOBAL_DOT_NAME
+#     define weak_alias(original, alias)				\
   .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP				\
   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP		\
   .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP				\
   C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
-#   else
-#    define weak_alias(original, alias)					\
+#    else
+#     define weak_alias(original, alias)				\
   .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP				\
   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
+#    endif
 #   endif
-
 #   define weak_extern(symbol)						\
   .weak C_SYMBOL_NAME (symbol)
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]