@@ -3946,7 +3946,7 @@ void MergeNoTailSection::finalizeContents() {
3946
3946
});
3947
3947
}
3948
3948
3949
- template <class ELFT> void elf::splitSections() {
3949
+ template <class ELFT> void elf::splitSections(Ctx &ctx ) {
3950
3950
llvm::TimeTraceScope timeScope("Split sections");
3951
3951
// splitIntoPieces needs to be called on each MergeInputSection
3952
3952
// before calling finalizeContents().
@@ -3962,7 +3962,7 @@ template <class ELFT> void elf::splitSections() {
3962
3962
});
3963
3963
}
3964
3964
3965
- void elf::combineEhSections() {
3965
+ void elf::combineEhSections(Ctx &ctx ) {
3966
3966
llvm::TimeTraceScope timeScope("Combine EH sections");
3967
3967
for (EhInputSection *sec : ctx.ehInputSections) {
3968
3968
EhFrameSection &eh = *sec->getPartition().ehFrame;
@@ -4495,7 +4495,7 @@ void InStruct::reset() {
4495
4495
symTabShndx.reset();
4496
4496
}
4497
4497
4498
- static bool needsInterpSection() {
4498
+ static bool needsInterpSection(Ctx &ctx ) {
4499
4499
return !ctx.arg.relocatable && !ctx.arg.shared &&
4500
4500
!ctx.arg.dynamicLinker.empty() && ctx.script->needsInterpSection();
4501
4501
}
@@ -4513,7 +4513,7 @@ bool elf::hasMemtag() {
4513
4513
// that ifuncs use in fully static executables.
4514
4514
bool elf::canHaveMemtagGlobals() {
4515
4515
return hasMemtag() &&
4516
- (ctx.arg.relocatable || ctx.arg.shared || needsInterpSection());
4516
+ (ctx.arg.relocatable || ctx.arg.shared || needsInterpSection(ctx ));
4517
4517
}
4518
4518
4519
4519
constexpr char kMemtagAndroidNoteName[] = "Android";
@@ -4652,19 +4652,19 @@ static Defined *addOptionalRegular(StringRef name, SectionBase *sec,
4652
4652
return cast<Defined>(s);
4653
4653
}
4654
4654
4655
- template <class ELFT> void elf::createSyntheticSections() {
4655
+ template <class ELFT> void elf::createSyntheticSections(Ctx &ctx ) {
4656
4656
// Add the .interp section first because it is not a SyntheticSection.
4657
4657
// The removeUnusedSyntheticSections() function relies on the
4658
4658
// SyntheticSections coming last.
4659
- if (needsInterpSection()) {
4659
+ if (needsInterpSection(ctx )) {
4660
4660
for (size_t i = 1; i <= ctx.partitions.size(); ++i) {
4661
4661
InputSection *sec = createInterpSection();
4662
4662
sec->partition = i;
4663
4663
ctx.inputSections.push_back(sec);
4664
4664
}
4665
4665
}
4666
4666
4667
- auto add = [](SyntheticSection &sec) { ctx.inputSections.push_back(&sec); };
4667
+ auto add = [& ](SyntheticSection &sec) { ctx.inputSections.push_back(&sec); };
4668
4668
4669
4669
if (ctx.arg.zSectionHeader)
4670
4670
ctx.in.shStrTab = std::make_unique<StringTableSection>(".shstrtab", false);
@@ -4927,10 +4927,10 @@ template <class ELFT> void elf::createSyntheticSections() {
4927
4927
add(*ctx.in.strTab);
4928
4928
}
4929
4929
4930
- template void elf::splitSections<ELF32LE>();
4931
- template void elf::splitSections<ELF32BE>();
4932
- template void elf::splitSections<ELF64LE>();
4933
- template void elf::splitSections<ELF64BE>();
4930
+ template void elf::splitSections<ELF32LE>(Ctx & );
4931
+ template void elf::splitSections<ELF32BE>(Ctx & );
4932
+ template void elf::splitSections<ELF64LE>(Ctx & );
4933
+ template void elf::splitSections<ELF64BE>(Ctx & );
4934
4934
4935
4935
template void EhFrameSection::iterateFDEWithLSDA<ELF32LE>(
4936
4936
function_ref<void(InputSection &)>);
@@ -4956,7 +4956,7 @@ template void elf::writePhdrs<ELF32BE>(uint8_t *Buf, Partition &Part);
4956
4956
template void elf::writePhdrs<ELF64LE>(uint8_t *Buf, Partition &Part);
4957
4957
template void elf::writePhdrs<ELF64BE>(uint8_t *Buf, Partition &Part);
4958
4958
4959
- template void elf::createSyntheticSections<ELF32LE>();
4960
- template void elf::createSyntheticSections<ELF32BE>();
4961
- template void elf::createSyntheticSections<ELF64LE>();
4962
- template void elf::createSyntheticSections<ELF64BE>();
4959
+ template void elf::createSyntheticSections<ELF32LE>(Ctx & );
4960
+ template void elf::createSyntheticSections<ELF32BE>(Ctx & );
4961
+ template void elf::createSyntheticSections<ELF64LE>(Ctx & );
4962
+ template void elf::createSyntheticSections<ELF64BE>(Ctx & );
0 commit comments