This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

Re: 2.12 branch: Sparc visibility failures


On Sun, Feb 17, 2002 at 11:02:22AM -0800, Richard Henderson wrote:
> On Sun, Feb 17, 2002 at 10:42:59AM -0500, Daniel Jacobowitz wrote:
> > Which leads to the question: what to do?  I can't add __attribute__,
> > because that's a GCC-ism and I won't be surprised if Sun's compiler
> > does something similar.  XFAIL for sparc-linux?
> 
> You check for __GNUC__ and let Sun's compiler fail.

Or you get clever and use '#pragma weak visibility_var'.  It looks as
if all of GCC's ELF targets will handle this.  Is this patch OK?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2002-02-17  Daniel Jacobowitz  <drow@mvista.com>

	* ld-elfvsb/sh1.c: Use #pragma weak.

Index: ld-elfvsb/sh1.c
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elfvsb/sh1.c,v
retrieving revision 1.3
diff -u -r1.3 sh1.c
--- sh1.c	2000/07/15 23:57:20	1.3
+++ sh1.c	2002/02/18 03:14:10
@@ -180,6 +180,9 @@
 #endif
 
 #if defined (HIDDEN_UNDEF_TEST) || defined (PROTECTED_UNDEF_TEST)
+#ifdef WEAK_TEST
+#pragma weak visibility
+#endif
 extern int visibility ();
 #else
 int
@@ -243,6 +246,9 @@
 }
 
 #if defined (HIDDEN_UNDEF_TEST) || defined (PROTECTED_UNDEF_TEST)
+#ifdef WEAK_TEST
+#pragma weak visibility_var;
+#endif
 extern int visibility_var;
 #else
 int visibility_var = 2;
@@ -316,9 +322,4 @@
 asm (".protected visibility");
 asm (".protected visibility_var");
 #endif
-#endif
-
-#ifdef WEAK_TEST
-asm (".weak visibility");
-asm (".weak visibility_var");
 #endif


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