[lld] [lld] Add target support for SystemZ (s390x) (PR #75643)
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 06:18:01 PST 2024
rui314 wrote:
@uweigand No, it's not. If a function has a GOT entry, its PLT entry is written to .plt.got, and otherwise, its PLT entry is written to .plt. Therefore, a PLT entry is always 16 bytes for each function.
The trick here is that the last instruction of the PTL entry to jump to the function or the PLT stub is `basr` instead of `br` in mold. Since `basr` writes the "return" address in a specified register, the PLT stub is able to know where its control is transferred from. By subtracting its address from the "return" address, the PLT stub can compute a PLT entry index. So, we don't need to have separate code to write a PLT index in a register and jump to stub. This technique is actually common in PLT entries for RISC processors.
https://github.com/llvm/llvm-project/pull/75643
More information about the llvm-commits
mailing list