aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-06-17 05:39:55 +0000
committerJeff Law <law@redhat.com>1994-06-17 05:39:55 +0000
commitc46b8ed7e6fae0cb0ef36527b491546378a849b8 (patch)
tree131cdd066b47076c6ea73f98af99fdcfb146b6b5 /bfd/elfcode.h
parentc4aa82c196618f121fc2c827fad8e4aa0dd1daa6 (diff)
downloadgdb-c46b8ed7e6fae0cb0ef36527b491546378a849b8.zip
gdb-c46b8ed7e6fae0cb0ef36527b491546378a849b8.tar.gz
gdb-c46b8ed7e6fae0cb0ef36527b491546378a849b8.tar.bz2
* elfcode.h (elf_link_input_bfd): Don't try to read local symbols
if there aren't any in the input file.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 79b85a3..26b666e 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -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