Don't create multiple mergeable sections with -fdata-sections.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 29 Jan 2015 12:43:28 +0000 (12:43 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 29 Jan 2015 12:43:28 +0000 (12:43 +0000)
commit6cc11194080c1790b33e8ae84d7a6006d806b463
tree74f197c1050c0aaeb0f85449cf664223593ffbf7
parentd0fb85865ad6e6bf91d13e336a45e2116c19d944
Don't create multiple mergeable sections with -fdata-sections.

ELF has support for sections that can be split into fixed size or
null terminated entities.

Since these sections can be split by the linker, it is not necessary
to split them in codegen.

This reduces the combined .o size in a llvm+clang build from
202,394,570 to 173,819,098 bytes.

The time for linking clang with gold (on a VM, on a laptop) goes
from 2.250089985 to 1.383001792 seconds.

The flip side is the size of rodata in clang goes from 10,926,785
to 10,929,345 bytes.

The increase seems to be because of http://sourceware.org/bugzilla/show_bug.cgi?id=17902.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227431 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
test/CodeGen/X86/global-sections.ll