diff options
author | Jan Hubicka <jh@suse.cz> | 2011-10-02 12:41:24 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2011-10-02 10:41:24 +0000 |
commit | ed0d2da02b3189f014f027997e11e6dba5ad4761 (patch) | |
tree | 05d172b704e7c63048f3ef9b5fd618f3b89ee016 /gcc/lto-symtab.c | |
parent | 96d7b15ff3ded45c424b1a240a7db64d3ae975e3 (diff) | |
download | gcc-ed0d2da02b3189f014f027997e11e6dba5ad4761.tar.gz |
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 'gcc/lto-symtab.c')
-rw-r--r-- | gcc/lto-symtab.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 3a7c783f770..68c6231760e 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -441,12 +441,14 @@ lto_symtab_resolve_symbols (void **slot) e->node = cgraph_get_node (e->decl); else if (TREE_CODE (e->decl) == VAR_DECL) e->vnode = varpool_get_node (e->decl); + if (e->resolution == LDPR_PREVAILING_DEF_IRONLY + || e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP + || e->resolution == LDPR_PREVAILING_DEF) + prevailing = e; } - e = (lto_symtab_entry_t) *slot; - /* If the chain is already resolved there is nothing else to do. */ - if (e->resolution != LDPR_UNKNOWN) + if (prevailing) return; /* Find the single non-replaceable prevailing symbol and @@ -586,6 +588,7 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED) for (prevailing = (lto_symtab_entry_t) *slot; prevailing && prevailing->resolution != LDPR_PREVAILING_DEF_IRONLY + && prevailing->resolution != LDPR_PREVAILING_DEF_IRONLY_EXP && prevailing->resolution != LDPR_PREVAILING_DEF; prevailing = prevailing->next) ; @@ -595,6 +598,7 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED) for (e = prevailing->next; e; e = e->next) { if (e->resolution == LDPR_PREVAILING_DEF_IRONLY + || e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP || e->resolution == LDPR_PREVAILING_DEF) fatal_error ("multiple prevailing defs for %qE", DECL_NAME (prevailing->decl)); @@ -685,9 +689,9 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED) to handle UNKNOWN relocation well. The problem with storing guessed decision is whether to use - PREVAILING_DEF or PREVAILING_DEF_IRONLY. First one would disable - some whole program optimizations, while ther second would imply - to many whole program assumptions. */ + PREVAILING_DEF, PREVAILING_DEF_IRONLY, PREVAILING_DEF_IRONLY_EXP. + First one would disable some whole program optimizations, while + ther second would imply to many whole program assumptions. */ if (prevailing->node && !flag_ltrans && !prevailing->guessed) prevailing->node->resolution = prevailing->resolution; else if (prevailing->vnode && !flag_ltrans && !prevailing->guessed) |