"raw" patch adding comdat support to lld elf2

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 09:18:14 PDT 2015


On Fri, Oct 9, 2015 at 9:13 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> On 8 October 2015 at 19:08, Rui Ueyama <ruiu at google.com> wrote:
> > You are using SymbolTable's hash table both for dedup'ing SHT_GROUP
> sections
> > and store symbols, but seems like the two uses don't overlap in your
> code.
> > SHT_GROUP sections only cares if the LSB bit is set in the pointer, and
> > symbols only care about pointers stored at MSBs. Is this different from
> > having a separate hash table for SHT_GROUP sections?
>
> We can have two tables. Most, but not all, group symbols are also
> regular symbols. For example, given
>
> inline void foo() {}
>
> clang produces a _Z3foov symbol and puts the section in a comdat with
> at signature of _Z3foov.
>
> So having one table is potentially just an optimization.
>

How can it be a performance optimization?

Say we have _Z3foov symbol but have never seen _Z3foov group. We are
reading an object file that contains a group whose name is _Z3foov. Then
your code will just read that group regardless of the presence of the
symbol having the same name, no?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151009/f80fa10d/attachment.html>


More information about the llvm-commits mailing list