diff options
author | Alan Modra <amodra@gmail.com> | 2014-02-28 15:09:32 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-02-28 15:09:32 +1030 |
commit | 02fe846e43cb0190251a6fefbd322201b4bbe02d (patch) | |
tree | ce11e048b90ceac366e51550fd63e90f8eb35ac2 | |
parent | 9850436d9e423d66d67d27135896582b2725782e (diff) | |
download | fsf-binutils-gdb-02fe846e43cb0190251a6fefbd322201b4bbe02d.zip fsf-binutils-gdb-02fe846e43cb0190251a6fefbd322201b4bbe02d.tar.gz fsf-binutils-gdb-02fe846e43cb0190251a6fefbd322201b4bbe02d.tar.bz2 |
Incorrect .debug_line prologue header length for 64-bit DWARF
Don't be clever, calculate the length directly as the difference of
two symbols.
* dwarf2dbg.c (out_debug_line): Correct .debug_line header_length
field for 64-bit dwarf.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/dwarf2dbg.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 3469821..09dd757 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2014-02-28 Alan Modra <amodra@gmail.com> + + * dwarf2dbg.c (out_debug_line): Correct .debug_line header_length + field for 64-bit dwarf. + 2014-02-21 Ilya Tocar <ilya.tocar@intel.com> * config/tc-i386.c (cpu_arch): Add .prefetchwt1. diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 6d6ee2d..ac6148f 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1515,7 +1515,7 @@ static void out_debug_line (segT line_seg) { expressionS exp; - symbolS *prologue_end; + symbolS *prologue_start, *prologue_end; symbolS *line_end; struct line_seg *s; int sizeof_offset; @@ -1527,10 +1527,14 @@ out_debug_line (segT line_seg) out_two (DWARF2_LINE_VERSION); /* Length of the prologue following this length. */ + prologue_start = symbol_temp_make (); prologue_end = symbol_temp_make (); + exp.X_op = O_subtract; exp.X_add_symbol = prologue_end; - exp.X_add_number = - (4 + 2 + 4); + exp.X_op_symbol = prologue_start; + exp.X_add_number = 0; emit_expr (&exp, sizeof_offset); + symbol_set_value_now (prologue_start); /* Parameters of the state machine. */ out_byte (DWARF2_LINE_MIN_INSN_LENGTH); |