[PATCH] D20645: Avoid doing binary search.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 12:22:39 PDT 2016

ruiu added a comment.

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.

The symbol table is the single central repository to identify and uniquify pieces of data and mergeable strings can piggyback on it.  I think this way is a lot faster than the current scheme to merge strings using mergeable sections.


More information about the llvm-commits mailing list