File tree Expand file tree Collapse file tree 3 files changed +34
-8
lines changed Expand file tree Collapse file tree 3 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -2041,9 +2041,13 @@ class MCPlusBuilder {
20412041 return InstructionListType ();
20422042 }
20432043
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.
20442047 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;
20472051 }
20482052
20492053 // / 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 {
32413241 return Insts;
32423242 }
32433243
3244- InstructionListType createDummyReturnFunction (MCContext *Ctx) const override {
3245- InstructionListType Insts (1 );
3246- createReturn (Insts[0 ]);
3247- return Insts;
3248- }
3249-
32503244 BlocksVectorTy indirectCallPromotion (
32513245 const MCInst &CallInst,
32523246 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