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 2/2]: use the .set assembler directive when defining WEAK support


Provide support for the case where an assembler uses the .weak directive
and the .set directive.

2010-09-21  Linas Vepstas <linasvepstas@gmail.com>
        * include/libc-symbols.h: use the .set assembler directive, if
          supported.


---
 include/libc-symbols.h |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
Provide support for the case where an assembler uses the .weak directive
and the .set directive.

2010-09-21  Linas Vepstas <linasvepstas@gmail.com>
	* include/libc-symbols.h: use the .set assembler directive, if
	  supported.


---
 include/libc-symbols.h |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

Index: glibc-2.12.1/include/libc-symbols.h
===================================================================
--- glibc-2.12.1.orig/include/libc-symbols.h	2010-09-21 12:00:51.000000000 -0500
+++ glibc-2.12.1/include/libc-symbols.h	2010-09-21 12:05:34.000000000 -0500
@@ -183,16 +183,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				\
   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)
+  .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
-#    define weak_alias(original, alias)					\
+#    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)					\
   .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP				\
   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
+#    endif
 #   endif
 
 #   define weak_extern(symbol)						\

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