This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] S/390: Make struct elf_prstatus packed
- From: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 22 Jul 2013 09:46:54 +0200
- Subject: [PATCH] S/390: Make struct elf_prstatus packed
Hi,
the elf_prstatus structure should be packed since it otherwise is
padded by the compiler on 32 bit builds by 4 bytes.
I've verified that the member offsets don't change on 32 and 64 bits.
I'll apply the patch after the branch is open again.
Bye,
-Andreas-
2013-07-22 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* sysdeps/unix/sysv/linux/s390/sys/procfs.h (struct elf_prstatus):
Add `packed' attribute.
---
sysdeps/unix/sysv/linux/s390/sys/procfs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: glibc/sysdeps/unix/sysv/linux/s390/sys/procfs.h
===================================================================
--- glibc.orig/sysdeps/unix/sysv/linux/s390/sys/procfs.h
+++ glibc/sysdeps/unix/sysv/linux/s390/sys/procfs.h
@@ -61,6 +61,7 @@ struct elf_prstatus
{
struct elf_siginfo pr_info; /* Info associated with signal. */
short int pr_cursig; /* Current signal. */
+ short int padding;
unsigned long int pr_sigpend; /* Set of pending signals. */
unsigned long int pr_sighold; /* Set of held signals. */
__pid_t pr_pid;
@@ -73,7 +74,7 @@ struct elf_prstatus
struct timeval pr_cstime; /* Cumulative system time. */
elf_gregset_t pr_reg; /* GP registers. */
int pr_fpvalid; /* True if math copro being used. */
- };
+} __attribute__ ((__packed__));
#define ELF_PRARGSZ (80) /* Number of chars for args. */