This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] S/390: Make struct elf_prstatus packed
- From: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 22 Jul 2013 16:25:58 +0200
- Subject: Re: [PATCH] S/390: Make struct elf_prstatus packed
- References: <20130722074654 dot GA13428 at bart> <mvmsiz73u6d dot fsf at hawking dot suse dot de>
On 22/07/13 09:55, Andreas Schwab wrote:
> Andreas Krebbel <krebbel@linux.vnet.ibm.com> writes:
>
>> the elf_prstatus structure should be packed since it otherwise is
>> padded by the compiler on 32 bit builds by 4 bytes.
>
> This will change the alignment of the structure to 1.
elf_prstatus seems to be inconsistent for 32 bit vs. 32 bit compat. For 32 bit the register set is
aligned to 8 bytes but for 32 bit compat it isn't. The kernel always aligns it. So the patch should
be something like this:
Index: glibc/sysdeps/unix/sysv/linux/s390/sys/procfs.h
===================================================================
--- glibc.orig/sysdeps/unix/sysv/linux/s390/sys/procfs.h 2013-07-22 15:30:22.000000000 +0200
+++ glibc/sysdeps/unix/sysv/linux/s390/sys/procfs.h 2013-07-22 15:58:13.952657674 +0200
@@ -123,7 +123,8 @@ typedef struct elf_prpsinfo prpsinfo_t;
core files. */
#define ELF_NGREG32 36
typedef unsigned int elf_greg_t32;
-typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32];
+typedef elf_greg_t32
+ elf_gregset_t32[ELF_NGREG32] __attribute__ ((__aligned__ (8)));
typedef elf_fpregset_t elf_fpregset_t32;
struct elf_prstatus32
Bye,
-Andreas-