This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Fix PR target/15178


Hi!

PR target/15178 suggests that Solaris as makes an alias global even without
.global directive, probably as long as the symbol it is aliased to is global
or something.
The PR also claims .local directive fixes this up and that the following
patch fixes the issue (don't have Solaris/x86 myself, so cannot verify it).
With this patch, all .set x, y directives should be accompanied by either
.global x (GCC already does this) or .local x on Solaris/x86.
Ok for HEAD/3.4?

2004-06-09  Jakub Jelinek  <jakub@redhat.com>

	PR target/15178
	* config/i386/sol2.h (ASM_OUTPUT_DEF_FROM_DECLS): Define.

--- gcc/config/i386/sol2.h.jj	2004-06-09 15:49:22.721059407 +0200
+++ gcc/config/i386/sol2.h	2004-06-09 15:57:02.716622213 +0200
@@ -64,3 +64,18 @@ Boston, MA 02111-1307, USA.  */
 
 /* The Solaris assembler does not support .quad.  Do not use it.  */
 #undef ASM_QUAD
+
+/* The Solaris assembler wants a .local for non-exported aliases.  */
+#define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET)	\
+  do {							\
+    const char *declname =				\
+      IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));	\
+    ASM_OUTPUT_DEF ((FILE), declname,			\
+		    IDENTIFIER_POINTER (TARGET));	\
+    if (! TREE_PUBLIC (DECL))				\
+      {							\
+	fprintf ((FILE), "%s", LOCAL_ASM_OP);		\
+	assemble_name ((FILE), declname);		\
+	fprintf ((FILE), "\n");				\
+      }							\
+  } while (0)

	Jakub


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