[4/7,gas] dwarf2: Use octets for .debug_line prologue

Message ID 20190310182158.23705-5-ceggers@gmx.de
State New
Headers show
Series
  • gas: Fixes for DWARF2 debug info with OCTETS_PER_BYTE>1
Related show

Commit Message

Christian Eggers March 10, 2019, 6:21 p.m.
Like the u32 size field at the beginning of the section, also the
prologue size must be expressed in octets.

This change should not affect existing targets as all targets currently
using DWARF2 have 8 bit per byte.

Signed-off-by: Christian Eggers <ceggers@gmx.de>

---
 gas/ChangeLog   | 5 +++++
 gas/dwarf2dbg.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.16.4

Patch

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 08dd959afd..4cb2702ab2 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@ 
+2019-03-10  Christian Eggers  <ceggers@gmx.de>
+
+	* dwarf2dbg.c: Use octets for .debug_line prologue.
+	(out_debug_line): symbol_set_value_now() --> symbol_set_value_now_octets()
+
 2019-03-10  Christian Eggers  <ceggers@gmx.de>
 
 	* dwarf2dbg.c: Use octets for dwarf2 headers.
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 7b0e8fdc4a..896a8f125a 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1803,7 +1803,7 @@  out_debug_line (segT line_seg)
   exp.X_op_symbol = prologue_start;
   exp.X_add_number = 0;
   emit_expr (&exp, sizeof_offset);
-  symbol_set_value_now (prologue_start);
+  symbol_set_value_now_octets (prologue_start);
 
   /* Parameters of the state machine.  */
   out_byte (DWARF2_LINE_MIN_INSN_LENGTH);
@@ -1828,7 +1828,7 @@  out_debug_line (segT line_seg)
 
   out_file_list ();
 
-  symbol_set_value_now (prologue_end);
+  symbol_set_value_now_octets (prologue_end);
 
   /* For each section, emit a statement program.  */
   for (s = all_segs; s; s = s->next)