PR ld/16746
include/
* bfdlink.h (struct bfd_link_info): Add lto_plugin_active.
bfd/
* linker.c (_bfd_generic_link_add_one_symbol <WARN>): Handle
!lto_plugin_active.
ld/
* plugin.c (plugin_load_plugins): Set link_info.lto_plugin_active.
case WARN:
/* Warn if this symbol has been referenced already from non-IR,
otherwise add a warning. */
- if (h->non_ir_ref)
+ if ((!info->lto_plugin_active
+ && (h->u.undef.next != NULL || info->hash->undefs_tail == h))
+ || h->non_ir_ref)
{
if (! (*info->callbacks->warning) (info, string, h->root.string,
hash_entry_bfd (h), NULL, 0))
callback. */
unsigned int notice_all: 1;
+ /* TRUE if the LTO plugin is active. */
+ unsigned int lto_plugin_active: 1;
+
/* TRUE if we are loading LTO outputs. */
unsigned int loading_lto_outputs: 1;
plugin_callbacks = *orig_callbacks;
plugin_callbacks.notice = &plugin_notice;
link_info.notice_all = TRUE;
+ link_info.lto_plugin_active = TRUE;
link_info.callbacks = &plugin_callbacks;
}