[PATCH] ELFObjectWriter: optimize suffices in strtab

Hans Wennborg hans at chromium.org
Mon Apr 28 18:03:32 PDT 2014


We already do this for shstrtab, so might as well do it for strtab. This extracts the code for this into a separate class. It might be overkill to have this in a separate file, but I figured maybe this is useful for other object formats and lld. If not, we can just move it into ELFObjectWriter.cpp.

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).

http://reviews.llvm.org/D3533

Files:
  include/llvm/ADT/StringTableBuilder.h
  lib/MC/ELFObjectWriter.cpp
  lib/Support/CMakeLists.txt
  lib/Support/StringTableBuilder.cpp
  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
  test/MC/ELF/symref.s
  test/MC/ELF/tls-i386.s
  test/MC/ELF/tls.s
  test/MC/ELF/type.s
  test/MC/ELF/weakref.s
  unittests/ADT/CMakeLists.txt
  unittests/ADT/StringTableBuilderTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3533.8900.patch
Type: text/x-patch
Size: 36463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140429/49bcaa16/attachment.bin>


More information about the llvm-commits mailing list