[lld] [lldb] [llvm] [lld] Add -z mark-plt support for X86_64 (PR #206002)
Jessica Clarke via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 23 19:55:01 PDT 2026
jrtc27 wrote:
Does there need to be erroring if not using of rela? Rel does nor have the extra addend, and the location itself is already taken up by the lazy binding .got.plt initial VA (i.e. VA of the instruction after the PLT entry's `jmpq *sym at .got.plt(%rip)`), so currently I think if you ask for rel (`-z rel`) it'll silently lose the addend (we use addReloc(DynamicReloc) directly here, so won't add the static relocation needed for writeAddends, and even that weren't the case, GotPltSection::writeTo does not call relocateAlloc, so wouldn't process the static relocation, and even if it did, it'd alias the writeGotPlt so only the last one would persist). checkDynRelAddends will probably catch it though at least for assertions builds (without explicit --no-check-dynamic-relocations) and explicit --check-dynamic-relocations uses.
You'll also need to do something about --write-addends (either make getImplicitAddend behave like R_PLT or have OutputSection::checkDynRelAddends skip checking this case).
https://github.com/llvm/llvm-project/pull/206002
More information about the llvm-commits
mailing list