aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Eggers <ceggers@gmx.de>2019-03-10 19:21:54 +0100
committerAlan Modra <amodra@gmail.com>2019-03-13 13:29:35 +1030
commit7235427998571b6d8267e7ac72a52d7b082f4c2b (patch)
tree96ec6dd0e3a4bfce29d1a1fc4f664b48c5911abc
parentd18d199917337537713f9fc4b7ae4d6568f740cf (diff)
downloadbinutils-7235427998571b6d8267e7ac72a52d7b082f4c2b.zip
binutils-7235427998571b6d8267e7ac72a52d7b082f4c2b.tar.gz
binutils-7235427998571b6d8267e7ac72a52d7b082f4c2b.tar.bz2
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.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/dwarf2dbg.c8
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