OSDN Git Service

Remove CYGNUS LOCAL tags.
[pf3gnuchains/gcc-fork.git] / gcc / varasm.c
index ffcdd91..5702646 100644 (file)
@@ -305,14 +305,21 @@ bss_section (decl, name)
    support is localized here.  */
 
 static void
-asm_output_bss (file, name, size, rounded)
+asm_output_bss (file, decl, name, size, rounded)
      FILE *file;
+     tree decl;
      char *name;
      int size, rounded;
 {
   ASM_GLOBALIZE_LABEL (file, name);
   bss_section ();
+#ifdef ASM_DECLARE_OBJECT_NAME
+  last_assemble_variable_decl = decl;
+  ASM_DECLARE_OBJECT_NAME (file, name, decl);
+#else
+  /* Standard thing is just output label for the object.  */
   ASM_OUTPUT_LABEL (file, name);
+#endif /* ASM_DECLARE_OBJECT_NAME */
   ASM_OUTPUT_SKIP (file, rounded);
 }
 
@@ -326,15 +333,22 @@ asm_output_bss (file, name, size, rounded)
    support is localized here.  */
 
 static void
-asm_output_aligned_bss (file, name, size, align)
+asm_output_aligned_bss (file, decl, name, size, align)
      FILE *file;
+     tree decl;
      char *name;
      int size, align;
 {
   ASM_GLOBALIZE_LABEL (file, name);
   bss_section ();
   ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
+#ifdef ASM_DECLARE_OBJECT_NAME
+  last_assemble_variable_decl = decl;
+  ASM_DECLARE_OBJECT_NAME (file, name, decl);
+#else
+  /* Standard thing is just output label for the object.  */
   ASM_OUTPUT_LABEL (file, name);
+#endif /* ASM_DECLARE_OBJECT_NAME */
   ASM_OUTPUT_SKIP (file, size);
 }
 
@@ -352,29 +366,6 @@ void
 function_section (decl)
      tree decl;
 {
-
-#ifdef ASM_OUTPUT_SECTION_NAME
-  /* If we are placing functions into their own sections, and this
-     function doesn't already have a section specified, set it now.  */
-  if (flag_function_sections
-      && decl != NULL_TREE
-      && DECL_SECTION_NAME (decl) == NULL_TREE)
-    {
-      int len;
-      char *string;
-
-      len = IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (decl)) + 1;
-      string = alloca (len);
-      strcpy (string, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
-
-      /* Strip off any encoding in fnname.  */
-      STRIP_NAME_ENCODING (string, string);
-
-      /* Set DECL_SECTION_NAME.  */
-      DECL_SECTION_NAME (decl) = build_string (len, string);
-    }
-#endif
-
   if (decl != NULL_TREE
       && DECL_SECTION_NAME (decl) != NULL_TREE)
     named_section (decl, (char *) 0);
@@ -916,6 +907,23 @@ assemble_start_function (decl, fnname)
 
   output_constant_pool (fnname, decl);
 
+#ifdef ASM_OUTPUT_SECTION_NAME
+  /* If the function is to be put in its own section and it's not in a section
+     already, indicate so.  */
+  if (flag_function_sections
+      && DECL_SECTION_NAME (decl) == NULL_TREE)
+    {
+#ifdef UNIQUE_SECTION
+      DECL_SECTION_NAME(decl) = UNIQUE_SECTION (decl);
+#else
+      char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+      /* Strip off any encoding in name.  */
+      STRIP_NAME_ENCODING (name, name);
+      DECL_SECTION_NAME (decl) = build_string (strlen (name), name);
+#endif
+    }
+#endif
+
   function_section (decl);
 
   /* Tell assembler to move to target machine's alignment for functions.  */
@@ -969,15 +977,17 @@ assemble_start_function (decl, fnname)
     }
 
   /* Do any machine/system dependent processing of the function name */
-#ifdef ASM_DECLARE_FUNCTION_NAME
-  ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl);
-#else
-  /* Standard thing is just output label for the function.  */
   if (output_bytecode)
     BC_OUTPUT_LABEL (asm_out_file, fnname);
   else
-    ASM_OUTPUT_LABEL (asm_out_file, fnname);
+    {
+#ifdef ASM_DECLARE_FUNCTION_NAME
+      ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl);
+#else
+      /* Standard thing is just output label for the function.  */
+      ASM_OUTPUT_LABEL (asm_out_file, fnname);
 #endif /* ASM_DECLARE_FUNCTION_NAME */
+    }
 }
 
 /* Output assembler code associated with defining the size of the
@@ -1308,7 +1318,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
        {
 #ifdef ASM_OUTPUT_SHARED_BSS
          if (flag_shared_data)
-           ASM_OUTPUT_SHARED_BSS (asm_out_file, name, size, rounded);
+           ASM_OUTPUT_SHARED_BSS (asm_out_file, decl, name, size, rounded);
          else
 #endif
            if (output_bytecode)
@@ -1318,10 +1328,10 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
            else
              {
 #ifdef ASM_OUTPUT_ALIGNED_BSS
-               ASM_OUTPUT_ALIGNED_BSS (asm_out_file, name, size,
+               ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size,
                                        DECL_ALIGN (decl));
 #else
-               ASM_OUTPUT_BSS (asm_out_file, name, size, rounded);
+               ASM_OUTPUT_BSS (asm_out_file, decl, name, size, rounded);
 #endif
              }
        }
@@ -1470,16 +1480,18 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
     }
 
   /* Do any machine/system dependent processing of the object.  */
-#ifdef ASM_DECLARE_OBJECT_NAME
-  last_assemble_variable_decl = decl;
-  ASM_DECLARE_OBJECT_NAME (asm_out_file, name, decl);
-#else
-  /* Standard thing is just output label for the object.  */
   if (output_bytecode)
     BC_OUTPUT_LABEL (asm_out_file, name);
   else
-    ASM_OUTPUT_LABEL (asm_out_file, name);
+    {
+#ifdef ASM_DECLARE_OBJECT_NAME
+      last_assemble_variable_decl = decl;
+      ASM_DECLARE_OBJECT_NAME (asm_out_file, name, decl);
+#else
+      /* Standard thing is just output label for the object.  */
+      ASM_OUTPUT_LABEL (asm_out_file, name);
 #endif /* ASM_DECLARE_OBJECT_NAME */
+    }
 
   if (!dont_output_data)
     {