[PATCH] D20645: Avoid doing binary search.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 20:01:11 PDT 2016

silvas added a comment.

In http://reviews.llvm.org/D20645#441351, @ruiu wrote:

> Not directly related to this patch, and I'm not suggesting we should do it, but here's one radical idea that could make the mergeable section handling a lot faster: instead of storing mergeable strings into sections, make them symbols and handle symbol names as symbol contents. For example, for a mergeable string "foobar", a compiler create a symbol ".merge.foobar". When a linker see a symbol that starts with ".merge." prefix (or with a special symbol type), it creates section contents just like as it reserves space in .bss for common symbols by copying the symbol name to the section, and set the symbol's address to the address in the section.

Yes, this is exactly what I mentioned above about creating separate "input sections" for each mergeable object. I was thinking about doing it at the section level because that seems more natural for ELF (the compiler already does this to some extent in -ffunction-sections -fdata-sections), but I guess it might make sense to do it at symbol level as a sort of "atom model".


More information about the llvm-commits mailing list