Support dead-stripping in ELF objects

Michael Spencer bigcheesegs at gmail.com
Fri Apr 5 17:04:39 PDT 2013


On Wed, Apr 3, 2013 at 8:45 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> Do we need to compute this? We should only need to know if a symbol is
> referenced, not who is referencing it. With that we can just say that
> a symbol is referenced if
>
> * A relocation points to it.
> * It is in a section without SHF_SUBSECTION_VIA_SYMBOLS and a
> relocation points to that section.
>
> My concern is that in the non  SHF_SUBSECTION_VIA_SYMBOLS case the
> full symbol reference graph as defined above would be n^2 in cases
> like .text and .eh_frame. There is (approximately) one symbol in
> .eh_frame for each symbol in .text and it has a relocation to the
> corresponding .text symbol. We would get n^2 edges without
> SHF_SUBSECTION_VIA_SYMBOLS.
>

You don't need to track who is referencing a symbol to compute this. You
just need to know who a symbol is referencing, and which symbols are part
of a group. When you hit a symbol while traversing live symbols, you mark
all symbols in that group live.

- Michael Spencer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130405/b2106cca/attachment.html>


More information about the llvm-commits mailing list