[llvm-branch-commits] [ELF] Move CFI jump table only if all entries match the last one (PR #222234)

Vitaly Buka via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 8 21:55:44 PDT 2026


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

In CFI jump table relaxation (relaxCFIJumpTables), moving the jump table
before the last entry moves the entire jump table into the output section
of that last entry.

If jump table entries target functions in different output sections
(for example, some in .text.hot and some in .text.unlikely or a different
section), moving the jump table before the last entry can drag the jump
table and its other entries into a section that does not match them.

Only allow moving the jump table before the last entry if every entry
in the jump table targets a section whose parent output section matches
the last entry's output section.

Assisted-by: Gemini





More information about the llvm-branch-commits mailing list