From: Ian Lance Taylor Date: Fri, 14 Mar 1997 21:46:39 +0000 (+0000) Subject: * elfcode.h (elf_slurp_symbol_table): Don't try to read the X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f56d634e29f5c0a12dd4d49e769940bf325c9b3b;p=binutils-gdb.git * elfcode.h (elf_slurp_symbol_table): Don't try to read the version symbols if there aren't any. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3d12e34a71a..30434369462 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +Fri Mar 14 16:43:22 1997 Ian Lance Taylor + + * elfcode.h (elf_slurp_symbol_table): Don't try to read the + version symbols if there aren't any. + start-sanitize-tic80 Thu Mar 13 16:38:30 1997 Fred Fish diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 132060157ee..fe85d699bd0 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -949,7 +949,10 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) else { hdr = &elf_tdata (abfd)->dynsymtab_hdr; - verhdr = &elf_tdata (abfd)->dynversym_hdr; + if (elf_dynversym (abfd) == 0) + verhdr = NULL; + else + verhdr = &elf_tdata (abfd)->dynversym_hdr; if ((elf_tdata (abfd)->dynverdef_section != 0 && elf_tdata (abfd)->verdef == NULL) || (elf_tdata (abfd)->dynverref_section != 0 @@ -992,8 +995,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) /* Read the raw ELF version symbol information. */ - if (elf_dynversym (abfd) != 0 - && verhdr != NULL + if (verhdr != NULL && verhdr->sh_size / sizeof (Elf_External_Versym) != symcount) { (*_bfd_error_handler) @@ -1013,7 +1015,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) goto error_return; x_versymp = (Elf_External_Versym *) bfd_malloc (verhdr->sh_size); - if (x_versymp == NULL && symcount != 0) + if (x_versymp == NULL && verhdr->sh_size != 0) goto error_return; if (bfd_read ((PTR) x_versymp, 1, verhdr->sh_size, abfd)