diff options
author | Fangrui Song <i@maskray.me> | 2025-04-15 09:10:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-15 09:10:04 -0700 |
commit | c8121b99a99fe1785add732aa062039b7c5fdd32 (patch) | |
tree | 71a56cf9f3cee9b093688703b68c4939cd404698 /llvm/lib/Support/ProgramStack.cpp | |
parent | d41e517748e2dbb51e27bed217f3dd7a4c4fb86f (diff) | |
download | llvm-c8121b99a99fe1785add732aa062039b7c5fdd32.zip llvm-c8121b99a99fe1785add732aa062039b7c5fdd32.tar.gz llvm-c8121b99a99fe1785add732aa062039b7c5fdd32.tar.bz2 |
[RISCV] Xqcilb: remove RISCVMCExpr::VK_QC_E_JUMP_PLT and drop `@plt` parsing
Follow-up to the just landed #135044 . Remove `@plt` parsing (only
needed by legacy `call foo@plt`). MCParser's `@` parsing is problematic.
Supporting target variations like (`foo+2@plt foo@plt+2 (foo+2)@plt`)
involves messy hacks. We should refrain from adding new `@` uses.
Remove unneeded `RISCVMCExpr::VK_QC_E_JUMP_PLT` (should only be used
when an instruction might have multiple reasonable relocations
https://maskray.me/blog/2025-03-16-relocation-generation-in-assemblers).
---
GCC's initial initial RISC-V port made a mistake by having both `call
foo` (non-PIC) and `call foo@plt` (PIC), likely misled by x86/SystemZ.
It was determined that the `@plt` was not needed. Since R_RISCV_CALL had
questionable undefined weak semantics in GNU ld (which has been removed
then), we kept R_RISCV_CALL_PLT and deprecated R_RISCV_CALL.
For RISC-V instructions, we only keep `@` in call/jump for backward
compatibility and discourage it for all other instructions.
(
There is disagreement about whether `PLT` in `JUMP_PLT` is useful or
misleading.
MaskRay's opnion: For new branch relocations with procedure call
semantics, use `_CALL` and avoid `_PLT` in the relocation name.
`_PLT` should only be used in data directives (e.g. R_RISCV_PLT32) to
indicate that the address of a function is not significant.
)
Pull Request: https://github.com/llvm/llvm-project/pull/135507
Diffstat (limited to 'llvm/lib/Support/ProgramStack.cpp')
0 files changed, 0 insertions, 0 deletions