This is the mail archive of the
mailing list for the glibc project.
[hurd] signal handlers need DF=0
- From: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Sat, 8 Mar 2008 12:00:36 +0000
- Subject: [hurd] signal handlers need DF=0
Functions are supposed to be called with DF=0. Gcc used to still always
emit cld "just in case", but with 4.3 it doesn't any more. We thus need
to clear it in the trampoline code, here is a patch (you may want to
move the magic number into some appropriate header).
2008-03-08 Samuel Thibault <firstname.lastname@example.org>
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Clear direction flag.
RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/i386/trampoline.c,v
retrieving revision 1.30
diff -u -p -r1.30 trampoline.c
--- sysdeps/mach/hurd/i386/trampoline.c 21 Dec 2005 22:16:20 -0000 1.30
+++ sysdeps/mach/hurd/i386/trampoline.c 8 Mar 2008 00:07:38 -0000
@@ -218,6 +218,9 @@ _hurd_setup_sighandler (struct hurd_sigs
/* We pass the handler function to the trampoline code in %edx. */
state->basic.edx = (int) handler;
+ /* x86 ABI requires direction flag to be cleared */
+ state->basic.efl &= ~0x400;