OSDN Git Service

* config/mips/iris5.h (BSS_SECTION_ASM_OP): Define.
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / iris5.h
index 84895ef..a172986 100644 (file)
@@ -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
@@ -190,6 +194,50 @@ Boston, MA 02111-1307, USA.  */
 #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
    string in a comment, partly to improve readability and partly for the sake