[llvm] [BOLT] Add validation for direct call/branch targets, bypassing invalid functions (PR #165406)

Jinjie Huang via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 08:18:55 PDT 2025


================
@@ -1699,9 +1738,19 @@ bool BinaryFunction::scanExternalRefs() {
 
       const uint64_t FunctionOffset =
           TargetAddress - TargetFunction->getAddress();
-      BranchTargetSymbol =
-          FunctionOffset ? TargetFunction->addEntryPointAtOffset(FunctionOffset)
-                         : TargetFunction->getSymbol();
+      if (!TargetFunction->isInConstantIsland(TargetAddress)) {
+        BranchTargetSymbol =
----------------
Jinjie-Huang wrote:

This is actually an unrelated change, which can be ignore. Without it, the constant-island-entry.s test would fail. I've already submitted a [separate patch](https://github.com/llvm/llvm-project/pull/165577) to properly address the test adaptation.

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


More information about the llvm-commits mailing list