[PATCH] D30365: ELF ICF: Merge only functions.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 12:26:07 PST 2017


> In that way, you can mark a symbol as having a significant address only
> when the symbol is local to a TU, no? If a symbol is global, other TU may
> use its address, so you need to assume conservatively that all globals
> addresses are significant.

Not necessarily. For example, a c++ virtual function is never used
directly from user code, so there is a language guarantee that allows
unnamed_addr to be added.

> I'd think that address taken/not-taken is more like an attribute of each
> reocation, rather than symbol or section. Currently, relocations to take
> addresses are all the same, so linkers cannot know their intentions
> (whether it is used as a pointer or not). If we introduce a new set of
> relocations to convey that information, we can fix this.

But that can be a 2x on the number of relocations. With a symbol flag we
only need one flag.

Cheers,
Rafael


More information about the llvm-commits mailing list