]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix MIPS n32 pr_sigpend, pr_sighold, pr_flag type (bug 23656).
authorJoseph Myers <joseph@codesourcery.com>
Fri, 14 Sep 2018 16:02:57 +0000 (16:02 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 14 Sep 2018 16:02:57 +0000 (16:02 +0000)
As discussed at
<https://sourceware.org/ml/libc-alpha/2018-09/msg00191.html> and
followup discussions, the MIPS n32 definitions of pr_sigpend and
pr_sighold in struct elf_prstatus, and pr_flag in struct elf_prpsinfo,
are wrong to use unsigned long long int; actual n32 core dumps use a
32-bit type there, so userspace unsigned long int is correct for all
MIPS ABIs.  This patch removes the conditionals (also thereby aligning
the structures with other architectures and so facilitating future
unification of different versions of this header).

Tested with build-many-glibcs.py for its MIPS configurations.

[BZ #23656]
* sysdeps/unix/sysv/linux/mips/sys/procfs.h (struct elf_prstatus):
Remove [_MIPS_SIM = _ABIN32] conditional case.
(struct elf_prpsinfo): Likewise.

ChangeLog
NEWS
sysdeps/unix/sysv/linux/mips/sys/procfs.h

index 28ec6df0f319c686841e112c87cd10e4b24acde1..99a560f233e8e1f685f3c0c306d51a740583e8d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2018-09-14  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #23656]
+       * sysdeps/unix/sysv/linux/mips/sys/procfs.h (struct elf_prstatus):
+       Remove [_MIPS_SIM = _ABIN32] conditional case.
+       (struct elf_prpsinfo): Likewise.
+
        [BZ #23649]
        * sysdeps/unix/sysv/linux/microblaze/sys/procfs.h (struct
        elf_prpsinfo): Use unsigned int for pr_uid and pr_gid.
diff --git a/NEWS b/NEWS
index dbb86a73a3d0b89df2e7f16f3baaa9e6a16abbce..f76ada94d3dd278e22f034d0ae28c6a898d6874d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,12 @@ Deprecated and removed features, and other changes affecting compatibility:
   the Linux kernel.  This affects the size and layout of that structure on
   MicroBlaze, MIPS (n64 ABI only), Nios II and RISC-V.
 
+* For the MIPS n32 ABI, the type of the pr_sigpend and pr_sighold members of
+  struct elf_prstatus, and the pr_flag member of struct elf_prpsinfo,
+  defined in <sys/procfs.h>, has been corrected to match the type actually
+  used by the Linux kernel.  This affects the size and layout of those
+  structures.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
index 523317dec788f25340f6078437e2b279b15248fc..6c4227781a59bf2c17ee9d9d7f071e8aacba3c98 100644 (file)
@@ -64,13 +64,8 @@ struct elf_prstatus
   {
     struct elf_siginfo pr_info;                /* Info associated with signal.  */
     short int pr_cursig;               /* Current signal.  */
-#if _MIPS_SIM == _ABIN32
-    __extension__ unsigned long long int pr_sigpend;
-    __extension__ unsigned long long int pr_sighold;
-#else
     unsigned long int pr_sigpend;      /* Set of pending signals.  */
     unsigned long int pr_sighold;      /* Set of held signals.  */
-#endif
     __pid_t pr_pid;
     __pid_t pr_ppid;
     __pid_t pr_pgrp;
@@ -92,11 +87,7 @@ struct elf_prpsinfo
     char pr_sname;                     /* Char for pr_state.  */
     char pr_zomb;                      /* Zombie.  */
     char pr_nice;                      /* Nice val.  */
-#if _MIPS_SIM == _ABIN32
-    __extension__ unsigned long long int pr_flag;
-#else
     unsigned long int pr_flag;         /* Flags.  */
-#endif
     unsigned int pr_uid;
     unsigned int pr_gid;
     int pr_pid, pr_ppid, pr_pgrp, pr_sid;