diff options
author | Fangrui Song <maskray@google.com> | 2020-04-15 14:25:08 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-04-15 14:25:08 +0100 |
commit | 95a515681272fa3a79624279c1579cce14ad61c0 (patch) | |
tree | 21c4c3be88223c9b38116c46614fc87ac9e7f3d1 /bfd/elflink.c | |
parent | b1bc1394df596eaaecca0c2ae89eb4fb2c204927 (diff) | |
download | binutils-95a515681272fa3a79624279c1579cce14ad61c0.zip binutils-95a515681272fa3a79624279c1579cce14ad61c0.tar.gz binutils-95a515681272fa3a79624279c1579cce14ad61c0.tar.bz2 |
Unify the behaviour of ld.bfd and ld.gold with respect to warning about unresolved symbol references. (PR 24613)
PR binutils/24613
include * bfdlink.h (enum report_method): Delete RM_GENERATE_WARNING and
RM_GENERATE_ERROR. Add RM_DIAGNOSE.
(struct bfd_link_info): Add warn_unresolved_syms.
ld * lexsup.c (parse_args): Change RM_GENERATE_WARNING and
RM_GENERATE_ERROR to RM_DIAGNOSE.
* emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Change
RM_GENERATE_ERROR to RM_DIAGNOSE.
* emultempl/elf.em (ld_${EMULATION_NAME}_emulation): Likewise.
bfd * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
to RM_DIAGNOSE plus a check of warn_unresolved_syms.
* coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
* elf-bfd.h (_bfd_elf_large_com_section): Likewise.
* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
* elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
* elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
* elf32-sh.c (sh_elf_relocate_section): Likewise.
* elf32-spu.c (spu_elf_relocate_section): Likewise.
* elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
* elflink.c (elf_link_output_extsym): Likewise.
* elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index 7c08494..eb6b3ee 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -9886,11 +9886,13 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) && (!h->ref_regular || flinfo->info->gc_sections) && !elf_link_check_versioned_symbol (flinfo->info, bed, h) && flinfo->info->unresolved_syms_in_shared_libs != RM_IGNORE) - (*flinfo->info->callbacks->undefined_symbol) - (flinfo->info, h->root.root.string, - h->ref_regular ? NULL : h->root.u.undef.abfd, - NULL, 0, - flinfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR); + { + flinfo->info->callbacks->undefined_symbol + (flinfo->info, h->root.root.string, + h->ref_regular ? NULL : h->root.u.undef.abfd, NULL, 0, + flinfo->info->unresolved_syms_in_shared_libs == RM_DIAGNOSE + && !flinfo->info->warn_unresolved_syms); + } /* Strip a global symbol defined in a discarded section. */ if (h->indx == -3) |