PR ld/20276: Set non_ir_ref on common symbol

Also, don't check alignment on symbol from plugin dummy input.

bfd/
	PR ld/20276
	* elflink.c (elf_link_add_object_symbols): Don't check alignment
	on symbol from plugin dummy input.
ld/
	PR ld/20276
	* plugin.c (plugin_notice): Set non_ir_ref on common symbols.
	* testsuite/ld-plugin/lto.exp (lto_link_tests): Add test for
	PR ld/20276.
	(lto_run_tests): Likewise.
	* testsuite/ld-plugin/pass.out: New file.
	* testsuite/ld-plugin/pr20276a.c: Likewise.
	* testsuite/ld-plugin/pr20276b.c: Likewise.
This commit is contained in:
Alan Modra
2016-06-20 09:53:50 +09:30
parent 6336b4b737
commit 0616a28038
8 changed files with 66 additions and 14 deletions

View File

@@ -4556,7 +4556,8 @@ error_free_dyn:
symbol_align = ffs (h->root.u.def.value) - 1;
if (h->root.u.def.section->owner != NULL
&& (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
&& (h->root.u.def.section->owner->flags
& (DYNAMIC | BFD_PLUGIN)) == 0)
{
normal_align = h->root.u.def.section->alignment_power;
if (normal_align > symbol_align)