diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 10 | ||||
-rw-r--r-- | bfd/elf.c | 10 | ||||
-rw-r--r-- | bfd/elflink.c | 1 |
3 files changed, 16 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ddf29bf..b145feb 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2016-07-21 Nick Clifton <nickc@redhat.com> + + * elf.c (_bfd_elf_filter_global_symbols): Skip local symbols. + (swap_out_syms): Return an error when not finding ELF output + section rather than asserting. + +2016-07-21 Thomas Preud'homme <thomas.preudhomme@arm.com> + + * elflink.c (elf_output_implib): Call bfd_set_error on no symbols. + 2016-07-20 John Baldwin <jhb@FreeBSD.org> * elf.c (elfcore_grok_freebsd_psinfo): Check for minimum note size @@ -3893,9 +3893,10 @@ _bfd_elf_filter_global_symbols (bfd *abfd, struct bfd_link_info *info, continue; h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, FALSE); + if (h == NULL) + continue; if (h->type != bfd_link_hash_defined && h->type != bfd_link_hash_defweak) continue; - if (h->linker_def || h->ldscript_def) continue; @@ -7643,7 +7644,9 @@ error_return: section of a symbol to be a section that is actually in the output file. */ sec2 = bfd_get_section_by_name (abfd, sec->name); - if (sec2 == NULL) + if (sec2 != NULL) + shndx = _bfd_elf_section_from_bfd_section (abfd, sec2); + if (shndx == SHN_BAD) { _bfd_error_handler (_("\ Unable to find equivalent output section for symbol '%s' from section '%s'"), @@ -7652,9 +7655,6 @@ Unable to find equivalent output section for symbol '%s' from section '%s'"), bfd_set_error (bfd_error_invalid_operation); goto error_return; } - - shndx = _bfd_elf_section_from_bfd_section (abfd, sec2); - BFD_ASSERT (shndx != SHN_BAD); } } diff --git a/bfd/elflink.c b/bfd/elflink.c index a994b83..5bc5740 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -11091,6 +11091,7 @@ elf_output_implib (bfd *abfd, struct bfd_link_info *info) symcount = _bfd_elf_filter_global_symbols (abfd, info, sympp, symcount); if (symcount == 0) { + bfd_set_error (bfd_error_no_symbols); (*_bfd_error_handler) (_("%B: no symbol found for import library"), implib_bfd); goto free_sym_buf; |