@@ -1424,7 +1424,7 @@ template <class ELFT> void Writer<ELFT>::resolveShfLinkOrder() {
14241424 }
14251425}
14261426
1427- static void finalizeSynthetic (SyntheticSection *sec) {
1427+ static void finalizeSynthetic (Ctx &ctx, SyntheticSection *sec) {
14281428 if (sec && sec->isNeeded () && sec->getParent ()) {
14291429 llvm::TimeTraceScope timeScope (" Finalize synthetic sections" , sec->name );
14301430 sec->finalizeContents (ctx);
@@ -1438,7 +1438,7 @@ static void finalizeSynthetic(SyntheticSection *sec) {
14381438template <class ELFT > void Writer<ELFT>::finalizeAddressDependentContent() {
14391439 llvm::TimeTraceScope timeScope (" Finalize address dependent content" );
14401440 ThunkCreator tc (ctx);
1441- AArch64Err843419Patcher a64p;
1441+ AArch64Err843419Patcher a64p (ctx) ;
14421442 ARMErr657417Patcher a32p;
14431443 ctx.script ->assignAddresses ();
14441444
@@ -1449,7 +1449,7 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
14491449 // section order.
14501450 const auto finalizeOrderDependentContent = [this ] {
14511451 for (Partition &part : ctx.partitions )
1452- finalizeSynthetic (part.armExidx .get ());
1452+ finalizeSynthetic (ctx, part.armExidx .get ());
14531453 resolveShfLinkOrder ();
14541454 };
14551455 finalizeOrderDependentContent ();
@@ -1486,7 +1486,7 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
14861486 changed |= a32p.createFixes ();
14871487 }
14881488
1489- finalizeSynthetic (ctx.in .got .get ());
1489+ finalizeSynthetic (ctx, ctx .in .got .get ());
14901490 if (ctx.in .mipsGot )
14911491 ctx.in .mipsGot ->updateAllocSize ();
14921492
@@ -1783,7 +1783,7 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
17831783 {
17841784 llvm::TimeTraceScope timeScope (" Finalize .eh_frame" );
17851785 for (Partition &part : ctx.partitions )
1786- finalizeSynthetic (part.ehFrame .get ());
1786+ finalizeSynthetic (ctx, part.ehFrame .get ());
17871787 }
17881788 }
17891789
@@ -1983,20 +1983,20 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
19831983 {
19841984 llvm::TimeTraceScope timeScope (" Finalize synthetic sections" );
19851985
1986- finalizeSynthetic (ctx.in .bss .get ());
1987- finalizeSynthetic (ctx.in .bssRelRo .get ());
1988- finalizeSynthetic (ctx.in .symTabShndx .get ());
1989- finalizeSynthetic (ctx.in .shStrTab .get ());
1990- finalizeSynthetic (ctx.in .strTab .get ());
1991- finalizeSynthetic (ctx.in .got .get ());
1992- finalizeSynthetic (ctx.in .mipsGot .get ());
1993- finalizeSynthetic (ctx.in .igotPlt .get ());
1994- finalizeSynthetic (ctx.in .gotPlt .get ());
1995- finalizeSynthetic (ctx.in .relaPlt .get ());
1996- finalizeSynthetic (ctx.in .plt .get ());
1997- finalizeSynthetic (ctx.in .iplt .get ());
1998- finalizeSynthetic (ctx.in .ppc32Got2 .get ());
1999- finalizeSynthetic (ctx.in .partIndex .get ());
1986+ finalizeSynthetic (ctx, ctx .in .bss .get ());
1987+ finalizeSynthetic (ctx, ctx .in .bssRelRo .get ());
1988+ finalizeSynthetic (ctx, ctx .in .symTabShndx .get ());
1989+ finalizeSynthetic (ctx, ctx .in .shStrTab .get ());
1990+ finalizeSynthetic (ctx, ctx .in .strTab .get ());
1991+ finalizeSynthetic (ctx, ctx .in .got .get ());
1992+ finalizeSynthetic (ctx, ctx .in .mipsGot .get ());
1993+ finalizeSynthetic (ctx, ctx .in .igotPlt .get ());
1994+ finalizeSynthetic (ctx, ctx .in .gotPlt .get ());
1995+ finalizeSynthetic (ctx, ctx .in .relaPlt .get ());
1996+ finalizeSynthetic (ctx, ctx .in .plt .get ());
1997+ finalizeSynthetic (ctx, ctx .in .iplt .get ());
1998+ finalizeSynthetic (ctx, ctx .in .ppc32Got2 .get ());
1999+ finalizeSynthetic (ctx, ctx .in .partIndex .get ());
20002000
20012001 // Dynamic section must be the last one in this list and dynamic
20022002 // symbol table section (dynSymTab) must be the first one.
@@ -2005,25 +2005,25 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
20052005 part.relaDyn ->mergeRels ();
20062006 // Compute DT_RELACOUNT to be used by part.dynamic.
20072007 part.relaDyn ->partitionRels ();
2008- finalizeSynthetic (part.relaDyn .get ());
2008+ finalizeSynthetic (ctx, part.relaDyn .get ());
20092009 }
20102010 if (part.relrDyn ) {
20112011 part.relrDyn ->mergeRels ();
2012- finalizeSynthetic (part.relrDyn .get ());
2012+ finalizeSynthetic (ctx, part.relrDyn .get ());
20132013 }
20142014 if (part.relrAuthDyn ) {
20152015 part.relrAuthDyn ->mergeRels ();
2016- finalizeSynthetic (part.relrAuthDyn .get ());
2016+ finalizeSynthetic (ctx, part.relrAuthDyn .get ());
20172017 }
20182018
2019- finalizeSynthetic (part.dynSymTab .get ());
2020- finalizeSynthetic (part.gnuHashTab .get ());
2021- finalizeSynthetic (part.hashTab .get ());
2022- finalizeSynthetic (part.verDef .get ());
2023- finalizeSynthetic (part.ehFrameHdr .get ());
2024- finalizeSynthetic (part.verSym .get ());
2025- finalizeSynthetic (part.verNeed .get ());
2026- finalizeSynthetic (part.dynamic .get ());
2019+ finalizeSynthetic (ctx, part.dynSymTab .get ());
2020+ finalizeSynthetic (ctx, part.gnuHashTab .get ());
2021+ finalizeSynthetic (ctx, part.hashTab .get ());
2022+ finalizeSynthetic (ctx, part.verDef .get ());
2023+ finalizeSynthetic (ctx, part.ehFrameHdr .get ());
2024+ finalizeSynthetic (ctx, part.verSym .get ());
2025+ finalizeSynthetic (ctx, part.verNeed .get ());
2026+ finalizeSynthetic (ctx, part.dynamic .get ());
20272027 }
20282028 }
20292029
@@ -2061,10 +2061,10 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
20612061 llvm::TimeTraceScope timeScope (" Finalize synthetic sections" );
20622062 // finalizeAddressDependentContent may have added local symbols to the
20632063 // static symbol table.
2064- finalizeSynthetic (ctx.in .symTab .get ());
2065- finalizeSynthetic (ctx.in .debugNames .get ());
2066- finalizeSynthetic (ctx.in .ppc64LongBranchTarget .get ());
2067- finalizeSynthetic (ctx.in .armCmseSGSection .get ());
2064+ finalizeSynthetic (ctx, ctx .in .symTab .get ());
2065+ finalizeSynthetic (ctx, ctx .in .debugNames .get ());
2066+ finalizeSynthetic (ctx, ctx .in .ppc64LongBranchTarget .get ());
2067+ finalizeSynthetic (ctx, ctx .in .armCmseSGSection .get ());
20682068 }
20692069
20702070 // Relaxation to delete inter-basic block jumps created by basic block
0 commit comments