dwarf2: Use octets for dwarf2 headers
authorChristian Eggers <ceggers@gmx.de>
Sun, 10 Mar 2019 18:21:54 +0000 (19:21 +0100)
committerAlan Modra <amodra@gmail.com>
Wed, 13 Mar 2019 02:59:35 +0000 (13:29 +1030)
The content of the dwarf2 sections .debug_line, .debug_aranges and
.debug_info starts with an u32 containing the the size of the remaining
data.  According to the dwarf2 specification this value must be expressed
in octets instead of bytes.

* dwarf2dbg.c (out_debug_line): Use octets for dwarf2 headers.
(out_debug_aranges, out_debug_info): Likewise.

gas/ChangeLog
gas/dwarf2dbg.c

index 274516cfd41e3914ae35cd99a307c1f1c65a2ccf..a03bf3bb56ee088e746877ccbe0d18df45a35397 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-13  Christian Eggers  <ceggers@gmx.de>
+
+       * dwarf2dbg.c (out_debug_line): Use octets for dwarf2 headers.
+       (out_debug_aranges, out_debug_info): Likewise.
+
 2019-03-13  Christian Eggers  <ceggers@gmx.de>
 
        * symbols.h (symbol_temp_new_now_octets): Declare.
index 45d86a6ee34113d16c8575c5a940d6dcccb2d356..7b0e8fdc4a7f180df23484108c9f970c478d31a6 100644 (file)
@@ -1745,7 +1745,7 @@ out_header (asection *sec, expressionS *exp)
     }
   else
     {
-      start_sym = symbol_temp_new_now ();
+      start_sym = symbol_temp_new_now_octets ();
       end_sym = symbol_temp_make ();
     }
 
@@ -1848,7 +1848,7 @@ out_debug_line (segT line_seg)
        in the DWARF Line Number header.  */
     subseg_set (subseg_get (".debug_line_end", FALSE), 0);
 
-  symbol_set_value_now (line_end);
+  symbol_set_value_now_octets (line_end);
 }
 
 static void
@@ -1967,7 +1967,7 @@ out_debug_aranges (segT aranges_seg, segT info_seg)
   md_number_to_chars (p, 0, addr_size);
   md_number_to_chars (p + addr_size, 0, addr_size);
 
-  symbol_set_value_now (aranges_end);
+  symbol_set_value_now_octets (aranges_end);
 }
 
 /* Emit data for .debug_abbrev.  Note that this must be kept in
@@ -2082,7 +2082,7 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg,
      dwarf2 draft has no standard code for assembler.  */
   out_two (DW_LANG_Mips_Assembler);
 
-  symbol_set_value_now (info_end);
+  symbol_set_value_now_octets (info_end);
 }
 
 /* Emit the three debug strings needed in .debug_str and setup symbols
This page took 0.027594 seconds and 4 git commands to generate.