mirror of
https://github.com/intel/llvm.git
synced 2026-02-02 02:00:03 +08:00
[LLD] Only increase LMARegion if different from MemRegion
Patch by Konstantin Schwarz! If both the MemRegion and LMARegion are set for an output section in a linker script, we should only increase the LMARegion if it is different from the MemRegion. Otherwise, we reserve the memory twice. Differential revision: https://reviews.llvm.org/D50065 llvm-svn: 338684
This commit is contained in:
@@ -116,7 +116,8 @@ void LinkerScript::expandMemoryRegions(uint64_t Size) {
|
||||
if (Ctx->MemRegion)
|
||||
expandMemoryRegion(Ctx->MemRegion, Size, Ctx->MemRegion->Name,
|
||||
Ctx->OutSec->Name);
|
||||
if (Ctx->LMARegion)
|
||||
// Only expand the LMARegion if it is different from MemRegion.
|
||||
if (Ctx->LMARegion && Ctx->MemRegion != Ctx->LMARegion)
|
||||
expandMemoryRegion(Ctx->LMARegion, Size, Ctx->LMARegion->Name,
|
||||
Ctx->OutSec->Name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user