diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2019-06-03 20:14:25 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-06-03 20:14:25 +0000 |
| commit | 06f3b094e4ad2624d8376e4312eebbc5214faf94 (patch) | |
| tree | 663b0e8ffd981d7860bbe7c59c44d5d17bc26d21 /lld/ELF/OutputSections.cpp | |
| parent | dd0adae65a705c1aec085217b99b51f33b05d1d3 (diff) | |
| download | bcm5719-llvm-06f3b094e4ad2624d8376e4312eebbc5214faf94.tar.gz bcm5719-llvm-06f3b094e4ad2624d8376e4312eebbc5214faf94.zip | |
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
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 8927b69a64a..8048609565e 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -84,9 +84,10 @@ static bool canMergeToProgbits(unsigned Type) { } void OutputSection::addSection(InputSection *IS) { - if (!isLive()) { + if (!HasInputSections) { // If IS is the first section to be added to this section, // initialize Partition, Type, Entsize and flags from IS. + HasInputSections = true; Partition = IS->Partition; Type = IS->Type; Entsize = IS->Entsize; |

