This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[hurd] signal handlers need DF=0


Hello,

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).

Samuel

2008-03-08  Samuel Thibault  <samuel.thibault@ens-lyon.org>

	* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
	Clear direction flag.

Index: sysdeps/mach/hurd/i386/trampoline.c
===================================================================
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;
+
   return scp;
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]