about summary refs log tree commit diff
path: root/src/internal/i386/syscall.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-11-11 13:56:37 -0500
committerRich Felker <dalias@aerifal.cx>2012-11-11 13:56:37 -0500
commite9b885ee550e8a3eabc9d11c469baf1cfaf64f55 (patch)
treeb2b61c6270cf5572df5dabc2581d4ba287d33a91 /src/internal/i386/syscall.s
parentdc059f03e8277abe3f515f350bd9615416aaa5ef (diff)
downloadmusl-e9b885ee550e8a3eabc9d11c469baf1cfaf64f55.tar.gz
musl-e9b885ee550e8a3eabc9d11c469baf1cfaf64f55.tar.xz
musl-e9b885ee550e8a3eabc9d11c469baf1cfaf64f55.zip
fix clobber of edx in i386 vsyscall asm
this function does not obey the normal calling convention; like a
syscall instruction, it's expected not to clobber any registers except
the return value. clobbering edx could break callers that were reusing
the value cached in edx after the syscall returns.
Diffstat (limited to 'src/internal/i386/syscall.s')
-rw-r--r--src/internal/i386/syscall.s3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/internal/i386/syscall.s b/src/internal/i386/syscall.s
index 291168c3..2914acee 100644
--- a/src/internal/i386/syscall.s
+++ b/src/internal/i386/syscall.s
@@ -16,7 +16,8 @@ __vsyscall:
 	mov 12(%esp),%edi
 	push %eax
 	call 1f
-2:	pop %ebx
+2:	mov %ebx,%edx
+	pop %ebx
 	pop %ebx
 	pop %edi
 	ret