This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed, PATCH] Check error return from bfd_canonicalize_dynamic_reloc
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Mon, 18 Sep 2017 13:09:20 -0700
- Subject: [committed, PATCH] Check error return from bfd_canonicalize_dynamic_reloc
- Authentication-results: sourceware.org; auth=none
Since bfd_canonicalize_dynamic_reloc returns -1 on error, check it in
_bfd_x86_elf_get_synthetic_symtab.
PR ld/22148
* elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
return from bfd_canonicalize_dynamic_reloc.
---
bfd/ChangeLog | 6 ++++++
bfd/elfxx-x86.c | 2 ++
2 files changed, 8 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5f6b4235ee..c6075498d3 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22148
+ * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
+ return from bfd_canonicalize_dynamic_reloc.
+
2017-09-15 Alan Modra <amodra@gmail.com>
PR 22116
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index c41dbeff76..2145308ce3 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -1807,6 +1807,8 @@ _bfd_x86_elf_get_synthetic_symtab (bfd *abfd,
dynrelcount = bfd_canonicalize_dynamic_reloc (abfd, dynrelbuf,
dynsyms);
+ if (dynrelcount < 0)
+ return -1;
/* Sort the relocs by address. */
qsort (dynrelbuf, dynrelcount, sizeof (arelent *),
--
2.13.5