Skip to content

Commit ec77ad7

Browse files
author
Vasily Leonenko
committed
[BOLT][test] Fix instrumentation tests for X86 (add .init entries)
1 parent f979b06 commit ec77ad7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

bolt/test/X86/internal-call-instrument-so.s

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
66
# Delete our BB symbols so BOLT doesn't mark them as entry points
77
# RUN: llvm-strip --strip-unneeded %t.o
8-
# RUN: ld.lld %t.o -o %t.exe -q -shared -fini=_fini
8+
# RUN: ld.lld %t.o -o %t.exe -q -shared -fini=_fini -init=_init
99
# RUN: llvm-bolt --instrument %t.exe --relocs -o %t.out
1010

1111
.text
@@ -48,6 +48,13 @@ _fini:
4848
hlt
4949
.size _fini, .-_fini
5050

51+
.globl _init
52+
.type _init, %function
53+
.p2align 4
54+
_init:
55+
retq
56+
.size _init, .-_init
57+
5158
.data
5259
.globl var
5360
var:

bolt/test/runtime/X86/instrument-wrong-target.s

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ _start:
1919
ret
2020
.size _start, .-_start
2121

22+
.globl _init
23+
.type _init, %function
24+
# Force DT_INIT to be created (needed for instrumentation).
25+
_init:
26+
ret
27+
.size _init, .-_init
28+
2229
.globl _fini
2330
.type _fini, %function
2431
# Force DT_FINI to be created (needed for instrumentation).

0 commit comments

Comments
 (0)