gcc PR lto/42757

* plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
	prevailing definitions of common symbols.
	* testsuite/plugin_test_6.sh: New test case.
	* testsuite/plugin_common_test_1.c: New test case.
	* testsuite/plugin_common_test_2.c: New test case.
	* testsuite/Makefile.am (plugin_test_6): New test case.
	* testsuite/Makefile.in: Regenerate.
This commit is contained in:
Cary Coutant
2010-04-06 21:56:24 +00:00
parent 3149d8c115
commit be234d887e
7 changed files with 211 additions and 6 deletions

View File

@ -503,6 +503,10 @@ Pluginobj::get_symbol_resolution_info(int nsyms, ld_plugin_symbol* syms) const
// The original symbol was undefined or common.
if (lsym->source() != Symbol::FROM_OBJECT)
res = LDPR_RESOLVED_EXEC;
else if (lsym->object()->pluginobj() == this)
res = (is_visible_from_outside(lsym)
? LDPR_PREVAILING_DEF
: LDPR_PREVAILING_DEF_IRONLY);
else if (lsym->object()->pluginobj() != NULL)
res = LDPR_RESOLVED_IR;
else if (lsym->object()->is_dynamic())