aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-08-24 15:52:53 +0100
committerNick Clifton <nickc@redhat.com>2020-08-24 15:52:53 +0100
commit19d80e5fec548e681c453d15b4ae5b49bc080acc (patch)
treede3b6ff427f9accda9ea549e31e6c5b2c2aa13ba
parent531c73a37bb4477f8337bb9dddc36d552ee76056 (diff)
downloadgdb-19d80e5fec548e681c453d15b4ae5b49bc080acc.zip
gdb-19d80e5fec548e681c453d15b4ae5b49bc080acc.tar.gz
gdb-19d80e5fec548e681c453d15b4ae5b49bc080acc.tar.bz2
bfd: Handle DW_FORM_data16 for .debug_line tables containing MD5
* dwarf2.c (read_attribute_value): Handle DW_FORM_data16. (read_formatted_entries): Likewise. And skip zero entry.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/dwarf2.c21
2 files changed, 24 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 490aec6..b068c38 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-08-24 Mark Wielaard <mark@klomp.org>
+
+ * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
+ (read_formatted_entries): Likewise. And skip zero entry.
+
2020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
* bfd-in2.h (bfd_mach_ck860): New.
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 9ed4a4a..d89a64b 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1329,6 +1329,17 @@ read_attribute_value (struct attribute * attr,
attr->form = DW_FORM_sdata;
attr->u.sval = implicit_const;
break;
+ case DW_FORM_data16:
+ /* This is really a "constant", but there is no way to store that
+ so pretend it is a 16 byte block instead. */
+ amt = sizeof (struct dwarf_block);
+ blk = (struct dwarf_block *) bfd_alloc (abfd, amt);
+ if (blk == NULL)
+ return NULL;
+ blk->size = 16;
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
+ attr->u.blk = blk;
+ break;
default:
_bfd_error_handler (_("DWARF error: invalid or unhandled FORM value: %#x"),
form);
@@ -2069,11 +2080,17 @@ read_formatted_entries (struct comp_unit *unit, bfd_byte **bufp,
case DW_FORM_udata:
*uintp = attr.u.val;
break;
+
+ case DW_FORM_data16:
+ /* MD5 data is in the attr.blk, but we are ignoring those. */
+ break;
}
}
- if (!callback (table, fe.name, fe.dir, fe.time, fe.size))
- return FALSE;
+ /* Skip the first "zero entry", which is the compilation dir/file. */
+ if (datai != 0)
+ if (!callback (table, fe.name, fe.dir, fe.time, fe.size))
+ return FALSE;
}
*bufp = buf;