aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-03-18 18:34:38 -0700
committerH.J. Lu <hjl.tools@gmail.com>2021-03-18 18:34:48 -0700
commit51f6e7a9f4210aed0f8156c1d2e348de6f96f37d (patch)
tree46e67b86dcd68881082f402958821056ab2e5d5b /bfd
parentfb099b8a51906d2189e8f1ba4dcda1f85ff0a78d (diff)
downloadgdb-51f6e7a9f4210aed0f8156c1d2e348de6f96f37d.zip
gdb-51f6e7a9f4210aed0f8156c1d2e348de6f96f37d.tar.gz
gdb-51f6e7a9f4210aed0f8156c1d2e348de6f96f37d.tar.bz2
DWARF: Check version >= 3 for DW_FORM_ref_addr
Check version >= 3, instead of version == 3 || version == 4, for DW_FORM_ref_addr. bfd/ PR ld/27587 * dwarf2.c (read_attribute_value): Check version >= 3 for DW_FORM_ref_addr. ld/ PR ld/27587 * testsuite/ld-x86-64/pr27587.err: New file. * testsuite/ld-x86-64/pr27587a.obj.bz2: Likewise. * testsuite/ld-x86-64/pr27587b.obj.bz2: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run PR ld/27587 test.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/dwarf2.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2bea062..94155de 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2021-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/27587
+ * dwarf2.c (read_attribute_value): Check version >= 3 for
+ DW_FORM_ref_addr.
+
2021-03-16 Nick Clifton <nickc@redhat.com>
* peXXigen.c (_bfd_XXi_swap_aux_out): Avoid potential buffer
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index b42e641..1d5ddef 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1213,7 +1213,7 @@ read_attribute_value (struct attribute * attr,
case DW_FORM_ref_addr:
/* DW_FORM_ref_addr is an address in DWARF2, and an offset in
DWARF3. */
- if (unit->version == 3 || unit->version == 4)
+ if (unit->version >= 3)
{
if (unit->offset_size == 4)
attr->u.val = read_4_bytes (unit->abfd, info_ptr, info_ptr_end);