This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] dwarf2: Use octets for dwarf2 headers
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 13 Mar 2019 04:25:11 -0000
- Subject: [binutils-gdb] dwarf2: Use octets for dwarf2 headers
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7235427998571b6d8267e7ac72a52d7b082f4c2b
commit 7235427998571b6d8267e7ac72a52d7b082f4c2b
Author: Christian Eggers <ceggers@gmx.de>
Date: Sun Mar 10 19:21:54 2019 +0100
dwarf2: Use octets for dwarf2 headers
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.
Diff:
---
gas/ChangeLog | 5 +++++
gas/dwarf2dbg.c | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 274516c..a03bf3b 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
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.
(symbol_set_value_now_octets, symbol_octets_p): Declare.
* symbols.c (struct symbol_flags): New member sy_octets.
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 45d86a6..7b0e8fd 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -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