has_dumped = 1;
        current->flags |= PF_DUMPCORE;
        strncpy(dump.u_comm, current->comm, sizeof(current->comm));
-       dump.u_ar0 = (u32)(((unsigned long)(&dump.regs)) -
-                          ((unsigned long)(&dump)));
+       dump.u_ar0 = offsetof(struct user32, regs);
        dump.signal = signr;
        dump_thread32(regs, &dump);
 
 
        current->flags |= PF_DUMPCORE;
                strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
 #ifndef __sparc__
-       dump.u_ar0 = (void *)(((unsigned long)(&dump.regs)) - ((unsigned long)(&dump)));
+       dump.u_ar0 = offsetof(struct user, regs);
 #endif
        dump.signal = signr;
        dump_thread(regs, &dump);
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
 
                                   esp register.  */
   long int signal;                     /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
-  struct pt_regs * u_ar0;      /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   unsigned long magic;         /* To uniquely identify a core file */
   char u_comm[32];             /* User command that was responsible */
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
 
                                           esp register.  */
        long int signal;        /* Signal that caused the core dump. */
        int reserved;           /* No longer used */
-       struct user_regs_struct *u_ar0;
+       unsigned long u_ar0;
        /* Used by gdb to help find the values for */
        /* the registers. */
        unsigned long magic;    /* To uniquely identify a core file */
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
 
                                   esp register.  */
   long int signal;                     /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
-  struct user_regs_struct *u_ar0;
-                               /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   unsigned long magic;         /* To uniquely identify a core file */
   char u_comm[32];             /* User command that was responsible */
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
 
                                   esp register.  */
   long int signal;             /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
-  struct user_regs_struct *u_ar0;
-                               /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   struct user_m68kfp_struct* u_fpstate;        /* Math Co-processor pointer. */
   unsigned long magic;         /* To uniquely identify a core file */
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
 
                                   the top of the stack is always found in the
                                   esp register.  */
   long int signal;                     /* Signal that caused the core dump. */
-  struct user_regs_struct *u_ar0;
-                               /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   unsigned long magic;         /* To uniquely identify a core file */
   char u_comm[32];             /* User command that was responsible */
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        struct user_fpu_struct* u_fpstate;      /* Math Co-processor pointer */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
 
                                   esp register.  */
   long int signal;                     /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
-  struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   struct user_i387_struct* u_fpstate;  /* Math Co-processor pointer. */
   unsigned long magic;         /* To uniquely identify a core file */
 
   long int signal;             /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
   int pad1;
-  struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   struct user_i387_struct* u_fpstate;  /* Math Co-processor pointer. */
   unsigned long magic;         /* To uniquely identify a core file */