提交 9d907f1a 编写于 作者: J Josh Poimboeuf

samples/ftrace: Fix asm function ELF annotations

Enable objtool coverage for the sample ftrace modules by adding ELF
annotations to the asm trampoline functions.

  samples/ftrace/ftrace-direct.o: warning: objtool: .text+0x0: unreachable instruction
  samples/ftrace/ftrace-direct-modify.o: warning: objtool: .text+0x0: unreachable instruction
  samples/ftrace/ftrace-direct-too.o: warning: objtool: .text+0x0: unreachable instruction
Reported-by: NRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
上级 7c0577f4
...@@ -20,18 +20,22 @@ static unsigned long my_ip = (unsigned long)schedule; ...@@ -20,18 +20,22 @@ static unsigned long my_ip = (unsigned long)schedule;
asm ( asm (
" .pushsection .text, \"ax\", @progbits\n" " .pushsection .text, \"ax\", @progbits\n"
" .type my_tramp1, @function\n"
" my_tramp1:" " my_tramp1:"
" pushq %rbp\n" " pushq %rbp\n"
" movq %rsp, %rbp\n" " movq %rsp, %rbp\n"
" call my_direct_func1\n" " call my_direct_func1\n"
" leave\n" " leave\n"
" .size my_tramp1, .-my_tramp1\n"
" ret\n" " ret\n"
" .type my_tramp2, @function\n"
" my_tramp2:" " my_tramp2:"
" pushq %rbp\n" " pushq %rbp\n"
" movq %rsp, %rbp\n" " movq %rsp, %rbp\n"
" call my_direct_func2\n" " call my_direct_func2\n"
" leave\n" " leave\n"
" ret\n" " ret\n"
" .size my_tramp2, .-my_tramp2\n"
" .popsection\n" " .popsection\n"
); );
......
...@@ -15,6 +15,7 @@ extern void my_tramp(void *); ...@@ -15,6 +15,7 @@ extern void my_tramp(void *);
asm ( asm (
" .pushsection .text, \"ax\", @progbits\n" " .pushsection .text, \"ax\", @progbits\n"
" .type my_tramp, @function\n"
" my_tramp:" " my_tramp:"
" pushq %rbp\n" " pushq %rbp\n"
" movq %rsp, %rbp\n" " movq %rsp, %rbp\n"
...@@ -27,6 +28,7 @@ asm ( ...@@ -27,6 +28,7 @@ asm (
" popq %rdi\n" " popq %rdi\n"
" leave\n" " leave\n"
" ret\n" " ret\n"
" .size my_tramp, .-my_tramp\n"
" .popsection\n" " .popsection\n"
); );
......
...@@ -13,6 +13,7 @@ extern void my_tramp(void *); ...@@ -13,6 +13,7 @@ extern void my_tramp(void *);
asm ( asm (
" .pushsection .text, \"ax\", @progbits\n" " .pushsection .text, \"ax\", @progbits\n"
" .type my_tramp, @function\n"
" my_tramp:" " my_tramp:"
" pushq %rbp\n" " pushq %rbp\n"
" movq %rsp, %rbp\n" " movq %rsp, %rbp\n"
...@@ -21,6 +22,7 @@ asm ( ...@@ -21,6 +22,7 @@ asm (
" popq %rdi\n" " popq %rdi\n"
" leave\n" " leave\n"
" ret\n" " ret\n"
" .size my_tramp, .-my_tramp\n"
" .popsection\n" " .popsection\n"
); );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册