[lld] [ELF] Retain .rela.dyn for PPC64 PI long-branch thunks (PR #212078)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 1 10:46:46 PDT 2026
================
@@ -1747,6 +1747,17 @@ template <class ELFT> void Writer<ELFT>::optimizeBasicBlockJumps() {
is->trim();
}
+// Sections that finalizeAddressDependentContent may add to.
+static bool mayGrowLate(Ctx &ctx, SyntheticSection *sec) {
+ if (sec != ctx.in.relaDyn.get())
+ return false;
+ // Relocations may move here from .relr.auth.dyn.
+ if (ctx.in.relrAuthDyn && ctx.in.relrAuthDyn->isNeeded())
+ return true;
+ // PPC64PILongBranchThunk adds a relative relocation for its .branch_lt entry.
+ return ctx.in.ppc64LongBranchTarget && ctx.arg.isPic;
----------------
MaskRay wrote:
Changed. Added a --pic-thunk test.
https://github.com/llvm/llvm-project/pull/212078
More information about the llvm-commits
mailing list