(assembler_variable): For XCOFF_DEBUG, restore section
authorJim Wilson <wilson@gcc.gnu.org>
Mon, 9 Aug 1993 19:42:21 +0000 (12:42 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 9 Aug 1993 19:42:21 +0000 (12:42 -0700)
if dbxout_symbol call changes it.

From-SVN: r5122

gcc/varasm.c

index 75f620ac479e496b723e51eadd3cc459e998f911..e11787665b3fad4445ab1140430c298e93a11298 100644 (file)
@@ -1048,7 +1048,26 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
 
   /* File-scope global variables are output here.  */
   if (write_symbols == XCOFF_DEBUG && top_level)
-    dbxout_symbol (decl, 0);
+    {
+      saved_in_section = in_section;
+
+      dbxout_symbol (decl, 0);
+
+      if (in_section != saved_in_section)
+       {
+         /* Switch to the proper section for this data.  */
+#ifdef SELECT_SECTION
+         SELECT_SECTION (decl, reloc);
+#else
+         if (TREE_READONLY (decl)
+             && ! TREE_THIS_VOLATILE (decl)
+             && ! (flag_pic && reloc))
+           readonly_data_section ();
+         else
+           data_section ();
+#endif
+       }
+    }
 #else
   /* There must be a statement after a label.  */
   ;