[lld] [LLD][RISCV][Zicfilp] Generate unlabeled landing pad-style PLT (PR #145461)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 3 20:53:29 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- lld/ELF/Arch/RISCV.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lld/ELF/Arch/RISCV.cpp b/lld/ELF/Arch/RISCV.cpp
index 2e6c12411..ea25f216e 100644
--- a/lld/ELF/Arch/RISCV.cpp
+++ b/lld/ELF/Arch/RISCV.cpp
@@ -250,9 +250,8 @@ void RISCV::writePltHeader(uint8_t *buf) const {
// srli t1, t1, log2(16/PTRSIZE)
// l[w|d] t0, PTRSIZE(t0)
// jr t2
- const uint32_t offset = ctx.in.gotPlt->getVA() -
- const uint32_t offset = ctx.in.gotPlt->getVA() -
- ctx.in.plt->getVA();
+ const uint32_t offset = ctx.in.gotPlt->getVA() - const uint32_t offset =
+ ctx.in.gotPlt->getVA() - ctx.in.plt->getVA();
const uint32_t load = ctx.arg.is64 ? LD : LW;
write32le(buf + 0, utype(AUIPC, X_T3, hi20(offset)));
write32le(buf + 4, rtype(SUB, X_T1, X_T1, X_T2));
``````````
</details>
https://github.com/llvm/llvm-project/pull/145461
More information about the llvm-commits
mailing list