1.hidden __sysinfo 2 3# We do some gymnastics here to pretend that a call to __syscall 4# Is actually a call into the __sysinfo function. As they have 5# the same type we really just want to do a jmp, but need to 6# do the lookup in a way that supports PIC and not clobber 7# any registers 8 9.global __syscall 10.hidden __syscall 11.type __syscall,@function 12__syscall: 13 subl $4, %esp # Reserve space for tail call 14 push %eax # Save EAX 15 call 1f # Determine our IP 161: mov (%esp),%eax 17 add $[__sysinfo-1b],%eax 18 mov (%eax),%eax 19 test %eax,%eax 20 jz 2f 21 movl %eax, 8(%esp) # Put this in space we reserved 22 addl $4, %esp # Junk our IP 23 popl %eax # Restore eax 24 ret # Tail call 252: addl $4, %esp 26 popl %eax 27 addl $4, %esp 28 int $128 29 ret 30