* elfcode.h (elf_link_input_bfd): Don't try to read local symbols
authorJeff Law <law@redhat.com>
Fri, 17 Jun 1994 05:39:55 +0000 (05:39 +0000)
committerJeff Law <law@redhat.com>
Fri, 17 Jun 1994 05:39:55 +0000 (05:39 +0000)
if there aren't any in the input file.

bfd/ChangeLog
bfd/elfcode.h

index 6b7e8a3a7cb183c925da480e63b7ad2c94d02ac0..3682b840460c90bceb54f0ee7fdc44705f99fbbb 100644 (file)
@@ -1,3 +1,8 @@
+Thu Jun 16 23:36:23 1994  Jeff Law  (law@snake.cs.utah.edu)
+
+       * elfcode.h (elf_link_input_bfd): Don't try to read local symbols
+       if there aren't any in the input file.
+
 Thu Jun 16 14:25:22 1994  Eric Youngdale  (ericy@cais.cais.com)
 
        * i386linux.c: Many new functions and definitions for linker
 Thu Jun 16 14:25:22 1994  Eric Youngdale  (ericy@cais.cais.com)
 
        * i386linux.c: Many new functions and definitions for linker
index 79b85a39adcad7c2730747ee0c7f50b3681058a0..26b666e0d2aa3fc4d0909b0ee652d0eafc65f856 100644 (file)
@@ -5850,10 +5850,11 @@ elf_link_input_bfd (finfo, input_bfd)
     }
 
   /* Read the local symbols.  */
     }
 
   /* Read the local symbols.  */
-  if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
-      || (bfd_read (finfo->external_syms, sizeof (Elf_External_Sym),
-                   locsymcount, input_bfd)
-         != locsymcount * sizeof (Elf_External_Sym)))
+  if (locsymcount > 0
+      && (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+         || (bfd_read (finfo->external_syms, sizeof (Elf_External_Sym),
+                       locsymcount, input_bfd)
+             != locsymcount * sizeof (Elf_External_Sym))))
     return false;
 
   /* Swap in the local symbols and write out the ones which we know
     return false;
 
   /* Swap in the local symbols and write out the ones which we know