diff options
author | kib <kib@FreeBSD.org> | 2008-03-13 10:54:38 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-03-13 10:54:38 +0000 |
commit | be9c86776fd3d1b746e9d680bf5baac3baf55f1f (patch) | |
tree | 52d0fc80556549589a35e0500475ca1c8a6bf459 /sys/i386/svr4 | |
parent | 5fad0ab9147faabf630933d7c4a60891c8e5a3e2 (diff) | |
download | FreeBSD-src-be9c86776fd3d1b746e9d680bf5baac3baf55f1f.zip FreeBSD-src-be9c86776fd3d1b746e9d680bf5baac3baf55f1f.tar.gz |
Since version 4.3, gcc changed its behaviour concerning the i386/amd64
ABI and the direction flag, that is it now assumes that the direction
flag is cleared at the entry of a function and it doesn't clear once
more if needed. This new behaviour conforms to the i386/amd64 ABI.
Modify the signal handler frame setup code to clear the DF {e,r}flags
bit on the amd64/i386 for the signal handlers.
jhb@ noted that it might break old apps if they assumed DF == 1 would be
preserved in the signal handlers, but that such apps should be rare and
that older versions of gcc would not generate such apps.
Submitted by: Aurelien Jarno <aurelien aurel32 net>
PR: 121422
Reviewed by: jhb
MFC after: 2 weeks
Diffstat (limited to 'sys/i386/svr4')
-rw-r--r-- | sys/i386/svr4/svr4_machdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/i386/svr4/svr4_machdep.c b/sys/i386/svr4/svr4_machdep.c index 79a7cbc..50e6ad2 100644 --- a/sys/i386/svr4/svr4_machdep.c +++ b/sys/i386/svr4/svr4_machdep.c @@ -497,13 +497,13 @@ svr4_sendsig(catcher, ksi, mask) svr4_szsigcode); tf->tf_cs = GSEL(GUSERLDT_SEL, SEL_UPL); - tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC); + tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC|PSL_D); tf->tf_esp = (int)fp; tf->tf_ss = GSEL(GUSERLDT_SEL, SEL_UPL); #else tf->tf_esp = (int)fp; tf->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode)); - tf->tf_eflags &= ~PSL_T; + tf->tf_eflags &= ~(PSL_T | PSL_D); tf->tf_cs = _ucodesel; tf->tf_ds = _udatasel; tf->tf_es = _udatasel; |