Do not use StringTableBuilder to build symbol table for .gdb_index.
authorRui Ueyama <ruiu@google.com>
Mon, 25 Sep 2017 02:29:51 +0000 (02:29 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 25 Sep 2017 02:29:51 +0000 (02:29 +0000)
commitbbc477c9b6cfebc2d410db14f8ee5a096863ec9d
tree7ce7be33c6be0da9fd6d43985bca836848a13e0e
parent22125d8c84ec5111828a8d3183bdb4ede5dbc58e
Do not use StringTableBuilder to build symbol table for .gdb_index.

Previously, we had two levels of hash table lookup. The first hash
lookup uses CachedHashStringRefs as keys and returns offsets in string
table. Then, we did the second hash table lookup to obtain GdbSymbol
pointers. But we can directly map strings to GDbSymbols.

One test file is updated in this patch because we no longer have a '\0'
byte at the start of the string pool, which was automatically inserted
by StringTableBuilder.

This patch speeds up Clang debug build (with -gdb-index) link time by
0.3 seconds.

llvm-svn: 314092
lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h
lld/test/ELF/gdb-index.s