From eb465c68974a9db1889772b4171dfadfa5922fb7 Mon Sep 17 00:00:00 2001
From: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 17 Aug 2001 18:34:56 +0000
Subject: [PATCH]         * dwarf2out.c (dwarf2out_init): Don't emit .debug_loc
 label here.         (dwarf2out_finish): Do it here.  Emit .debug_loc before
 .debug_info.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44968 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog   |  5 +++++
 gcc/dwarf2out.c | 24 ++++++++++++------------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 00b746c61b20..65578bc54581 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-17  Richard Henderson  <rth@redhat.com>
+
+	* dwarf2out.c (dwarf2out_init): Don't emit .debug_loc label here.
+	(dwarf2out_finish): Do it here.  Emit .debug_loc before .debug_info.
+
 2001-08-17  Richard Henderson  <rth@redhat.com>
 
 	* varasm.c (assemble_variable): Don't overalign if DECL_USER_ALIGN.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 39861bedfe3d..30cf07215781 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -11693,9 +11693,6 @@ dwarf2out_init (main_input_filename)
 			       DEBUG_INFO_SECTION_LABEL, 0);
   ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label,
 			       DEBUG_LINE_SECTION_LABEL, 0);
-  ASM_GENERATE_INTERNAL_LABEL (loc_section_label, DEBUG_LOC_SECTION_LABEL, 0);
-  named_section_flags (DEBUG_LOC_SECTION, SECTION_DEBUG);
-  ASM_OUTPUT_LABEL (asm_out_file, loc_section_label);
   named_section_flags (DEBUG_ABBREV_SECTION, SECTION_DEBUG);
   ASM_OUTPUT_LABEL (asm_out_file, abbrev_section_label);
   named_section_flags (DEBUG_INFO_SECTION, SECTION_DEBUG);
@@ -11785,6 +11782,18 @@ dwarf2out_finish (input_filename)
       output_line_info ();
     }
 
+  /* Output location list section if necessary.  */
+  if (have_location_lists)
+    {
+      /* Output the location lists info.  */
+      named_section_flags (DEBUG_LOC_SECTION, SECTION_DEBUG);
+      ASM_GENERATE_INTERNAL_LABEL (loc_section_label,
+				   DEBUG_LOC_SECTION_LABEL, 0);
+      ASM_OUTPUT_LABEL (asm_out_file, loc_section_label);
+      output_location_lists (die);
+      have_location_lists = 0;
+    }
+
   /* We can only use the low/high_pc attributes if all of the code was
      in .text.  */
   if (separate_line_info_table_in_use == 0)
@@ -11831,15 +11840,6 @@ dwarf2out_finish (input_filename)
       output_aranges ();
     }
 
-  /* Output location list section if necessary.  */
-  if (have_location_lists)
-    {
-      /* Output the location lists info.  */
-      named_section_flags (DEBUG_LOC_SECTION, SECTION_DEBUG);
-      output_location_lists (die);
-      have_location_lists = 0;
-    }
-
   /* Output ranges section if necessary.  */
   if (ranges_table_in_use)
     {
-- 
GitLab