[llvm-branch-commits] [lld] [ELF] Avoid moving CFI jump table out of its section if other entries target it (PR #222234)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Sep 10 00:04:58 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/X86_64.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/X86_64.cpp b/lld/ELF/Arch/X86_64.cpp
index f095f3622..2ecafb999 100644
--- a/lld/ELF/Arch/X86_64.cpp
+++ b/lld/ELF/Arch/X86_64.cpp
@@ -356,9 +356,10 @@ void X86_64::relaxCFIJumpTables() const {
       // because the last entry controls which output section the jump table is
       // placed into, which affects move eligibility for other sections.
       //
-      // We assume the compiler will try to put the jump table into a hot section
-      // (e.g. .text.hot). Moving the jump table before its last entry places
-      // the entire table into that entry's output section (last->getParent()).
+      // We assume the compiler will try to put the jump table into a hot
+      // section (e.g. .text.hot). Moving the jump table before its last entry
+      // places the entire table into that entry's output section
+      // (last->getParent()).
       // - If the last entry shares the jump table's original output section
       //   (sec->getParent()), moving it keeps the table in that same section,
       //   which is acceptable.

``````````

</details>


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


More information about the llvm-branch-commits mailing list