[llvm] [BOLT] Check entry point address is not in constant island (PR #163418)
Gergely Bálint via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 14 09:20:04 PDT 2025
================
@@ -0,0 +1,35 @@
+// This test checks that we ignore functions which add an entry point that
+// is in a costant island.
+
+# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-linux-gnu %s -o %t.o
+# RUN: %clang %cflags %t.o -pie -Wl,-q -o %t.exe
+# RUN: llvm-bolt %t.exe -o %t.bolt 2>&1 | FileCheck %s
+
+# CHECK: BOLT-WARNING: Ignoring entry point at address 0x{{[0-9a-f]+}} in constant island of function func
+
+.globl func
+.type func, %function
+func:
+ ret
+ nop
+ b .Lafter_constant
+
+.type constant_island, %object
+constant_island:
+ .xword 0xabcdef
+
+.Lafter_constant:
+ ret
+ .size func, .-func
+
+.globl caller
+.type caller, %function
+caller:
+ bl constant_island
+ ret
----------------
bgergely0 wrote:
Question: this would be a miscompilation in real code, wouldn't it?
If so, it might be worth to file an issue for the compiler as well as preparing BOLT for processing this.
https://github.com/llvm/llvm-project/pull/163418
More information about the llvm-commits
mailing list