]> granicus.if.org Git - musl/commitdiff
fix x32 __set_thread_area failure due to junk in upper bits
authorRich Felker <dalias@aerifal.cx>
Sat, 2 May 2015 15:53:45 +0000 (11:53 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 2 May 2015 15:53:45 +0000 (11:53 -0400)
the kernel does not properly clear the upper bits of the syscall
argument, so we have to do it before the syscall.

src/thread/x32/__set_thread_area.s

index 94bc36300c240e9476f57eb705d577a33d10b6d4..e0daf72f5f020cebc96a59e10438b59f19b2b0f2 100644 (file)
@@ -3,7 +3,7 @@
 .global __set_thread_area
 .type __set_thread_area,@function
 __set_thread_area:
-       mov %rdi,%rsi           /* shift for syscall */
+       mov %edi,%esi           /* shift for syscall */
        movl $0x1002,%edi       /* SET_FS register */
        movl $0x4000009e,%eax          /* set fs segment to */
        syscall                 /* arch_prctl(SET_FS, arg)*/