ELF: Introduce a separate bit for tracking whether an output section has ever had...
authorPeter Collingbourne <peter@pcc.me.uk>
Mon, 3 Jun 2019 20:14:25 +0000 (20:14 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Mon, 3 Jun 2019 20:14:25 +0000 (20:14 +0000)
commit06f3b094e4ad2624d8376e4312eebbc5214faf94
tree663b0e8ffd981d7860bbe7c59c44d5d17bc26d21
parentdd0adae65a705c1aec085217b99b51f33b05d1d3
ELF: Introduce a separate bit for tracking whether an output section has ever had an input section added to it. NFCI.

We currently (ab)use the Live bit on output sections to track whether
the section has ever had an input section added to it, and then later
use it during orphan placement. This will conflict with one of my upcoming
partition-related changes that will assign all output sections to a partition
(thus marking them as live) so that they can be added to the correct segment
by the code that creates program headers.

Instead of using the Live bit for this purpose, create a new flag and
start using it to track the property explicitly.

Differential Revision: https://reviews.llvm.org/D62348

llvm-svn: 362444
lld/ELF/LinkerScript.cpp
lld/ELF/OutputSections.cpp
lld/ELF/OutputSections.h
lld/ELF/Writer.cpp