diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-03 18:29:09 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-03 18:29:09 +0000 |
| commit | cda2911caaf64f11905dcc0757a1b291943bbe9a (patch) | |
| tree | 479d25f058fde301d3cbf8a362335a011fd66585 /llvm/tools/gold/gold-plugin.cpp | |
| parent | 3d78fe8fa02e75c4416b36c5537fdff614fee040 (diff) | |
| download | bcm5719-llvm-cda2911caaf64f11905dcc0757a1b291943bbe9a.tar.gz bcm5719-llvm-cda2911caaf64f11905dcc0757a1b291943bbe9a.zip | |
Optimize linkonce_odr unnamed_addr functions during LTO.
Generalize the API so we can distinguish symbols that are needed just for a DSO
symbol table from those that are used from some native .o.
The symbols that are only wanted for the dso symbol table can be dropped if
llvm can prove every other dso has a copy (linkonce_odr) and the address is not
important (unnamed_addr).
llvm-svn: 191922
Diffstat (limited to 'llvm/tools/gold/gold-plugin.cpp')
| -rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index bd11d1b5556..119631cfa7e 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -197,7 +197,7 @@ ld_plugin_status onload(ld_plugin_tv *tv) { case LDPT_ADD_SYMBOLS: add_symbols = tv->tv_u.tv_add_symbols; break; - case LDPT_GET_SYMBOLS: + case LDPT_GET_SYMBOLS_V2: get_symbols = tv->tv_u.tv_get_symbols; break; case LDPT_ADD_INPUT_FILE: @@ -386,6 +386,11 @@ static ld_plugin_status all_symbols_read_hook(void) { if (options::generate_api_file) api_file << I->syms[i].name << "\n"; + } else if (I->syms[i].resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) { + lto_codegen_add_dso_symbol(code_gen, I->syms[i].name); + + if (options::generate_api_file) + api_file << I->syms[i].name << " dso only\n"; } } } |

