* elfcode.h (elf_link_input_bfd): Don't try to read local symbols

if there aren't any in the input file.
This commit is contained in:
Jeff Law
1994-06-17 05:39:55 +00:00
parent c4aa82c196
commit c46b8ed7e6
2 changed files with 10 additions and 4 deletions

View File

@ -5850,10 +5850,11 @@ elf_link_input_bfd (finfo, input_bfd)
}
/* 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