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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 12:38:23 PST 2017


BTW, OK to submit this change?

On Mon, Feb 27, 2017 at 12:26 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170227/6e2202d1/attachment.html>


More information about the llvm-commits mailing list