aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-07-20 15:06:49 +0930
committerAlan Modra <amodra@gmail.com>2016-07-21 11:30:34 +0930
commit5df1bc570fcc5ef5257b7a044acdaeb6b95b9822 (patch)
treeb0992244c629eaa0646c2dfd99dcf6487066f4f3 /bfd/elf.c
parentc092a4d9154f09e6c67648efb723878d7a74f44f (diff)
Fix implib test failures
bfd/ * 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. * elflink.c (elf_output_implib): Call bfd_set_error on no symbols. ld/ * testsuite/lib/ld-lib.exp (run_ld_link_tests): Add optional parameter to pass list of xfails. * testsuite/ld-elf/elf.exp: Add xfails for implib tests. Tidy implib test formatting. Don't set .data start address. * testsuite/ld-elf/implib.s: Remove first .bss directive and replace second one with equivalent .section directive. * testsuite/ld-elf/empty-implib.out: Add expected final error. * testsuite/ld-elf/implib.rd: Update.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index ba1774e7b4..274cd535fa 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -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);
}
}