[llvm-branch-commits] [RISCV] Replace @plt/@gotpcrel in data directives with %plt %gotpcrel (PR #132569)

Sam Elliott via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Mar 23 11:55:25 PDT 2025


================
@@ -18,6 +18,6 @@
 .globl _start
 _start:
 .data
-  .word foo at PLT - .
-  .word foo at PLT - . + 1
-  .word foo at PLT - . - 1
+  .word %plt(foo - .)
----------------
lenary wrote:

Yeah I don't like `%plt(foo - .)`, because the thing being put into the instruction is really the difference between foo's PLT entry's address, and the current address (rather than a PLT entry for the difference between foo and the current address). I would much prefer `%pltpcrel(foo)` if `%plt(foo)-.` is not a direction you are happy with, given the existing `%gotpcrel(foo)` means the difference between the current address and foo's GOT entry's address.

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


More information about the llvm-branch-commits mailing list