[llvm] [BOLT] Correctly handle entry point at FDE boundaries (PR #176173)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 06:24:19 PDT 2026


================
@@ -0,0 +1,78 @@
+## Promote unmarked code after a CFI-bounded predecessor into __BOLT_UNMARKED_TAIL.
+## Covers:
+##   1) FDE-only region (no symtab entry; BOLT names it __BOLT_FDE_FUNC* or .text/N)
+##   2) Named function (FDE range == symbol size) -> named_sub + tail
+## Caller is in a separate section; -Wl,-q keeps PC-relative relocs on the bl.
+
+# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
+# RUN: %clang %cflags %t.o -pie -Wl,-q -o %t.exe
+# RUN: llvm-bolt %t.exe -o %t.bolt --print-disasm -v=1 2>&1 | FileCheck %s
+
+# CHECK: Binary Function "{{(__BOLT_FDE_FUNC.*|\.text/[0-9]+)}}" after disassembly
----------------
paschalis-mpeis wrote:

Here we exercise only the `.text/N` path, right? Is that because the unnamed FDE is first in the section?

I think we could exercise both paths (separately), if we duplicate the `.Lfde_sub` FDE region  and its tail, later in the same section?

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


More information about the llvm-commits mailing list