aboutsummaryrefslogtreecommitdiff
path: root/lto-plugin
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-10-02 12:41:24 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2011-10-02 10:41:24 +0000
commited0d2da02b3189f014f027997e11e6dba5ad4761 (patch)
tree05d172b704e7c63048f3ef9b5fd618f3b89ee016 /lto-plugin
parent96d7b15ff3ded45c424b1a240a7db64d3ae975e3 (diff)
downloadgcc-ed0d2da02b3189f014f027997e11e6dba5ad4761.zip
gcc-ed0d2da02b3189f014f027997e11e6dba5ad4761.tar.gz
gcc-ed0d2da02b3189f014f027997e11e6dba5ad4761.tar.bz2
re PR lto/47247 (Linker plugin specification makes it difficult to handle COMDATs)
PR lto/47247 * lto-plugin.c (get_symbols_v2): New variable. (write_resolution): Use V2 API when available. (onload): Handle LDPT_GET_SYMBOLS_V2. * lto-symtab.c (lto_symtab_resolve_symbols): Do not resolve when resolution is already availbale from plugin. (lto_symtab_merge_decls_1): Handle LDPR_PREVAILING_DEF_IRONLY_EXP. * cgraph.c (ld_plugin_symbol_resolution): Add prevailing_def_ironly_exp. * lto-cgraph.c (LDPR_NUM_KNOWN): Update. * ipa.c (varpool_externally_visible_p): IRONLY variables are never externally visible. * varasm.c (resolution_to_local_definition_p): Add LDPR_PREVAILING_DEF_IRONLY_EXP. (resolution_local_p): Likewise. * common.c (lto_resolution_str): Add new resolution. * common.h (lto_resolution_str): Likewise. From-SVN: r179424
Diffstat (limited to 'lto-plugin')
-rw-r--r--lto-plugin/ChangeLog7
-rw-r--r--lto-plugin/lto-plugin.c12
2 files changed, 17 insertions, 2 deletions
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 7b0f3bc..bf149e4 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-02 Jan Hubicka <jh@suse.cz>
+
+ PR lto/47247
+ * lto-plugin.c (get_symbols_v2): New variable.
+ (write_resolution): Use V2 API when available.
+ (onload): Handle LDPT_GET_SYMBOLS_V2.
+
2011-09-30 H.J. Lu <hongjiu.lu@intel.com>
Andi Kleen <ak@linux.intel.com>
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 9323bd2..d7a7813 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -130,7 +130,7 @@ enum symbol_style
static char *arguments_file_name;
static ld_plugin_register_claim_file register_claim_file;
static ld_plugin_register_all_symbols_read register_all_symbols_read;
-static ld_plugin_get_symbols get_symbols;
+static ld_plugin_get_symbols get_symbols, get_symbols_v2;
static ld_plugin_register_cleanup register_cleanup;
static ld_plugin_add_input_file add_input_file;
static ld_plugin_add_input_library add_input_library;
@@ -443,7 +443,12 @@ write_resolution (void)
struct plugin_symtab *symtab = &info->symtab;
struct ld_plugin_symbol *syms = symtab->syms;
- get_symbols (info->handle, symtab->nsyms, syms);
+ /* Version 2 of API supports IRONLY_EXP resolution that is
+ accepted by GCC-4.7 and newer. */
+ if (get_symbols_v2)
+ get_symbols_v2 (info->handle, symtab->nsyms, syms);
+ else
+ get_symbols (info->handle, symtab->nsyms, syms);
finish_conflict_resolution (symtab, &info->conflicts);
@@ -988,6 +993,9 @@ onload (struct ld_plugin_tv *tv)
case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK:
register_all_symbols_read = p->tv_u.tv_register_all_symbols_read;
break;
+ case LDPT_GET_SYMBOLS_V2:
+ get_symbols_v2 = p->tv_u.tv_get_symbols;
+ break;
case LDPT_GET_SYMBOLS:
get_symbols = p->tv_u.tv_get_symbols;
break;