[parisc-linux] Program counter from sigcontext, constructurs and -fPIC

Carlos O'Donell carlos@baldric.uwo.ca
Tue, 29 Apr 2003 17:30:28 -0400


> 1) Switching to a machine with a 2.4.20-pa28 kernel and gcc 3.2.
> 2) Discarding the privilege level bits from the program counter value.

Why?

> 3) Adding 24 bytes to the struct sigcontext pointer (?) passed as a third argument to the signal handler. (!)

Are you still using a 64-bit kernel?

> Needless to say, I'm still a bit concerned about (3).  Why does the third argument to the signal handler appear to point 24 bytes BEFORE the sigcontext structure?  Does it actually point at a bigger structure?  Is the third argument to a signal handler really not a pointer to sigcontext?  Did struct sigcontext change recently, so that I'm dealing with a version mismatch?

What glibc version is installed? I made recent changes to mache the
userspace and kernel versions of sigcontext (now a machine context).
 
> With the 24 bytes added, I clearly get the right program counter values.  I also seem to get the right general register values.

How are you accessing this value? Can you generate a simple testcase
please?

c.