Replace .pushsection directives (#30)

This commit is contained in:
Justine Tunney 2021-01-10 13:30:48 -08:00
parent 28316891e9
commit 04f1d89f84
16 changed files with 171 additions and 10422 deletions

View file

@ -2,18 +2,18 @@
#define COSMOPOLITAN_LIBC_NEXGEN32E_TRAMPOLINE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
#define TRAMPOLINE(FUNCTION, THUNK) \
({ \
typeof(FUNCTION) *Tramp; \
asm(".pushsection .text.trampoline\n" \
"183:\n\t" \
"mov\t%1,%%eax\n\t" \
"jmp\t" #THUNK "\n\t" \
".popsection\n\t" \
"mov\t$183b,%k0" \
: "=r"(Tramp) \
: "i"(FUNCTION)); \
Tramp; \
#define TRAMPOLINE(FUNCTION, THUNK) \
({ \
typeof(FUNCTION) *Tramp; \
asm(".section .text.trampoline\n" \
"183:\n\t" \
"mov\t%1,%%eax\n\t" \
"jmp\t" #THUNK "\n\t" \
".previous\n\t" \
"mov\t$183b,%k0" \
: "=r"(Tramp) \
: "i"(FUNCTION)); \
Tramp; \
})
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */