loader based trace using musl
[ldtrace] / loader / w / stub.h
1 __asm__(
2 #define T(i,f) "\n" \
3 ".global " #f "\n" \
4 ".type " #f ",@function\n" \
5 #f ":\n" \
6 "       pushl %esp\n" \
7 "       pushl $" #i "\n" \
8 "       call enter\n" \
9 "       pop %eax\n" \
10 "       pop %eax\n" \
11 "       jmp __real_" #f "\n"
12
13 #include "tab.h"
14 #undef T
15 "\n"
16 "after:\n"
17 "       push %eax\n"
18 "       push %edx\n"
19 "       call leave\n"
20 "       mov %eax,%ecx\n"
21 "       pop %edx\n"
22 "       pop %eax\n"
23 "       push %ecx\n"
24 "       ret\n"
25 );