Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1699,9 +1699,20 @@ bool BinaryFunction::scanExternalRefs() {

const uint64_t FunctionOffset =
TargetAddress - TargetFunction->getAddress();
BranchTargetSymbol =
FunctionOffset ? TargetFunction->addEntryPointAtOffset(FunctionOffset)
: TargetFunction->getSymbol();
if (!TargetFunction->isInConstantIsland(TargetAddress)) {
BranchTargetSymbol =
FunctionOffset
? TargetFunction->addEntryPointAtOffset(FunctionOffset)
: TargetFunction->getSymbol();
} else {
TargetFunction->setIgnored();
Success = false;
BC.outs() << "BOLT-WARNING: Ignoring entry point at address 0x"
<< Twine::utohexstr(Address)
<< " in constant island of function " << *TargetFunction
<< '\n';
break;
}
}

// Can't find more references. Not creating relocations since we are not
Expand Down
1 change: 1 addition & 0 deletions bolt/test/AArch64/constant-island-entry.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# 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 2>&1 | FileCheck %s
# RUN: llvm-bolt %t.exe -o %t.bolt -skip-funcs=caller 2>&1 | FileCheck %s

# CHECK: BOLT-WARNING: Ignoring entry point at address 0x{{[0-9a-f]+}} in constant island of function func

Expand Down
Loading