Skip to content

Commit a0796e6

Browse files
[BOLT][AArch64] Instrumentation for static binaries doesn't work in reloc mode.
On AArch64, when trying to instrument a static binary that has relocation data BOLT would crash as it misses `createDummyReturnFunction` function.
1 parent 67133dd commit a0796e6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

bolt/test/AArch64/dummy-return.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
REQUIRES: system-linux
2+
3+
RUN: %clang %p/../Inputs/main.c -o %t -Wl,-q -static
4+
RUN: not llvm-bolt -instrument -instrumentation-sleep-time=1 %t -o %t.instr 2>&1 | FileCheck %s
5+
6+
CHECK: not implemented

bolt/test/Inputs/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// dummy function just for emitting relocations to the linker.
2+
int foo() { return 0; }
3+
int main(int argc, char **argv) { return foo() + 1; }

0 commit comments

Comments
 (0)