mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-26 20:40:28 +00:00
Replace .pushsection directives (#30)
This commit is contained in:
parent
28316891e9
commit
04f1d89f84
16 changed files with 171 additions and 10422 deletions
|
@ -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) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue