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]

Re: 3.4/3.5 PATCH: Fix IRIX 5 bootstrap


Richard Sandiford writes:

> Hmm.  From a quick look at varasm.c, I couldn't see how defining
> BSS_SECTION_ASM_OP (and only defining BSS_SECTION_ASM_OP) would change
> the way gcc deals with the no_named_sections case.  Does it really have
> an effect?

While it took me some time to check, you're right: it doesn't.  Here's the
revised patch to define a dummy BSS_SECTION_ASM_OP in iris5.h (just like
BSS_SECTION_ASM_OP_32 in iris6.h) and move the EXTRA_SECTION_FUNCTIONS from
iris6.h to iris5.h.

Bootstrapped successfully on mips-sgi-irix5.3 (both with native as and gas)
and on mips-sgi-irix6.5 to make sure it didn't break that port.

Ok for 3.4 branch and mainline?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Wed Jan 28 13:29:54 2004  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* config/mips/iris5.h (BSS_SECTION_ASM_OP): Define.
	* config/mips/iris6.h (BSS_SECTION_ASM_OP): Undef.

	* config/mips/iris6.h (TARGET_ASM_NAMED_SECTION): Moved ...
	* config/mips/iris5.h: ... here.
	* config/mips/iris5gas.h (TARGET_ASM_NAMED_SECTION): Remove.

	* config/mips/iris6.h (EXTRA_SECTION_FUNCTIONS): Move ...
	* config/mips/iris5.h: ... here.

Index: gcc/config/mips/iris5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris5.h,v
retrieving revision 1.26
diff -u -p -r1.26 iris5.h
--- gcc/config/mips/iris5.h	4 Feb 2004 19:15:24 -0000	1.26
+++ gcc/config/mips/iris5.h	4 Feb 2004 22:35:26 -0000
@@ -29,6 +29,10 @@ Boston, MA 02111-1307, USA.  */
 
 #define ABICALLS_ASM_OP "\t.option pic2"
 
+/* Dummy definition which allows EXTRA_SECTION_FUNCTIONS to be the same
+   for IRIX 5 and 6.  */
+#define BSS_SECTION_ASM_OP "\t.data"
+
 /* ??? This is correct, but not very useful, because there is no file that
    uses this macro.  */
 /* ??? The best way to handle global constructors under ELF is to use .init
@@ -191,6 +195,50 @@ Boston, MA 02111-1307, USA.  */
    in the small data section if the user explicitly asks for it.  */
 #undef MIPS_DEFAULT_GVALUE
 #define MIPS_DEFAULT_GVALUE 0
+
+/* Switch into a generic section.  */
+#undef TARGET_ASM_NAMED_SECTION
+#define TARGET_ASM_NAMED_SECTION  irix_asm_named_section
+
+/* Define functions to read the name and flags of the current section.
+   They are used by irix_asm_output_align.  */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS						\
+const char *								\
+current_section_name (void)						\
+{									\
+  switch (in_section)							\
+    {									\
+    case no_section:	return NULL;					\
+    case in_text:	return ".text";					\
+    case in_data:	return ".data";					\
+    case in_bss:	return ".bss";					\
+    case in_readonly_data:						\
+      if (mips_abi != ABI_32 && mips_abi != ABI_O64)			\
+	return ".rodata";						\
+      else								\
+	return ".rdata";						\
+    case in_named:							\
+      return in_named_name;						\
+    }									\
+  abort ();								\
+}									\
+									\
+unsigned int								\
+current_section_flags (void)						\
+{									\
+  switch (in_section)							\
+    {									\
+    case no_section:	return 0;					\
+    case in_text:	return SECTION_CODE;				\
+    case in_data:	return SECTION_WRITE;				\
+    case in_bss:	return SECTION_WRITE | SECTION_BSS;		\
+    case in_readonly_data: return 0;					\
+    case in_named:	return get_named_section_flags (in_named_name);	\
+    }									\
+  abort ();								\
+}
 
 /* Some assemblers have a bug that causes backslash escaped chars in .ascii
    to be misassembled, so avoid it by using .byte instead.  Write the original
Index: gcc/config/mips/iris5gas.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris5gas.h,v
retrieving revision 1.17
diff -u -p -r1.17 iris5gas.h
--- gcc/config/mips/iris5gas.h	31 Jan 2004 02:07:02 -0000	1.17
+++ gcc/config/mips/iris5gas.h	4 Feb 2004 22:35:26 -0000
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler.  Irix version 5 with gas.
+/* Definitions of target machine for GNU compiler.  IRIX version 5 with gas.
    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
@@ -73,10 +76,6 @@ do {							\
 do {							\
   fprintf (asm_out_file, "\t.etype\t0x%x;", (a));	\
 } while (0)
-
-/* Switch into a generic section.  */
-#undef TARGET_ASM_NAMED_SECTION
-#define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
 
 /* Add -g to mips.h default to avoid confusing gas with local symbols
    generated from stabs info.  */
Index: gcc/config/mips/iris6.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris6.h,v
retrieving revision 1.75
diff -u -p -r1.75 iris6.h
--- gcc/config/mips/iris6.h	31 Jan 2004 02:07:02 -0000	1.75
+++ gcc/config/mips/iris6.h	4 Feb 2004 22:35:27 -0000
@@ -288,6 +288,7 @@ Boston, MA 02111-1307, USA.  */
    and dtor lists this way, so we use -init and -fini to invoke the
    do_global_* functions instead of running collect2.  */
 
+#undef BSS_SECTION_ASM_OP
 #define BSS_SECTION_ASM_OP_32	"\t.data"
 #define BSS_SECTION_ASM_OP_64	"\t.section\t.bss"
 #define BSS_SECTION_ASM_OP			\
@@ -303,10 +304,6 @@ Boston, MA 02111-1307, USA.  */
    ? READONLY_DATA_SECTION_ASM_OP_64		\
    : READONLY_DATA_SECTION_ASM_OP_32)
 
-/* Switch into a generic section.  */
-#undef TARGET_ASM_NAMED_SECTION
-#define TARGET_ASM_NAMED_SECTION  irix_asm_named_section
-
 /* The default definition in defaults.h cannot cope with the runtime-variable
    definition of DWARF2_UNWIND_INFO above, so define here explicitly.  */
 #define EH_FRAME_SECTION_NAME ".eh_frame"
@@ -335,46 +332,6 @@ Boston, MA 02111-1307, USA.  */
 #undef EH_FRAME_SECTION_NAME
 
 #endif /* _MIPS_SIM == _ABIO32 && !GAS */
-
-/* Define functions to read the name and flags of the current section.
-   They are used by irix_asm_output_align.  */
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS						\
-const char *								\
-current_section_name (void)						\
-{									\
-  switch (in_section)							\
-    {									\
-    case no_section:	return NULL;					\
-    case in_text:	return ".text";					\
-    case in_data:	return ".data";					\
-    case in_bss:	return ".bss";					\
-    case in_readonly_data:						\
-      if (mips_abi != ABI_32 && mips_abi != ABI_O64)			\
-	return ".rodata";						\
-      else								\
-	return ".rdata";						\
-    case in_named:							\
-      return in_named_name;						\
-    }									\
-  abort ();								\
-}									\
-									\
-unsigned int								\
-current_section_flags (void)						\
-{									\
-  switch (in_section)							\
-    {									\
-    case no_section:	return 0;					\
-    case in_text:	return SECTION_CODE;				\
-    case in_data:	return SECTION_WRITE;				\
-    case in_bss:	return SECTION_WRITE | SECTION_BSS;		\
-    case in_readonly_data: return 0;					\
-    case in_named:	return get_named_section_flags (in_named_name);	\
-    }									\
-  abort ();								\
-}
 
 /* SGI assembler needs all sorts of extra help to do alignment properly.  */
 #undef ASM_OUTPUT_ALIGN


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