mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 00:46:45 +08:00
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
This commit is contained in:
@@ -889,10 +889,9 @@ void LinkerScript::adjustSectionsBeforeSorting() {
|
||||
Sec->Alignment =
|
||||
std::max<uint32_t>(Sec->Alignment, Sec->AlignExpr().getValue());
|
||||
|
||||
// A live output section means that some input section was added to it. It
|
||||
// might have been removed (if it was empty synthetic section), but we at
|
||||
// least know the flags.
|
||||
if (Sec->isLive())
|
||||
// The input section might have been removed (if it was an empty synthetic
|
||||
// section), but we at least know the flags.
|
||||
if (Sec->HasInputSections)
|
||||
Flags = Sec->Flags;
|
||||
|
||||
// We do not want to keep any special flags for output section
|
||||
|
||||
Reference in New Issue
Block a user