From e07530731673b8c677882244e98f57c0df34529e Mon Sep 17 00:00:00 2001 From: Edmund Grimley Evans Date: Sat, 18 Jan 2025 07:00:59 +0000 Subject: [PATCH] i#3699 ARM: Add ALIGN_VAR(8) to _dr_simd_t. 2dfd7cb46 made the size of priv_mcontext_t a multiple of 8, enabling alignment when the struct is pushed onto the stack by assembly code. This patch adds ALIGN_VAR(8) to the definition of _dr_simd_t so that alignment is also enforced by the compiler. Change-Id: I3afd0a9babfe4091f414fb72a569ffd480db5985 --- api/docs/release.dox | 6 +++--- core/lib/globals_api.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/docs/release.dox b/api/docs/release.dox index 5f2c8ef344f..0893ffade16 100644 --- a/api/docs/release.dox +++ b/api/docs/release.dox @@ -126,9 +126,9 @@ clients. The changes between version \DR_VERSION and 11.3.0 include the following compatibility changes: - - The size of #dr_mcontext_t on 32-bit Arm has been increased by 4 so that - the struct can be pushed onto the 8-byte aligned stack without additional - padding. The offset of the field "simd" has changed. + - On 32-bit Arm the size of #dr_mcontext_t has been increased by 4 and the + struct is now required to be 8-byte aligned. The offset of the field "simd" + has changed. Further non-compatibility-affecting changes include: - Added support for reading a single drmemtrace trace file from stdin diff --git a/core/lib/globals_api.h b/core/lib/globals_api.h index 9d7664483c5..c5fde065de9 100644 --- a/core/lib/globals_api.h +++ b/core/lib/globals_api.h @@ -744,7 +744,7 @@ typedef union _dr_svep_t { */ typedef dr_svep_t dr_ffr_t; # else -typedef union _dr_simd_t { +typedef union ALIGN_VAR(8) _dr_simd_t { uint s[4]; /**< Representation as 4 32-bit Sn elements. */ uint d[4]; /**< Representation as 2 64-bit Dn elements: d[3]:d[2]; d[1]:d[0]. */ uint u32[4]; /**< The full 128-bit register. */