diff --git a/bfd/elflink.c b/bfd/elflink.c index 0a0456177c2..5c8b822e36a 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -5096,13 +5096,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) if (name == NULL) goto error_free_vers; - if (name[0] == '\0') - { - _bfd_error_handler (_("%pB: corrupt symbol table"), abfd); - bfd_set_error (bfd_error_bad_value); - goto error_free_vers; - } - if (isym->st_shndx == SHN_COMMON && (abfd->flags & BFD_PLUGIN) != 0) { @@ -5146,6 +5139,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) continue; } + if (name[0] == '\0') + { + _bfd_error_handler (_("%pB: corrupt symbol table"), abfd); + bfd_set_error (bfd_error_bad_value); + goto error_free_vers; + } + /* Sanity check that all possibilities were handled. */ if (sec == NULL) abort ();