From aff90a5f25f7874abe0e27b5575e2dd3e11484c7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 2 Sep 2007 13:29:20 +0000 Subject: bfd/ 2007-09-02 H.J. Lu PR ld/4986 * dwarf2.c (new_line_sorts_after): Undo the last change. (add_line_info): Only keep the last entry with the same address and end sequence. ld/testsuite/ 2007-09-02 H.J. Lu PR ld/4986 * ld-ia64/line.exp: New. * ld-ia64/undefined.s: Likewise. * ld-x86-64/line.exp: Don't check CC. --- bfd/dwarf2.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'bfd/dwarf2.c') diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 7f5f397..e873e8c 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -917,8 +917,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->line > line->line - || new_line->end_sequence < line->end_sequence))); + && new_line->end_sequence < line->end_sequence)); } @@ -968,7 +967,18 @@ add_line_info (struct line_info_table *table, Note: we may receive duplicate entries from 'decode_line_info'. */ - if (!table->last_line + if (table->last_line + && table->last_line->address == address + && table->last_line->end_sequence == end_sequence) + { + /* We only keep the last entry with the same address and end + sequence. See PR ld/4986. */ + if (table->lcl_head == table->last_line) + table->lcl_head = info; + info->prev_line = table->last_line->prev_line; + table->last_line = info; + } + else if (!table->last_line || new_line_sorts_after (info, table->last_line)) { /* Normal case: add 'info' to the beginning of the list */ -- cgit v1.1