diff options
author | Fangrui Song <maskray@google.com> | 2019-07-03 10:03:49 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-07-03 10:03:49 +0000 |
commit | 347692e2dedb516b9a61524b1679eb21505ef0df (patch) | |
tree | e273a70130e9a75c753f110b9502af98a1d79e8b /llvm/lib/Bitcode | |
parent | 830b20344bdd3f8790bb913b9e699a3fa5f446f6 (diff) | |
download | llvm-347692e2dedb516b9a61524b1679eb21505ef0df.zip llvm-347692e2dedb516b9a61524b1679eb21505ef0df.tar.gz llvm-347692e2dedb516b9a61524b1679eb21505ef0df.tar.bz2 |
[ELF] Allow placing SHF_MERGE sections with different alignments into the same MergeSyntheticSection
This should fix PR42289: the Linux kernel has a use case that input
files have .rodata.cst32 sections with different alignments. The
expectation (and what ld.bfd and gold do) is that in the -r link, there
is only one .rodata.cst32 (SHF_MERGE sections with different alignments
can be combined), but lld currently creates one for each different
alignment.
The current merging strategy:
1) Group SHF_MERGE sections by (name, sh_flags, sh_entsize and
sh_addralign). String merging is performed among a group, even if -O0 is specified.
2) Create one output section for each group. This is a special case in
addInputSec().
This patch changes 1) to:
1) Group SHF_MERGE sections by (name, sh_flags, sh_entsize).
String merging is performed among a group, even if -O0 is specified.
We will thus create just one .rodata.cst32 . This also improves merging
efficiency when sections with the same name but different alignments are
combined.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D63432
llvm-svn: 365015
Diffstat (limited to 'llvm/lib/Bitcode')
0 files changed, 0 insertions, 0 deletions