On Wed, 09 Dec 2009 19:12:41 +0100, Oleg Nesterov wrote:
> > > while the '.func_name' is the text address.
> >
> > tried to change the code to
> >
> >     REGS_ACCESS (regs, nip) = (unsigned long) .raise_sigusr2
> >
> > but gcc doesn't like this ;)
...
> Yes, I verified the patch below fixes step-jump-cont.c on
> ibm-js20-02.lab.bos.redhat.com.

Checked-in a similar patch but same as used now in other testcases, sorry for
not using the patch of yours.


Regards,
Jan


--- step-jump-cont.c    8 Dec 2008 18:23:41 -0000       1.12
+++ step-jump-cont.c    14 Dec 2009 11:38:37 -0000      1.13
@@ -213,6 +213,24 @@ int main (void)
   REGS_ACCESS (regs, eip) = (unsigned long) raise_sigusr2;
 #elif defined __x86_64__
   REGS_ACCESS (regs, rip) = (unsigned long) raise_sigusr2;
+#elif defined __powerpc64__
+  {
+    /* ppc64 `raise_sigusr2' resolves to the function descriptor.  */
+    union
+      {
+       void (*f) (void);
+       struct
+         {
+           void *entry;
+           void *toc;
+         }
+       *p;
+      }
+    const func_u = { raise_sigusr2 };
+
+    REGS_ACCESS (regs, nip) = (unsigned long) func_u.p->entry;
+    REGS_ACCESS (regs, gpr[2]) = (unsigned long) func_u.p->toc;
+  }
 #elif defined __powerpc__
   REGS_ACCESS (regs, nip) = (unsigned long) raise_sigusr2;
 #else

Reply via email to