x86: Return -1 if bfd_canonicalize_dynamic_reloc returns 0
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 22 Sep 2017 14:25:16 +0000 (07:25 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 22 Sep 2017 14:25:16 +0000 (07:25 -0700)
Stop if bfd_canonicalize_dynamic_reloc returns 0.

PR ld/22163
* elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
-1 if bfd_canonicalize_dynamic_reloc returns 0.

bfd/ChangeLog
bfd/elfxx-x86.c

index 46643eb31dac8237fb62d77c7645b8fbffb07383..1df9691c9e8a28f7b98af818205889c44e31af57 100644 (file)
@@ -1,3 +1,9 @@
+2017-09-22  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/22163
+       * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
+       -1 if bfd_canonicalize_dynamic_reloc returns 0.
+
 2017-09-22  Pedro Alves  <palves@redhat.com>
            Alan Modra  <amodra@gmail.com>
 
index 2145308ce330bb6691a6007fc893b278c1c3a192..11883ded36cfa96720308fb455651576f2a41295 100644 (file)
@@ -1807,7 +1807,7 @@ _bfd_x86_elf_get_synthetic_symtab (bfd *abfd,
 
   dynrelcount = bfd_canonicalize_dynamic_reloc (abfd, dynrelbuf,
                                                dynsyms);
-  if (dynrelcount < 0)
+  if (dynrelcount <= 0)
     return -1;
 
   /* Sort the relocs by address.  */