Skip to content

Commit d69cc05

Browse files
committed
[ELF] Migrate away from global ctx
1 parent 2de1e06 commit d69cc05

File tree

11 files changed

+54
-51
lines changed

11 files changed

+54
-51
lines changed

lld/ELF/Arch/AArch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ void AArch64BtiPac::writePlt(uint8_t *buf, const Symbol &sym,
11071107

11081108
template <class ELFT>
11091109
static void
1110-
addTaggedSymbolReferences(InputSectionBase &sec,
1110+
addTaggedSymbolReferences(Ctx &ctx, InputSectionBase &sec,
11111111
DenseMap<Symbol *, unsigned> &referenceCount) {
11121112
assert(sec.type == SHT_AARCH64_MEMTAG_GLOBALS_STATIC);
11131113

@@ -1163,7 +1163,7 @@ void elf::createTaggedSymbols(Ctx &ctx) {
11631163
if (!section || section->type != SHT_AARCH64_MEMTAG_GLOBALS_STATIC ||
11641164
section == &InputSection::discarded)
11651165
continue;
1166-
invokeELFT(addTaggedSymbolReferences, *section,
1166+
invokeELFT(addTaggedSymbolReferences, ctx, *section,
11671167
taggedSymbolReferenceCount);
11681168
}
11691169
}

lld/ELF/Arch/Hexagon.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,16 @@ static bool isDuplex(uint32_t insn) {
190190
return (instParsePacketEnd & insn) == 0;
191191
}
192192

193-
static uint32_t findMaskR6(uint32_t insn) {
193+
static uint32_t findMaskR6(Ctx &ctx, uint32_t insn) {
194194
if (isDuplex(insn))
195195
return 0x03f00000;
196196

197197
for (InstructionMask i : r6)
198198
if ((0xff000000 & insn) == i.cmpMask)
199199
return i.relocMask;
200200

201-
ErrAlways(ctx) << "unrecognized instruction for 6_X relocation: 0x"
202-
<< utohexstr(insn);
201+
Err(ctx) << "unrecognized instruction for 6_X relocation: 0x"
202+
<< utohexstr(insn);
203203
return 0;
204204
}
205205

@@ -217,7 +217,7 @@ static uint32_t findMaskR11(uint32_t insn) {
217217
return 0x06003fe0;
218218
}
219219

220-
static uint32_t findMaskR16(uint32_t insn) {
220+
static uint32_t findMaskR16(Ctx &ctx, uint32_t insn) {
221221
if (isDuplex(insn))
222222
return 0x03f00000;
223223

@@ -246,8 +246,7 @@ static uint32_t findMaskR16(uint32_t insn) {
246246
if ((0xff000000 & insn) == i.cmpMask)
247247
return i.relocMask;
248248

249-
ErrAlways(ctx) << "unrecognized instruction for 16_X type: 0x"
250-
<< utohexstr(insn);
249+
Err(ctx) << "unrecognized instruction for 16_X type: 0x" << utohexstr(insn);
251250
return 0;
252251
}
253252

@@ -260,7 +259,7 @@ void Hexagon::relocate(uint8_t *loc, const Relocation &rel,
260259
break;
261260
case R_HEX_6_PCREL_X:
262261
case R_HEX_6_X:
263-
or32le(loc, applyMask(findMaskR6(read32le(loc)), val));
262+
or32le(loc, applyMask(findMaskR6(ctx, read32le(loc)), val));
264263
break;
265264
case R_HEX_8_X:
266265
or32le(loc, applyMask(findMaskR8(read32le(loc)), val));
@@ -289,10 +288,10 @@ void Hexagon::relocate(uint8_t *loc, const Relocation &rel,
289288
case R_HEX_GOT_16_X:
290289
case R_HEX_GOTREL_16_X:
291290
case R_HEX_TPREL_16_X:
292-
or32le(loc, applyMask(findMaskR16(read32le(loc)), val & 0x3f));
291+
or32le(loc, applyMask(findMaskR16(ctx, read32le(loc)), val & 0x3f));
293292
break;
294293
case R_HEX_TPREL_16:
295-
or32le(loc, applyMask(findMaskR16(read32le(loc)), val & 0xffff));
294+
or32le(loc, applyMask(findMaskR16(ctx, read32le(loc)), val & 0xffff));
296295
break;
297296
case R_HEX_32:
298297
case R_HEX_32_PCREL:

lld/ELF/Arch/PPC64.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ uint64_t elf::getPPC64TocBase(Ctx &ctx) {
219219
return tocVA + ppc64TocOffset;
220220
}
221221

222-
unsigned elf::getPPC64GlobalEntryToLocalEntryOffset(uint8_t stOther) {
222+
unsigned elf::getPPC64GlobalEntryToLocalEntryOffset(Ctx &ctx, uint8_t stOther) {
223223
// The offset is encoded into the 3 most significant bits of the st_other
224224
// field, with some special values described in section 3.4.1 of the ABI:
225225
// 0 --> Zero offset between the GEP and LEP, and the function does NOT use
@@ -1455,9 +1455,9 @@ bool PPC64::needsThunk(RelExpr expr, RelType type, const InputFile *file,
14551455
// If the offset exceeds the range of the branch type then it will need
14561456
// a range-extending thunk.
14571457
// See the comment in getRelocTargetVA() about R_PPC64_CALL.
1458-
return !inBranchRange(type, branchAddr,
1459-
s.getVA(ctx, a) +
1460-
getPPC64GlobalEntryToLocalEntryOffset(s.stOther));
1458+
return !inBranchRange(
1459+
type, branchAddr,
1460+
s.getVA(ctx, a) + getPPC64GlobalEntryToLocalEntryOffset(ctx, s.stOther));
14611461
}
14621462

14631463
uint32_t PPC64::getThunkSectionSpacing() const {
@@ -1678,7 +1678,7 @@ bool PPC64::adjustPrologueForCrossSplitStack(uint8_t *loc, uint8_t *end,
16781678
uint8_t stOther) const {
16791679
// If the caller has a global entry point adjust the buffer past it. The start
16801680
// of the split-stack prologue will be at the local entry point.
1681-
loc += getPPC64GlobalEntryToLocalEntryOffset(stOther);
1681+
loc += getPPC64GlobalEntryToLocalEntryOffset(ctx, stOther);
16821682

16831683
// At the very least we expect to see a load of some split-stack data from the
16841684
// tcb, and 2 instructions that calculate the ending stack address this

lld/ELF/Arch/RISCV.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ class RISCVAttributesSection final : public SyntheticSection {
10591059
};
10601060
} // namespace
10611061

1062-
static void mergeArch(RISCVISAUtils::OrderedExtensionMap &mergedExts,
1062+
static void mergeArch(Ctx &ctx, RISCVISAUtils::OrderedExtensionMap &mergedExts,
10631063
unsigned &mergedXlen, const InputSectionBase *sec,
10641064
StringRef s) {
10651065
auto maybeInfo = RISCVISAInfo::parseNormalizedArchString(s);
@@ -1086,7 +1086,7 @@ static void mergeArch(RISCVISAUtils::OrderedExtensionMap &mergedExts,
10861086
}
10871087
}
10881088

1089-
static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it,
1089+
static void mergeAtomic(Ctx &ctx, DenseMap<unsigned, unsigned>::iterator it,
10901090
const InputSectionBase *oldSection,
10911091
const InputSectionBase *newSection,
10921092
RISCVAttrs::RISCVAtomicAbiTag oldTag,
@@ -1104,8 +1104,8 @@ static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it,
11041104
<< ": atomic_abi=" << Twine(static_cast<unsigned>(newTag));
11051105
};
11061106

1107-
auto reportUnknownAbiError = [](const InputSectionBase *section,
1108-
RISCVAtomicAbiTag tag) {
1107+
auto reportUnknownAbiError = [&](const InputSectionBase *section,
1108+
RISCVAtomicAbiTag tag) {
11091109
switch (tag) {
11101110
case RISCVAtomicAbiTag::UNKNOWN:
11111111
case RISCVAtomicAbiTag::A6C:
@@ -1214,7 +1214,7 @@ mergeAttributesSection(Ctx &ctx,
12141214
case RISCVAttrs::ARCH:
12151215
if (auto s = parser.getAttributeString(tag.attr)) {
12161216
hasArch = true;
1217-
mergeArch(exts, xlen, sec, *s);
1217+
mergeArch(ctx, exts, xlen, sec, *s);
12181218
}
12191219
continue;
12201220

@@ -1230,7 +1230,7 @@ mergeAttributesSection(Ctx &ctx,
12301230
if (r.second)
12311231
firstAtomicAbi = sec;
12321232
else
1233-
mergeAtomic(r.first, firstAtomicAbi, sec,
1233+
mergeAtomic(ctx, r.first, firstAtomicAbi, sec,
12341234
static_cast<RISCVAtomicAbiTag>(r.first->getSecond()),
12351235
static_cast<RISCVAtomicAbiTag>(*i));
12361236
}

lld/ELF/Driver.cpp

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ bool link(ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS,
197197
} // namespace lld
198198

199199
// Parses a linker -m option.
200-
static std::tuple<ELFKind, uint16_t, uint8_t> parseEmulation(StringRef emul) {
200+
static std::tuple<ELFKind, uint16_t, uint8_t> parseEmulation(Ctx &ctx,
201+
StringRef emul) {
201202
uint8_t osabi = 0;
202203
StringRef s = emul;
203204
if (s.ends_with("_fbsd")) {
@@ -578,7 +579,7 @@ static GnuStackKind getZGnuStack(opt::InputArgList &args) {
578579
return ret;
579580
}
580581

581-
static uint8_t getZStartStopVisibility(opt::InputArgList &args) {
582+
static uint8_t getZStartStopVisibility(Ctx &ctx, opt::InputArgList &args) {
582583
uint8_t ret = STV_PROTECTED;
583584
for (auto *arg : args.filtered(OPT_z)) {
584585
std::pair<StringRef, StringRef> kv = StringRef(arg->getValue()).split('=');
@@ -1556,7 +1557,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
15561557
ctx.arg.zStackSize = args::getZOptionValue(args, OPT_z, "stack-size", 0);
15571558
ctx.arg.zStartStopGC =
15581559
getZFlag(args, "start-stop-gc", "nostart-stop-gc", true);
1559-
ctx.arg.zStartStopVisibility = getZStartStopVisibility(args);
1560+
ctx.arg.zStartStopVisibility = getZStartStopVisibility(ctx, args);
15601561
ctx.arg.zText = getZFlag(args, "text", "notext", true);
15611562
ctx.arg.zWxneeded = hasZOption(args, "wxneeded");
15621563
setUnresolvedSymbolPolicy(ctx, args);
@@ -1759,7 +1760,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
17591760
if (auto *arg = args.getLastArg(OPT_m)) {
17601761
StringRef s = arg->getValue();
17611762
std::tie(ctx.arg.ekind, ctx.arg.emachine, ctx.arg.osabi) =
1762-
parseEmulation(s);
1763+
parseEmulation(ctx, s);
17631764
ctx.arg.mipsN32Abi =
17641765
(s.starts_with("elf32btsmipn32") || s.starts_with("elf32ltsmipn32"));
17651766
ctx.arg.emulation = s;
@@ -2756,17 +2757,19 @@ static void redirectSymbols(Ctx &ctx, ArrayRef<WrappedSymbol> wrapped) {
27562757
ctx.symtab->wrap(w.sym, w.real, w.wrap);
27572758
}
27582759

2759-
static void reportMissingFeature(StringRef config, const Twine &report) {
2760+
static void reportMissingFeature(Ctx &ctx, StringRef config,
2761+
const Twine &report) {
27602762
if (config == "error")
27612763
ErrAlways(ctx) << report;
27622764
else if (config == "warning")
27632765
Warn(ctx) << report;
27642766
}
27652767

2766-
static void checkAndReportMissingFeature(StringRef config, uint32_t features,
2767-
uint32_t mask, const Twine &report) {
2768+
static void checkAndReportMissingFeature(Ctx &ctx, StringRef config,
2769+
uint32_t features, uint32_t mask,
2770+
const Twine &report) {
27682771
if (!(features & mask))
2769-
reportMissingFeature(config, report);
2772+
reportMissingFeature(ctx, config, report);
27702773
}
27712774

27722775
// To enable CET (x86's hardware-assisted control flow enforcement), each
@@ -2805,22 +2808,22 @@ static void readSecurityNotes(Ctx &ctx) {
28052808
uint32_t features = f->andFeatures;
28062809

28072810
checkAndReportMissingFeature(
2808-
ctx.arg.zBtiReport, features, GNU_PROPERTY_AARCH64_FEATURE_1_BTI,
2811+
ctx, ctx.arg.zBtiReport, features, GNU_PROPERTY_AARCH64_FEATURE_1_BTI,
28092812
toString(f) + ": -z bti-report: file does not have "
28102813
"GNU_PROPERTY_AARCH64_FEATURE_1_BTI property");
28112814

28122815
checkAndReportMissingFeature(
2813-
ctx.arg.zGcsReport, features, GNU_PROPERTY_AARCH64_FEATURE_1_GCS,
2816+
ctx, ctx.arg.zGcsReport, features, GNU_PROPERTY_AARCH64_FEATURE_1_GCS,
28142817
toString(f) + ": -z gcs-report: file does not have "
28152818
"GNU_PROPERTY_AARCH64_FEATURE_1_GCS property");
28162819

28172820
checkAndReportMissingFeature(
2818-
ctx.arg.zCetReport, features, GNU_PROPERTY_X86_FEATURE_1_IBT,
2821+
ctx, ctx.arg.zCetReport, features, GNU_PROPERTY_X86_FEATURE_1_IBT,
28192822
toString(f) + ": -z cet-report: file does not have "
28202823
"GNU_PROPERTY_X86_FEATURE_1_IBT property");
28212824

28222825
checkAndReportMissingFeature(
2823-
ctx.arg.zCetReport, features, GNU_PROPERTY_X86_FEATURE_1_SHSTK,
2826+
ctx, ctx.arg.zCetReport, features, GNU_PROPERTY_X86_FEATURE_1_SHSTK,
28242827
toString(f) + ": -z cet-report: file does not have "
28252828
"GNU_PROPERTY_X86_FEATURE_1_SHSTK property");
28262829

@@ -2852,7 +2855,7 @@ static void readSecurityNotes(Ctx &ctx) {
28522855
continue;
28532856

28542857
if (f->aarch64PauthAbiCoreInfo.empty()) {
2855-
reportMissingFeature(ctx.arg.zPauthReport,
2858+
reportMissingFeature(ctx, ctx.arg.zPauthReport,
28562859
toString(f) +
28572860
": -z pauth-report: file does not have AArch64 "
28582861
"PAuth core info while '" +

lld/ELF/InputSection.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ size_t InputSectionBase::getSize() const {
113113
}
114114

115115
template <class ELFT>
116-
static void decompressAux(const InputSectionBase &sec, uint8_t *out,
116+
static void decompressAux(Ctx &ctx, const InputSectionBase &sec, uint8_t *out,
117117
size_t size) {
118118
auto *hdr = reinterpret_cast<const typename ELFT::Chdr *>(sec.content_);
119119
auto compressed = ArrayRef<uint8_t>(sec.content_, sec.compressedSize)
@@ -134,7 +134,7 @@ void InputSectionBase::decompress() const {
134134
uncompressedBuf = bAlloc().Allocate<uint8_t>(size);
135135
}
136136

137-
invokeELFT(decompressAux, *this, uncompressedBuf, size);
137+
invokeELFT(decompressAux, ctx, *this, uncompressedBuf, size);
138138
content_ = uncompressedBuf;
139139
compressed = false;
140140
}
@@ -914,7 +914,8 @@ uint64_t InputSectionBase::getRelocTargetVA(Ctx &ctx, const Relocation &r,
914914
// the callee. For local calls the caller and callee share the same
915915
// TOC base and so the TOC pointer initialization code should be skipped by
916916
// branching to the local entry point.
917-
return symVA - p + getPPC64GlobalEntryToLocalEntryOffset(r.sym->stOther);
917+
return symVA - p +
918+
getPPC64GlobalEntryToLocalEntryOffset(ctx, r.sym->stOther);
918919
}
919920
case R_PPC64_TOCBASE:
920921
return getPPC64TocBase(ctx) + a;

lld/ELF/SyntheticSections.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,13 +2856,12 @@ readEntry(uint64_t &offset, const DWARFDebugNames::NameIndex &ni,
28562856
}
28572857

28582858
void DebugNamesBaseSection::parseDebugNames(
2859-
InputChunk &inputChunk, OutputChunk &chunk,
2859+
Ctx &ctx, InputChunk &inputChunk, OutputChunk &chunk,
28602860
DWARFDataExtractor &namesExtractor, DataExtractor &strExtractor,
28612861
function_ref<SmallVector<uint32_t, 0>(
28622862
uint32_t numCus, const DWARFDebugNames::Header &,
28632863
const DWARFDebugNames::DWARFDebugNamesOffsets &)>
28642864
readOffsets) {
2865-
Ctx &ctx = elf::ctx;
28662865
const LLDDWARFSection &namesSec = inputChunk.section;
28672866
DenseMap<uint32_t, IndexEntry *> offsetMap;
28682867
// Number of CUs seen in previous NameIndex sections within current chunk.
@@ -3216,7 +3215,7 @@ DebugNamesSection<ELFT>::DebugNamesSection(Ctx &ctx)
32163215
Err(ctx) << dobj.getNamesSection().sec << Twine(": ") << std::move(e);
32173216
}
32183217
parseDebugNames(
3219-
inputChunk, chunk, namesExtractor, strExtractor,
3218+
ctx, inputChunk, chunk, namesExtractor, strExtractor,
32203219
[&chunk, namesData = dobj.getNamesSection().Data.data()](
32213220
uint32_t numCus, const DWARFDebugNames::Header &hdr,
32223221
const DWARFDebugNames::DWARFDebugNamesOffsets &locs) {
@@ -3376,7 +3375,7 @@ readCuList(DWARFContext &dwarf) {
33763375
}
33773376

33783377
static SmallVector<GdbIndexSection::AddressEntry, 0>
3379-
readAddressAreas(DWARFContext &dwarf, InputSection *sec) {
3378+
readAddressAreas(Ctx &ctx, DWARFContext &dwarf, InputSection *sec) {
33803379
SmallVector<GdbIndexSection::AddressEntry, 0> ret;
33813380

33823381
uint32_t cuIdx = 0;
@@ -3564,7 +3563,7 @@ std::unique_ptr<GdbIndexSection> GdbIndexSection::create(Ctx &ctx) {
35643563
// this only picks the last one. Other address ranges are lost.
35653564
chunks[i].sec = dobj.getInfoSection();
35663565
chunks[i].compilationUnits = readCuList(dwarf);
3567-
chunks[i].addressAreas = readAddressAreas(dwarf, chunks[i].sec);
3566+
chunks[i].addressAreas = readAddressAreas(ctx, dwarf, chunks[i].sec);
35683567
nameAttrs[i] =
35693568
readPubNamesAndTypes<ELFT>(ctx, dobj, chunks[i].compilationUnits);
35703569
});
@@ -4366,7 +4365,7 @@ void PPC64LongBranchTargetSection::writeTo(uint8_t *buf) {
43664365
// must be a local-call.
43674366
write64(ctx, buf,
43684367
sym->getVA(ctx, addend) +
4369-
getPPC64GlobalEntryToLocalEntryOffset(sym->stOther));
4368+
getPPC64GlobalEntryToLocalEntryOffset(ctx, sym->stOther));
43704369
buf += 8;
43714370
}
43724371
}

lld/ELF/SyntheticSections.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ class DebugNamesBaseSection : public SyntheticSection {
871871
protected:
872872
void init(llvm::function_ref<void(InputFile *, InputChunk &, OutputChunk &)>);
873873
static void
874-
parseDebugNames(InputChunk &inputChunk, OutputChunk &chunk,
874+
parseDebugNames(Ctx &, InputChunk &inputChunk, OutputChunk &chunk,
875875
llvm::DWARFDataExtractor &namesExtractor,
876876
llvm::DataExtractor &strExtractor,
877877
llvm::function_ref<SmallVector<uint32_t, 0>(

lld/ELF/Target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ unsigned getPPCDSFormOp(unsigned secondaryOp);
229229
// offset between GEP and LEP is encoded in a function's st_other flags.
230230
// This function will return the offset (in bytes) from the global entry-point
231231
// to the local entry-point.
232-
unsigned getPPC64GlobalEntryToLocalEntryOffset(uint8_t stOther);
232+
unsigned getPPC64GlobalEntryToLocalEntryOffset(Ctx &, uint8_t stOther);
233233

234234
// Write a prefixed instruction, which is a 4-byte prefix followed by a 4-byte
235235
// instruction (regardless of endianness). Therefore, the prefix is always in

lld/ELF/Thunks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ class PPC64PILongBranchThunk final : public PPC64LongBranchThunk {
519519
ctx.mainPart->relaDyn->addRelativeReloc(
520520
ctx.target->relativeRel, *ctx.in.ppc64LongBranchTarget,
521521
*index * UINT64_C(8), dest,
522-
addend + getPPC64GlobalEntryToLocalEntryOffset(dest.stOther),
522+
addend + getPPC64GlobalEntryToLocalEntryOffset(ctx, dest.stOther),
523523
ctx.target->symbolicRel, R_ABS);
524524
}
525525
}

lld/ELF/Writer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2625,7 +2625,8 @@ struct SectionOffset {
26252625

26262626
// Check whether sections overlap for a specific address range (file offsets,
26272627
// load and virtual addresses).
2628-
static void checkOverlap(StringRef name, std::vector<SectionOffset> &sections,
2628+
static void checkOverlap(Ctx &ctx, StringRef name,
2629+
std::vector<SectionOffset> &sections,
26292630
bool isVirtualAddr) {
26302631
llvm::sort(sections, [=](const SectionOffset &a, const SectionOffset &b) {
26312632
return a.offset < b.offset;
@@ -2676,7 +2677,7 @@ template <class ELFT> void Writer<ELFT>::checkSections() {
26762677
if (sec->size > 0 && sec->type != SHT_NOBITS &&
26772678
(!ctx.arg.oFormatBinary || (sec->flags & SHF_ALLOC)))
26782679
fileOffs.push_back({sec, sec->offset});
2679-
checkOverlap("file", fileOffs, false);
2680+
checkOverlap(ctx, "file", fileOffs, false);
26802681

26812682
// When linking with -r there is no need to check for overlapping virtual/load
26822683
// addresses since those addresses will only be assigned when the final
@@ -2693,7 +2694,7 @@ template <class ELFT> void Writer<ELFT>::checkSections() {
26932694
for (OutputSection *sec : ctx.outputSections)
26942695
if (sec->size > 0 && (sec->flags & SHF_ALLOC) && !(sec->flags & SHF_TLS))
26952696
vmas.push_back({sec, sec->addr});
2696-
checkOverlap("virtual address", vmas, true);
2697+
checkOverlap(ctx, "virtual address", vmas, true);
26972698

26982699
// Finally, check that the load addresses don't overlap. This will usually be
26992700
// the same as the virtual addresses but can be different when using a linker
@@ -2702,7 +2703,7 @@ template <class ELFT> void Writer<ELFT>::checkSections() {
27022703
for (OutputSection *sec : ctx.outputSections)
27032704
if (sec->size > 0 && (sec->flags & SHF_ALLOC) && !(sec->flags & SHF_TLS))
27042705
lmas.push_back({sec, sec->getLMA()});
2705-
checkOverlap("load address", lmas, false);
2706+
checkOverlap(ctx, "load address", lmas, false);
27062707
}
27072708

27082709
// The entry point address is chosen in the following ways.

0 commit comments

Comments
 (0)