Change to allow signal handlers to set SE and BE bits.

Corey Minyard minyard at
Wed Sep 10 12:47:26 EST 2003

After your and Ben's comments, I looked at this some more.  Yes, I
should have used the old versions of sigreturn and rt_sigreturn.  I have
looked at gdb and gcc unwinding.  gdb 5.3 only handles the "7777"
(non-rt) signal frames properly.  It does not handle rt frames.  gdb 6.0
pre has handling code for the "6666" (rt), "7777" (non-rt), sigreturn,
and rt_sigreturn versions of the stack frames.  However, the rt versions
are broken, it doesn't account for the different frame format in rt
signal handlers.

gcc unwinding looks ok, it handles the old and new versions of the stack
frame system calls.

I'm being a little persistent on this because I think changing the way
signal handling works would be better if changed.  System calls would be
a little faster with the change (although signal returns would be
slightly slower, but I assume the occur less often).  Plus, strace is
unable to trace signal returns with the way it works now.  I consider
signal returns a pretty important thing for strace to show, and other
arches do this.

I've attached yet another patch.  By default, this patch uses the
"0x6666" and "0x7777" versions of the signal return syscalls.  The
DoSyscall code will translate from the 0x6666 and 0x7777 to the
sys_rt_sigreturn and sys_sigreturn.  You can do "echo '0' >
/proc/sys/ppc/sigtype" to change it to use the syscalls for
sys_sigreturn and sys_rt_sigreturn.  I've tested gdb 5.3, gdb 6.0, and
strace with it in both modes.  (when using sys_sigreturn, strace
actually prints the right thing).

I'm going to test signal unwinding now after I brush up on my C++ skills
:-).  I expect they will work, but I'll send an email.

This is against 2.4.22-ben2, and it has the new code.  The 2.5 code is
quite different, but my changes make 2.4 more like 2.5.  A 2.5 patch
would be pretty easy to do.

I also have a patch against 2.4.20 (I have to do that version for our
product), but with stacked signal frames things get ugly.


Paul Mackerras wrote:

>Corey Minyard writes:
>>I added some new syscalls for each sigreturn option, but there were
>>already some more that would obviously not work for this.  Should I
>>convert the others over to work correctly, or should I leave these like
>>they are?
>There already were numbers assigned for the sigreturn and rt_sigreturn
>system calls which weren't being used in 2.4.  In 2.5/2.6 I have
>changed the kernel to use them.  I thought the stack unwinding code in
>glibc (at least) had already been updated to reflect that.
>Which tree is your patch against?  Note that there are PPC signal
>changes in 2.4.23-pre3.  I hope your patch is against the new version
>not the old version. :)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dbg_sig_ppc2.diff
URL: <>

More information about the Linuxppc-dev mailing list