OSDN Git Service

* system.h (STRIP_NAME_ENCODING): Poison it.
[pf3gnuchains/gcc-fork.git] / gcc / config / v850 / v850.c
index c47e47b..e65dae5 100644 (file)
@@ -59,6 +59,9 @@ static tree v850_handle_interrupt_attribute PARAMS ((tree *, tree, tree, int, bo
 static tree v850_handle_data_area_attribute PARAMS ((tree *, tree, tree, int, bool *));
 static void v850_insert_attributes   PARAMS ((tree, tree *));
 static void v850_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
+static void v850_encode_data_area    PARAMS ((tree));
+static void v850_encode_section_info PARAMS ((tree, int));
+static const char *v850_strip_name_encoding PARAMS ((const char *));
 
 /* True if the current function has anonymous arguments.  */
 int current_function_anonymous_args;
@@ -100,6 +103,11 @@ static int v850_interrupt_p = FALSE;
 #undef  TARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION  v850_select_section
 
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO v850_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING v850_strip_name_encoding
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Sometimes certain combinations of command options do not make
@@ -2142,7 +2150,7 @@ v850_interrupt_function_p (func)
 }
 
 \f
-void
+static void
 v850_encode_data_area (decl)
      tree decl;
 {
@@ -2203,6 +2211,23 @@ v850_encode_data_area (decl)
   XSTR (XEXP (DECL_RTL (decl), 0), 0) = ggc_alloc_string (newstr, len + 2);
 }
 
+static void
+v850_encode_section_info (decl, first)
+     tree decl;
+     int first;
+{
+  if (first && TREE_CODE (decl) == VAR_DECL
+      && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
+    v850_encode_data_area (decl);
+}
+
+static const char *
+v850_strip_name_encoding (str)
+     const char *str;
+{
+  return str + (ENCODED_NAME_P (str) || *str == '*');
+}
+
 /* Return true if the given RTX is a register which can be restored
    by a function epilogue.  */
 int
@@ -2890,7 +2915,7 @@ v850_select_section (exp, reloc, align)
 
         default:
           if (is_const)
-           const_section ();
+           readonly_data_section ();
          else
            data_section ();
          break;
@@ -2899,10 +2924,10 @@ v850_select_section (exp, reloc, align)
   else if (TREE_CODE (exp) == STRING_CST)
     {
       if (! flag_writable_strings)
-       const_section ();
+       readonly_data_section ();
       else
        data_section ();
     }
   else
-    const_section ();
+    readonly_data_section ();
 }