PR21957, addr2line incorrectly handles non-increasing sequences in line table
authorAlan Modra <amodra@gmail.com>
Sun, 1 Oct 2017 07:09:00 +0000 (17:39 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 1 Oct 2017 09:05:07 +0000 (19:35 +1030)
PR 21957
* dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
(add_line_info): Always put end_sequence last.

bfd/ChangeLog
bfd/dwarf2.c

index 9a6af67c57cdd5c77650ec3e72d0f2ee783f6566..b51311ec1f1f082ef8ee2f475976137efe2a87b7 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-01  Alan Modra  <amodra@gmail.com>
+
+       PR 21957
+       * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
+       (add_line_info): Always put end_sequence last.
+
 2017-10-01  Alan Modra  <amodra@gmail.com>
 
        PR 22047
index 4cf50ccddd07d08f4961c521c6efb26cfd64fd35..248e621ad3305dd73b17dd5996ea274ca760b13b 100644 (file)
@@ -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;
       table->num_sequences++;
     }
-  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;