[PATCH] D114228: [ELF][NFC] Do not pass region name to expandMemoryRegion()
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 19 01:57:27 PST 2021
ikudrin created this revision.
ikudrin added a reviewer: MaskRay.
ikudrin added a project: lld.
Herald added subscribers: arichardson, emaste.
ikudrin requested review of this revision.
Herald added a project: LLVM.
The name can be easily got on-site.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D114228
Files:
lld/ELF/LinkerScript.cpp
Index: lld/ELF/LinkerScript.cpp
===================================================================
--- lld/ELF/LinkerScript.cpp
+++ lld/ELF/LinkerScript.cpp
@@ -102,23 +102,22 @@
// Expands the memory region by the specified size.
static void expandMemoryRegion(MemoryRegion *memRegion, uint64_t size,
- StringRef regionName, StringRef secName) {
+ StringRef secName) {
memRegion->curPos += size;
uint64_t newSize = memRegion->curPos - (memRegion->origin)().getValue();
uint64_t length = (memRegion->length)().getValue();
if (newSize > length)
- error("section '" + secName + "' will not fit in region '" + regionName +
- "': overflowed by " + Twine(newSize - length) + " bytes");
+ error("section '" + secName + "' will not fit in region '" +
+ memRegion->name + "': overflowed by " + Twine(newSize - length) +
+ " bytes");
}
void LinkerScript::expandMemoryRegions(uint64_t size) {
if (ctx->memRegion)
- expandMemoryRegion(ctx->memRegion, size, ctx->memRegion->name,
- ctx->outSec->name);
+ expandMemoryRegion(ctx->memRegion, size, ctx->outSec->name);
// 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);
+ expandMemoryRegion(ctx->lmaRegion, size, ctx->outSec->name);
}
void LinkerScript::expandOutputSection(uint64_t size) {
@@ -965,7 +964,7 @@
// between the previous section, if any, and the start of this section.
if (ctx->memRegion && ctx->memRegion->curPos < dot)
expandMemoryRegion(ctx->memRegion, dot - ctx->memRegion->curPos,
- ctx->memRegion->name, sec->name);
+ sec->name);
}
switchTo(sec);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114228.388427.patch
Type: text/x-patch
Size: 1913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211119/3e8e51f9/attachment.bin>
More information about the llvm-commits
mailing list