File tree 3 files changed +34
-8
lines changed 3 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -2041,9 +2041,13 @@ class MCPlusBuilder {
2041
2041
return InstructionListType ();
2042
2042
}
2043
2043
2044
+ // / Returns a function body that contains only a return instruction. An
2045
+ // / example usage is a workaround for the '__bolt_fini_trampoline' of
2046
+ // Instrumentation.
2044
2047
virtual InstructionListType createDummyReturnFunction (MCContext *Ctx) const {
2045
- llvm_unreachable (" not implemented" );
2046
- return InstructionListType ();
2048
+ InstructionListType Insts (1 );
2049
+ createReturn (Insts[0 ]);
2050
+ return Insts;
2047
2051
}
2048
2052
2049
2053
// / This method takes an indirect call instruction and splits it up into an
Original file line number Diff line number Diff line change @@ -3241,12 +3241,6 @@ class X86MCPlusBuilder : public MCPlusBuilder {
3241
3241
return Insts;
3242
3242
}
3243
3243
3244
- InstructionListType createDummyReturnFunction (MCContext *Ctx) const override {
3245
- InstructionListType Insts (1 );
3246
- createReturn (Insts[0 ]);
3247
- return Insts;
3248
- }
3249
-
3250
3244
BlocksVectorTy indirectCallPromotion (
3251
3245
const MCInst &CallInst,
3252
3246
const std::vector<std::pair<MCSymbol *, uint64_t >> &Targets,
Original file line number Diff line number Diff line change
1
+ # REQUIRES: system - linux , target=aarch64{{. * }}
2
+
3
+ # RUN: llvm - mc - filetype=obj - triple aarch64 - unknown - unknown %s - o %t.o
4
+ # RUN: %clang %cflags %t.o - o %t.exe - Wl ,- q - static
5
+ # RUN: llvm - bolt - instrument - instrumentation - sleep - time= 1 %t.exe \
6
+ # RUN: - o %t.instr 2 >& 1 | FileCheck %s
7
+ # RUN: llvm - objdump -- disassemble - symbols=__bolt_fini_trampoline %t.instr - D \
8
+ # RUN: | FileCheck %s - check - prefix=CHECK - ASM
9
+
10
+ # CHECK: BOLT - INFO: output linked against instrumentation runtime library
11
+ # CHECK - ASM: <__bolt_fini_trampoline>:
12
+ # CHECK - ASM - NEXT: ret
13
+
14
+ .text
15
+ . align 4
16
+ . global _start
17
+ .type _start , %function
18
+ _start:
19
+ bl foo
20
+ ret
21
+ .size _start , . - _start
22
+
23
+ . global foo
24
+ .type foo , %function
25
+ foo:
26
+ mov w0 , wzr
27
+ ret
28
+ .size foo , . - foo
You can’t perform that action at this time.
0 commit comments