This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/20287] X32 and "gdb_static_assert (sizeof (nat_siginfo_t) == sizeof (siginfo_t))"
- From: "palves at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Fri, 24 Jun 2016 14:08:29 +0000
- Subject: [Bug gdb/20287] X32 and "gdb_static_assert (sizeof (nat_siginfo_t) == sizeof (siginfo_t))"
- Auto-submitted: auto-generated
- References: <bug-20287-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20287
--- Comment #30 from Pedro Alves <palves at redhat dot com> ---
OK, so PTRACE_GETSIGINFO returns a x32 siginfo_t object when the ptracer is a
x32 process.
So the correct fix is indeed to make nat_siginfo_t match the x32 siginfo, when
gdb is built as an x32 program.
However, it doesn't look like it's just the padding that is wrong. We have
this:
/* For native 64-bit, clock_t in _sigchld is 64bit aligned at 4 bytes. */
typedef long __attribute__ ((__aligned__ (4))) nat_clock_t;
However, /usr/include/bits/siginfo.h has:
# if defined __x86_64__ && __WORDSIZE == 32
/* si_utime and si_stime must be 4 byte aligned for x32 to match the
kernel. We align siginfo_t to 8 bytes so that si_utime and si_stime
are actually aligned to 8 bytes since their offsets are multiple of
8 bytes. */
typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t;
# define __SI_ALIGNMENT __attribute__ ((__aligned__ (8)))
# else
typedef __clock_t __sigchld_clock_t;
# define __SI_ALIGNMENT
# endif
So we're currently forcing 4-byte alignment on clock_t, when it should only be
so for x32, not 64-bit?
--
You are receiving this mail because:
You are on the CC list for the bug.