This is the mail archive of the
mailing list for the binutils project.
PR21957, addr2line incorrectly handles non-increasing sequences in line table
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sun, 1 Oct 2017 20:54:53 +1030
- Subject: PR21957, addr2line incorrectly handles non-increasing sequences in line table
- Authentication-results: sourceware.org; auth=none
DW_LNE_end_sequence always terminates the line_info list. There isn't
any reason that a line_info with end_sequece set should go anywhere
but the end.
* dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
(add_line_info): Always put end_sequence last.
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 4cf50cc..248e621 100644
@@ -1420,9 +1420,7 @@ new_line_sorts_after (struct line_info *new_line, struct line_info *line)
return (new_line->address > line->address
|| (new_line->address == line->address
- && (new_line->op_index > line->op_index
- || (new_line->op_index == line->op_index
- && new_line->end_sequence < line->end_sequence))));
+ && new_line->op_index > line->op_index));
@@ -1508,7 +1506,8 @@ add_line_info (struct line_info_table *table,
table->sequences = seq;
- else if (new_line_sorts_after (info, seq->last_line))
+ else if (info->end_sequence
+ || new_line_sorts_after (info, seq->last_line))
/* Normal case: add 'info' to the beginning of the current sequence. */
info->prev_line = seq->last_line;
Australia Development Lab, IBM