ELFObjectWriter: deduplicate suffices in strtab
authorHans Wennborg <hans@hanshq.net>
Wed, 30 Apr 2014 16:25:02 +0000 (16:25 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 30 Apr 2014 16:25:02 +0000 (16:25 +0000)
commita8febf2283921157da1539c079cd74a55bf89a5a
tree9d35112077dfea406ecb273ab0ea1ee2e99292e1
parentb1c1b8a78dce82d3740316ddf94029696ba68674
ELFObjectWriter: deduplicate suffices in strtab

We already do this for shstrtab, so might as well do it for strtab. This
extracts the string table building code into a separate class. The idea
is to use it for other object formats too.

I mostly wanted to do this for the general principle, but it does save a
little bit on object file size. I tried this on a clang bootstrap and
saved 0.54% on the sum of object file sizes (1.14 MB out of 212 MB for
a release build).

Differential Revision: http://reviews.llvm.org/D3533

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207670 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/llvm/Object/StringTableBuilder.h [new file with mode: 0644]
lib/MC/ELFObjectWriter.cpp
lib/Object/CMakeLists.txt
lib/Object/StringTableBuilder.cpp [new file with mode: 0644]
test/MC/AArch64/tls-relocs.s
test/MC/ARM64/tls-relocs.s
test/MC/ELF/comdat.s
test/MC/ELF/common.s
test/MC/ELF/file-double.s
test/MC/ELF/lcomm.s
test/MC/ELF/many-sections-2.s
test/MC/ELF/pic-diff.s
test/MC/ELF/pr9292.s
test/MC/ELF/set.s
test/MC/ELF/strtab-suffix-opt.s [new file with mode: 0644]
test/MC/ELF/tls-i386.s
test/MC/ELF/tls.s
test/MC/ELF/type.s
test/MC/ELF/weakref.s
tools/yaml2obj/yaml2elf.cpp
unittests/Object/CMakeLists.txt
unittests/Object/StringTableBuilderTest.cpp [new file with mode: 0644]