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 subq $8, %rsp # Reserve space for tail call 14 pushq %rax # Save RAX 15 call 1f # Determine our IP 161: movq (%rsp),%rax 17 addq $[__sysinfo-1b],%rax 18 mov (%eax),%rax 19 test %rax,%rax 20 jz 2f 21 movq %rax, 16(%rsp) # Put this in space we reserved 22 addq $8, %rsp # Junk our IP 23 popq %rax # Restore eax 24 ret # Tail call 252: addq $8, %rsp 26 popq %rax 27 addq $8, %rsp 28 int $128 29 ret 30