[lld] Allow Arm PC-relative relocations in pic or shared library (PR #77304)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 8 05:46:39 PST 2024
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 0e4a38018a7228d93d72a31d9fae6855f866dded b8c4832d38545b32adeed60094f3f4e3640a9d4e -- lld/ELF/Relocations.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 6a7976f413..cb8f2f125e 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -210,10 +210,10 @@ bool lld::elf::needsGot(RelExpr expr) {
// True if this expression is of the form Sym - X, where X is a position in the
// file (PC, or GOT for example).
static bool isRelExpr(RelExpr expr) {
- return oneof<R_PC, R_GOTREL, R_GOTPLTREL, R_ARM_PCA, R_MIPS_GOTREL, R_PPC64_CALL,
- R_PPC64_RELAX_TOC, R_AARCH64_PAGE_PC, R_RELAX_GOT_PC,
- R_RISCV_PC_INDIRECT, R_PPC64_RELAX_GOT_PC, R_LOONGARCH_PAGE_PC>(
- expr);
+ return oneof<R_PC, R_GOTREL, R_GOTPLTREL, R_ARM_PCA, R_MIPS_GOTREL,
+ R_PPC64_CALL, R_PPC64_RELAX_TOC, R_AARCH64_PAGE_PC,
+ R_RELAX_GOT_PC, R_RISCV_PC_INDIRECT, R_PPC64_RELAX_GOT_PC,
+ R_LOONGARCH_PAGE_PC>(expr);
}
static RelExpr toPlt(RelExpr expr) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/77304
More information about the llvm-commits
mailing list