Assume that mergeable input sections are smaller than 4 GiB.
authorRui Ueyama <ruiu@google.com>
Sat, 21 Oct 2017 23:20:13 +0000 (23:20 +0000)
committerRui Ueyama <ruiu@google.com>
Sat, 21 Oct 2017 23:20:13 +0000 (23:20 +0000)
commit95bf50987307333b10118907f5e781ab27b4f70c
tree9aa8a5d449870825889afb23474d1a7448d3e641
parent5b4f81ec14cd6d656514806f2a6b3b5e46d70103
Assume that mergeable input sections are smaller than 4 GiB.

By assuming that mergeable input sections are smaller than 4 GiB,
lld's memory usage when linking clang with debug info drops from
2.788 GiB to 2.019 GiB (measured by valgrind, and that does not include
memory space for mmap'ed files). I think that's a reasonable assumption
given such a large RAM savings, so this patch.

According to valgrind, gold needs 3.54 GiB of RAM to do the same thing.

NB: This patch does not introduce a limitation on the size of
output sections. You can still create sections larger than 4 GiB.

llvm-svn: 316280
lld/ELF/InputSection.cpp
lld/ELF/InputSection.h
lld/ELF/SyntheticSections.cpp