diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2014-08-07 09:53:46 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-08-07 10:28:48 +0930 |
commit | db7129469b10a701659f0e38e3edeb2191236831 (patch) | |
tree | 7434faef30933c44ba6d79bc9f9f4b136f07f928 /bfd/linker.c | |
parent | 59c2656733ccb54660f48c10608f4c1753dcaf01 (diff) | |
download | gdb-db7129469b10a701659f0e38e3edeb2191236831.zip gdb-db7129469b10a701659f0e38e3edeb2191236831.tar.gz gdb-db7129469b10a701659f0e38e3edeb2191236831.tar.bz2 |
Don't issue a warning for references in LTO IR to warning symbols
bfd/
PR ld/16746
* linker.c (_bfd_generic_link_add_one_symbol): Don't issue a
warning for references in LTO IR to warning symbols.
ld/testsuite/
PR ld/16746
* ld-plugin/lto.exp: Add 4 tests for PR ld/16746.
* ld-plugin/pr16746a.c: New file.
* ld-plugin/pr16746b.c: Likewise.
* ld-plugin/pr16746c.c: Likewise.
* ld-plugin/pr16746d.c: Likewise.
Diffstat (limited to 'bfd/linker.c')
-rw-r--r-- | bfd/linker.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bfd/linker.c b/bfd/linker.c index 93c5465..d4b053c 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1776,8 +1776,10 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info, break; case WARNC: - /* Issue a warning and cycle. */ - if (h->u.i.warning != NULL) + /* Issue a warning and cycle, except when the reference is + in LTO IR. */ + if (h->u.i.warning != NULL + && (abfd->flags & BFD_PLUGIN) == 0) { if (! (*info->callbacks->warning) (info, h->u.i.warning, h->root.string, abfd, @@ -1802,12 +1804,9 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info, break; case WARN: - /* Warn if this symbol has been referenced already, - otherwise add a warning. A symbol has been referenced if - the u.undef.next field is not NULL, or it is the tail of the - undefined symbol list. The REF case above helps to - ensure this. */ - if (h->u.undef.next != NULL || info->hash->undefs_tail == h) + /* Warn if this symbol has been referenced already from non-IR, + otherwise add a warning. */ + if (h->non_ir_ref) { if (! (*info->callbacks->warning) (info, string, h->root.string, hash_entry_bfd (h), NULL, 0)) |