mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 01:58:44 +08:00
Revert "[ELF] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD"
This reverts commit 030ddc0a0b.
This breaks http://lab.llvm.org:8011/builders/lldb-arm-ubuntu
and http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu
Differential Revision: https://reviews.llvm.org/D85100
This commit is contained in:
@@ -586,8 +586,6 @@ static OutputSection *findByName(ArrayRef<BaseCommand *> vec,
|
||||
static OutputSection *createSection(InputSectionBase *isec,
|
||||
StringRef outsecName) {
|
||||
OutputSection *sec = script->createOutputSection(outsecName, "<internal>");
|
||||
if (!(isec->flags & SHF_ALLOC))
|
||||
sec->addrExpr = [] { return 0; };
|
||||
sec->recordSection(isec);
|
||||
return sec;
|
||||
}
|
||||
@@ -850,6 +848,9 @@ static OutputSection *findFirstSection(PhdrEntry *load) {
|
||||
// This function assigns offsets to input sections and an output section
|
||||
// for a single sections command (e.g. ".text { *(.text); }").
|
||||
void LinkerScript::assignOffsets(OutputSection *sec) {
|
||||
if (!(sec->flags & SHF_ALLOC))
|
||||
dot = 0;
|
||||
|
||||
const bool sameMemRegion = ctx->memRegion == sec->memRegion;
|
||||
const bool prevLMARegionIsDefault = ctx->lmaRegion == nullptr;
|
||||
ctx->memRegion = sec->memRegion;
|
||||
@@ -857,7 +858,7 @@ void LinkerScript::assignOffsets(OutputSection *sec) {
|
||||
if (ctx->memRegion)
|
||||
dot = ctx->memRegion->curPos;
|
||||
|
||||
if (sec->addrExpr)
|
||||
if ((sec->flags & SHF_ALLOC) && sec->addrExpr)
|
||||
setDot(sec->addrExpr, sec->location, false);
|
||||
|
||||
// If the address of the section has been moved forward by an explicit
|
||||
|
||||
Reference in New Issue
Block a user