https://sourceware.org/bugzilla/show_bug.cgi?id=19887
Bug ID: 19887 Summary: --export-dynamic-symbol ignored for plugin symbols Product: binutils Version: 2.27 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: eugeni.stepanov at gmail dot com CC: ian at airs dot com Target Milestone: --- $ cat 1.c void f() {} int main() {} $ clang -flto -O0 1.c -fuse-ld=gold -Wl,--export-dynamic-symbol=f -Wl,-plugin-opt,generate-api-file $ cat apifile.txt f PREVAILING_DEF_IRONLY main PREVAILING_DEF Gold says that "f" is PREVAILING_DEF_IRONLY, i.e. has no external references. I believe it should be PREVAILING_DEF_IRONLY_EXP due to --export-dynamic-symbol=f. The following patch implements the desired behaviour, though I'm not 100% sure this is the best place for the fix. --- a/gold/plugin.cc +++ b/gold/plugin.cc @@ -930,7 +930,10 @@ is_visible_from_outside(Symbol* lsym) { if (lsym->in_dyn()) return true; - if (parameters->options().export_dynamic() || parameters->options().shared()) + if (parameters->options().export_dynamic() || + parameters->options().shared() || + parameters->options().in_dynamic_list(lsym->name()) || + parameters->options().is_export_dynamic_symbol(lsym->name())) return lsym->is_externally_visible(); return false; } -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils