Produce a single string table in a ELF .o
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 22 May 2015 23:58:30 +0000 (23:58 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 22 May 2015 23:58:30 +0000 (23:58 +0000)
commit7c4f3dcc5ef8dc639ace97a976d7854c49d6dd0c
treed59772fa548850a0a0cd468df8c8c0ae94ed13f0
parente00c0df2c427ed0a21362a4e3f6439557b488838
Produce a single string table in a ELF .o

Normally an ELF .o has two string tables, one for symbols, one for section
names.

With the scheme of naming sections like ".text.foo" where foo is a symbol,
there is a big potential saving in using a single one.

Building llvm+clang+lld with master and with this patch the results were:

master:                          193,267,008 bytes
patch:                           186,107,952 bytes
master non unique section names: 183,260,192 bytes
patch non unique section names:  183,118,632 bytes

So using non usique saves 10,006,816 bytes, and the patch saves 7,159,056 while
still using distinct names for the sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238073 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/ELFObjectWriter.cpp
test/MC/ELF/empty.s
test/MC/ELF/strtab-suffix-opt.s