[patch] Fix pr25919

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 10:02:45 PST 2016


Hi Rafael,

If I understand correctly this allow the linker to hide weak symbols whose address is not taken or used in a comparison, to speed up the dynamic linker resolution.
It is not clear to me why this information is needed by the linker before doing LTO? Do you know?

— 
Mehdi



> On Dec 22, 2015, at 7:46 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> The asserts for checking all uses while the module is being
> materialized found the first problem.
> 
> The issues happens when libLTO is trying to set
> LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN. It needs all uses in order to
> produce a valid answer.
> 
> The attached patch adds a graceful degradation.
> 
> What is done instead in the gold plugin is to check the uses in the
> merged module.
> 
> If this degrades quality too much, a solution would be to check the
> uses and add unnamed_addr marks at the end of IRGen. That way
> canBeOmittedFromSymbolTable would not need to run analyzeGlobal at
> all.
> 
> Cheers,
> Rafael
> <t.diff>



More information about the llvm-commits mailing list