aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-08-22 13:24:34 +0930
committerAlan Modra <amodra@gmail.com>2015-08-22 16:24:52 +0930
commit595bce7595e076391e7147b0c6db57a8edf2e406 (patch)
tree352470d415a279d64e65d60fa61c3e11f2195a2c
parent0d6b12851b08f5f71f7d97d2c832b899d63b5df2 (diff)
downloadgdb-595bce7595e076391e7147b0c6db57a8edf2e406.zip
gdb-595bce7595e076391e7147b0c6db57a8edf2e406.tar.gz
gdb-595bce7595e076391e7147b0c6db57a8edf2e406.tar.bz2
Uninitialized vd_nodename
Belt and braces fix. Either of the changes here is sufficient to ensure vd_nodename is initialized properly. * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename. Don't copy fields not set by _bfd_elf_swap_verdef_in.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index dcd0e88..47b7642 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-22 Alan Modra <amodra@gmail.com>
+
+ * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename.
+ Don't copy fields not set by _bfd_elf_swap_verdef_in.
+
2015-08-19 Jiong Wang <jiong.wang@arm.com>
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
diff --git a/bfd/elf.c b/bfd/elf.c
index f20679e..f8e1295 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -7871,7 +7871,7 @@ error_return_verref:
goto error_return_bad_verdef;
iverdef = &iverdefarr[(iverdefmem.vd_ndx & VERSYM_VERSION) - 1];
- memcpy (iverdef, &iverdefmem, sizeof (Elf_Internal_Verdef));
+ memcpy (iverdef, &iverdefmem, offsetof (Elf_Internal_Verdef, vd_bfd));
iverdef->vd_bfd = abfd;
@@ -7920,6 +7920,7 @@ error_return_verref:
((bfd_byte *) everdaux + iverdaux->vda_next));
}
+ iverdef->vd_nodename = NULL;
if (iverdef->vd_cnt)
iverdef->vd_nodename = iverdef->vd_auxptr->vda_nodename;