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

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Mar 25 22:48:30 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 - .)
----------------
MaskRay wrote:

Implemented `%pltpcrel`, while a bit complex, I am happy with the result. (As in `RISCVMCExpr::evaluateAsRelocatableImpl`, we don't need an exception for `VK_PLT`, if we go with `%plt`. This might be difficult to explain without playing with it.)

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


More information about the llvm-branch-commits mailing list