[llvm] r238073 - Produce a single string table in a ELF .o

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri May 22 17:29:48 PDT 2015


On 22 May 2015 at 20:28, Sean Silva <chisophugis at gmail.com> wrote:
>
>
> On Fri, May 22, 2015 at 4:58 PM, Rafael Espindola
> <rafael.espindola at gmail.com> wrote:
>>
>> Author: rafael
>> Date: Fri May 22 18:58:30 2015
>> New Revision: 238073
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=238073&view=rev
>> Log:
>> 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.
>
>
> When you show a measurement, it is vital to explain what is being measured.

Gah, I just noticed I stopped the sentence in the middle, thanks.

The measurement was of the total size of the .o files. I used

find . -name *.o | xargs wc -c | grep total | awk '{SUM+=$1} END {print SUM}'

Cheers,
Rafael



More information about the llvm-commits mailing list