aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/dwarf2.c16
2 files changed, 20 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 26508d8..1a08ba9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ 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.
+
2007-08-31 H.J. Lu <hongjiu.lu@intel.com>
PR ld/4986
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 */