aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-18 13:05:25 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-18 13:05:25 -0700
commit94670f6cf11fc29cc6db6814b38c4305d9bcac96 (patch)
tree42fc95d47746fc2877927c69966bfbb0a73b5237 /bfd
parent0615127c587253a6386fe49468fd64abf827273e (diff)
downloadgdb-94670f6cf11fc29cc6db6814b38c4305d9bcac96.zip
gdb-94670f6cf11fc29cc6db6814b38c4305d9bcac96.tar.gz
gdb-94670f6cf11fc29cc6db6814b38c4305d9bcac96.tar.bz2
Check error return from bfd_canonicalize_dynamic_reloc
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfxx-x86.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5f6b423..c607549 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 c41dbef..2145308 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 *),