[PATCH] D40716: Fix Wasm symbol name collisions

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 13:17:04 PST 2017


ruiu added a comment.

When linking a large program, you have millions of symbols, and inserting all of them into a set or a hash table is too time-consuming. One of the most important design decision when I made lld is to do only one hash table lookup for each symbol read from a file. We have the main symbol table, so we have no room for other hash table or a set.

This patch inserts all symbols to other set, which violates the design decision. You need to come up with a different design to keep lld fast.

I wonder why wasm doesn't allow symbols with the same name. Non-external symbols are usually referenced not by name but by their indices, no? Symbol names for local symbols are mostly for debugging. No programs should refer them by name, at least in ELF.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40716





More information about the llvm-commits mailing list