mirror of https://github.com/xqemu/xqemu.git
linux-user: Fix i386 safe-syscall.S
Clang insists that "cmp" is ambiguous with a memory destination, requiring an explicit size suffix. There was a true error in the use of .cfi_def_cfa_offset in the epilogue, but changing to use the proper .cfi_adjust_cfa_offset runs afoul of a clang bug wrt .cfi_restore_state. Better to fold the two epilogues so that we don't trigger the bug. Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
4f4a9ca4a4
commit
4aa3f4dd5b
|
@ -69,7 +69,7 @@ safe_syscall_base:
|
||||||
safe_syscall_start:
|
safe_syscall_start:
|
||||||
/* if signal_pending is non-zero, don't do the call */
|
/* if signal_pending is non-zero, don't do the call */
|
||||||
mov 4+16(%esp), %eax /* signal_pending */
|
mov 4+16(%esp), %eax /* signal_pending */
|
||||||
cmp $0, (%eax)
|
cmpl $0, (%eax)
|
||||||
jnz 1f
|
jnz 1f
|
||||||
mov 8+16(%esp), %eax /* syscall number */
|
mov 8+16(%esp), %eax /* syscall number */
|
||||||
int $0x80
|
int $0x80
|
||||||
|
@ -77,16 +77,16 @@ safe_syscall_end:
|
||||||
/* code path for having successfully executed the syscall */
|
/* code path for having successfully executed the syscall */
|
||||||
pop %ebx
|
pop %ebx
|
||||||
.cfi_remember_state
|
.cfi_remember_state
|
||||||
.cfi_def_cfa_offset -4
|
.cfi_adjust_cfa_offset -4
|
||||||
.cfi_restore ebx
|
.cfi_restore ebx
|
||||||
pop %edi
|
pop %edi
|
||||||
.cfi_def_cfa_offset -4
|
.cfi_adjust_cfa_offset -4
|
||||||
.cfi_restore edi
|
.cfi_restore edi
|
||||||
pop %esi
|
pop %esi
|
||||||
.cfi_def_cfa_offset -4
|
.cfi_adjust_cfa_offset -4
|
||||||
.cfi_restore esi
|
.cfi_restore esi
|
||||||
pop %ebp
|
pop %ebp
|
||||||
.cfi_def_cfa_offset -4
|
.cfi_adjust_cfa_offset -4
|
||||||
.cfi_restore ebp
|
.cfi_restore ebp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -94,19 +94,7 @@ safe_syscall_end:
|
||||||
/* code path when we didn't execute the syscall */
|
/* code path when we didn't execute the syscall */
|
||||||
.cfi_restore_state
|
.cfi_restore_state
|
||||||
mov $-TARGET_ERESTARTSYS, %eax
|
mov $-TARGET_ERESTARTSYS, %eax
|
||||||
pop %ebx
|
jmp safe_syscall_end
|
||||||
.cfi_def_cfa_offset -4
|
|
||||||
.cfi_restore ebx
|
|
||||||
pop %edi
|
|
||||||
.cfi_def_cfa_offset -4
|
|
||||||
.cfi_restore edi
|
|
||||||
pop %esi
|
|
||||||
.cfi_def_cfa_offset -4
|
|
||||||
.cfi_restore esi
|
|
||||||
pop %ebp
|
|
||||||
.cfi_def_cfa_offset -4
|
|
||||||
.cfi_restore ebp
|
|
||||||
ret
|
|
||||||
.cfi_endproc
|
.cfi_endproc
|
||||||
|
|
||||||
.size safe_syscall_base, .-safe_syscall_base
|
.size safe_syscall_base, .-safe_syscall_base
|
||||||
|
|
Loading…
Reference in New Issue