|
From: <sv...@va...> - 2012-06-27 14:14:36
|
petarj 2012-06-27 15:14:26 +0100 (Wed, 27 Jun 2012)
New Revision: 12677
Log:
Calculate the size of vki_elf_gregset_t via operator sizeof on MIPS platforms.
The value VKI_ELF_NGREG is now defined with the the help of operator sizeof.
Incorrect size triggered an assertion in the file coredump-elf.c.
The issue was reported as coredump problem at:
https://bugs.kde.org/show_bug.cgi?id=270777
Modified files:
trunk/include/vki/vki-mips32-linux.h
Modified: trunk/include/vki/vki-mips32-linux.h (+16 -16)
===================================================================
--- trunk/include/vki/vki-mips32-linux.h 2012-06-26 12:30:18 +01:00 (rev 12676)
+++ trunk/include/vki/vki-mips32-linux.h 2012-06-27 15:14:26 +01:00 (rev 12677)
@@ -660,22 +660,6 @@
short revents;
};
//----------------------------------------------------------------------
-// From linux-2.6.35.5/include/asm-mips/elf.h
-//----------------------------------------------------------------------
-
-#define VKI_ELF_NGREG 45 /* includes nip, msr, lr, etc. */
-#define VKI_ELF_NFPREG 33 /* includes fpscr */
-
-typedef unsigned long vki_elf_greg_t;
-typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG];
-
-typedef double vki_elf_fpreg_t;
-typedef vki_elf_fpreg_t vki_elf_fpregset_t[VKI_ELF_NFPREG];
-
-typedef struct vki_user_fxsr_struct vki_elf_fpxregset_t;
-
-#define VKI_AT_SYSINFO 32
-//----------------------------------------------------------------------
// From linux-2.6.35.5/include/asm-mips/ucontext.h
//----------------------------------------------------------------------
@@ -868,6 +852,22 @@
#define VKI_PTRACE_GETFPREGS 14
#define VKI_PTRACE_SETFPREGS 15
//----------------------------------------------------------------------
+// From linux-2.6.35.5/include/asm-mips/elf.h
+//----------------------------------------------------------------------
+typedef unsigned long vki_elf_greg_t;
+
+#define VKI_ELF_NGREG (sizeof (struct vki_user_regs_struct) / sizeof(vki_elf_greg_t))
+#define VKI_ELF_NFPREG 33 /* includes fpscr */
+
+typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG];
+
+typedef double vki_elf_fpreg_t;
+typedef vki_elf_fpreg_t vki_elf_fpregset_t[VKI_ELF_NFPREG];
+
+typedef struct vki_user_fxsr_struct vki_elf_fpxregset_t;
+
+#define VKI_AT_SYSINFO 32
+//----------------------------------------------------------------------
// From linux-2.6.35.5/include/asm-generic/siginfo.h
//----------------------------------------------------------------------
#define HAVE_ARCH_SIGINFO_T
|