@@ -3946,7 +3946,7 @@ void MergeNoTailSection::finalizeContents() {
39463946 });
39473947}
39483948
3949- template <class ELFT > void elf::splitSections () {
3949+ template <class ELFT > void elf::splitSections (Ctx &ctx ) {
39503950 llvm::TimeTraceScope timeScope (" Split sections" );
39513951 // splitIntoPieces needs to be called on each MergeInputSection
39523952 // before calling finalizeContents().
@@ -3962,7 +3962,7 @@ template <class ELFT> void elf::splitSections() {
39623962 });
39633963}
39643964
3965- void elf::combineEhSections () {
3965+ void elf::combineEhSections (Ctx &ctx ) {
39663966 llvm::TimeTraceScope timeScope (" Combine EH sections" );
39673967 for (EhInputSection *sec : ctx.ehInputSections ) {
39683968 EhFrameSection &eh = *sec->getPartition ().ehFrame ;
@@ -4495,7 +4495,7 @@ void InStruct::reset() {
44954495 symTabShndx.reset ();
44964496}
44974497
4498- static bool needsInterpSection () {
4498+ static bool needsInterpSection (Ctx &ctx ) {
44994499 return !ctx.arg .relocatable && !ctx.arg .shared &&
45004500 !ctx.arg .dynamicLinker .empty () && ctx.script ->needsInterpSection ();
45014501}
@@ -4513,7 +4513,7 @@ bool elf::hasMemtag() {
45134513// that ifuncs use in fully static executables.
45144514bool elf::canHaveMemtagGlobals () {
45154515 return hasMemtag () &&
4516- (ctx.arg .relocatable || ctx.arg .shared || needsInterpSection ());
4516+ (ctx.arg .relocatable || ctx.arg .shared || needsInterpSection (ctx ));
45174517}
45184518
45194519constexpr char kMemtagAndroidNoteName [] = " Android" ;
@@ -4652,19 +4652,19 @@ static Defined *addOptionalRegular(StringRef name, SectionBase *sec,
46524652 return cast<Defined>(s);
46534653}
46544654
4655- template <class ELFT > void elf::createSyntheticSections () {
4655+ template <class ELFT > void elf::createSyntheticSections (Ctx &ctx ) {
46564656 // Add the .interp section first because it is not a SyntheticSection.
46574657 // The removeUnusedSyntheticSections() function relies on the
46584658 // SyntheticSections coming last.
4659- if (needsInterpSection ()) {
4659+ if (needsInterpSection (ctx )) {
46604660 for (size_t i = 1 ; i <= ctx.partitions .size (); ++i) {
46614661 InputSection *sec = createInterpSection ();
46624662 sec->partition = i;
46634663 ctx.inputSections .push_back (sec);
46644664 }
46654665 }
46664666
4667- auto add = [](SyntheticSection &sec) { ctx.inputSections .push_back (&sec); };
4667+ auto add = [& ](SyntheticSection &sec) { ctx.inputSections .push_back (&sec); };
46684668
46694669 if (ctx.arg .zSectionHeader )
46704670 ctx.in .shStrTab = std::make_unique<StringTableSection>(" .shstrtab" , false );
@@ -4927,10 +4927,10 @@ template <class ELFT> void elf::createSyntheticSections() {
49274927 add (*ctx.in .strTab );
49284928}
49294929
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 & );
49344934
49354935template void EhFrameSection::iterateFDEWithLSDA<ELF32LE>(
49364936 function_ref<void (InputSection &)>);
@@ -4956,7 +4956,7 @@ template void elf::writePhdrs<ELF32BE>(uint8_t *Buf, Partition &Part);
49564956template void elf::writePhdrs<ELF64LE>(uint8_t *Buf, Partition &Part);
49574957template void elf::writePhdrs<ELF64BE>(uint8_t *Buf, Partition &Part);
49584958
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