summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/LinkerScript.cpp6
-rw-r--r--lld/ELF/LinkerScript.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index c7a8a056a84..f20dbff3f31 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -533,8 +533,7 @@ findSection(StringRef Name, const std::vector<OutputSection *> &Sections) {
// This function searches for a memory region to place the given output
// section in. If found, a pointer to the appropriate memory region is
// returned. Otherwise, a nullptr is returned.
-MemoryRegion *LinkerScript::findMemoryRegion(OutputSectionCommand *Cmd,
- OutputSection *Sec) {
+MemoryRegion *LinkerScript::findMemoryRegion(OutputSectionCommand *Cmd) {
// If a memory region name was specified in the output section command,
// then try to find that region first.
if (!Cmd->MemoryRegionName.empty()) {
@@ -551,6 +550,7 @@ MemoryRegion *LinkerScript::findMemoryRegion(OutputSectionCommand *Cmd,
if (Opt.MemoryRegions.empty())
return nullptr;
+ OutputSection *Sec = Cmd->Sec;
// See if a region can be found by matching section flags.
for (auto &Pair : Opt.MemoryRegions) {
MemoryRegion &M = Pair.second;
@@ -584,7 +584,7 @@ void LinkerScript::assignOffsets(OutputSectionCommand *Cmd) {
Sec->updateAlignment(Cmd->AlignExpr().getValue());
// Try and find an appropriate memory region to assign offsets in.
- CurMemRegion = findMemoryRegion(Cmd, Sec);
+ CurMemRegion = findMemoryRegion(Cmd);
if (CurMemRegion)
Dot = CurMemRegion->Offset;
switchTo(Sec);
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index e1fc3c43aee..f27eb651cda 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -224,7 +224,7 @@ protected:
std::vector<size_t> getPhdrIndices(StringRef SectionName);
size_t getPhdrIndex(const Twine &Loc, StringRef PhdrName);
- MemoryRegion *findMemoryRegion(OutputSectionCommand *Cmd, OutputSection *Sec);
+ MemoryRegion *findMemoryRegion(OutputSectionCommand *Cmd);
void switchTo(OutputSection *Sec);
void flush();
OpenPOWER on IntegriCloud