This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] S/390: Make struct elf_prstatus packed


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-


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]