[llvm] [JITLink][AArch32] Add GOT builder and implement R_ARM_GOT_PREL relocations for ELF (PR #78753)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 10:15:56 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 01ba627f431c3622a973c1cb5a593c101021f805 ab1fa3773766072882666a16682e985bbd9cd72d -- llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h llvm/lib/ExecutionEngine/JITLink/ELF_aarch32.cpp llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp b/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
index eb51a4896d..111527a39e 100644
--- a/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
@@ -679,12 +679,16 @@ Error applyFixupThumb(LinkGraph &G, Block &B, const Edge &E,
 }
 
 const uint8_t GOTEntryInit[] = {
-    0x00, 0x00, 0x00, 0x00,
+    0x00,
+    0x00,
+    0x00,
+    0x00,
 };
 
 /// Create a new node in the link-graph for the given pointer value.
 template <size_t Size>
-static Block &allocPointer(LinkGraph &G, Section &S, const uint8_t (&Content)[Size]) {
+static Block &allocPointer(LinkGraph &G, Section &S,
+                           const uint8_t (&Content)[Size]) {
   static_assert(Size == 4, "Pointers are 32-bit");
   constexpr uint64_t Alignment = 4;
   ArrayRef<char> Init(reinterpret_cast<const char *>(Content), Size);
@@ -710,9 +714,11 @@ bool GOTBuilder::visitEdge(LinkGraph &G, Block *B, Edge &E) {
   default:
     return false;
   }
-  LLVM_DEBUG(dbgs() << "  Transforming " << G.getEdgeKindName(E.getKind()) << " edge at "
-            << B->getFixupAddress(E) << " (" << B->getAddress() << " + "
-            << formatv("{0:x}", E.getOffset()) << ") into " << G.getEdgeKindName(KindToSet) << "\n");
+  LLVM_DEBUG(dbgs() << "  Transforming " << G.getEdgeKindName(E.getKind())
+                    << " edge at " << B->getFixupAddress(E) << " ("
+                    << B->getAddress() << " + "
+                    << formatv("{0:x}", E.getOffset()) << ") into "
+                    << G.getEdgeKindName(KindToSet) << "\n");
   E.setKind(KindToSet);
   E.setTarget(getEntryForTarget(G, E.getTarget()));
   return true;

``````````

</details>


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


More information about the llvm-commits mailing list