[lld] [lldb] [llvm] [X86] Add dynamic section support per psABI (PR #206002)

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 27 13:24:56 PDT 2026


================
@@ -749,9 +749,17 @@ static void addPltEntry(Ctx &ctx, PltSection &plt, GotPltSection &gotPlt,
                         RelocationBaseSection &rel, RelType type, Symbol &sym) {
   plt.addEntry(sym);
   gotPlt.addEntry(sym);
+  // The x86-64 psABI requires the r_addend of R_X86_64_JUMP_SLOT to hold the
+  // link-time VA of the PLT entry so that the dynamic linker can locate the
+  // indirect branch (l->l_addr + r_addend) and rewrite it to a direct branch
----------------
jrtc27 wrote:

l->l_addr is a glibc-specific internal detail that does not belong here, but also I see no value from documenting "base address + addend" as being the address of the PLT, because that's clearly what R_PLT as the addend will give, and if you don't get that then you're not going to get very far in the linker

https://github.com/llvm/llvm-project/pull/206002


More information about the llvm-commits mailing list