aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-07-28 12:57:59 +0100
committerRiku Voipio <riku.voipio@linaro.org>2016-07-31 15:55:55 +0300
commitb140dbc52e498a91a5f05cf822ab5de571916c4f (patch)
tree08a4ce9c404a674f0071a3f6361e095a6c447f3b
parentbd3cc8c5fae6f015ebad4725ba8a2165a381f974 (diff)
downloadqemu-for-next.tar.gz
linux-user: Use correct alignment for long long on i386 guestsfor-next
For i386, the ABI specifies that 'long long' (8 byte values) need only be 4 aligned, but we were requiring them to be 8-aligned. This meant we were laying out the target_epoll_event structure wrongly. Add a suitable ifdef to abitypes.h to specify the i386-specific alignment requirement. Reported-by: Icenowy Zheng <icenowy@aosc.xyz> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rw-r--r--include/exec/user/abitypes.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h
index a09d6c64ff..ba188608c2 100644
--- a/include/exec/user/abitypes.h
+++ b/include/exec/user/abitypes.h
@@ -15,6 +15,10 @@
#define ABI_LLONG_ALIGNMENT 2
#endif
+#if defined(TARGET_I386) && !defined(TARGET_X86_64)
+#define ABI_LLONG_ALIGNMENT 4
+#endif
+
#ifndef ABI_SHORT_ALIGNMENT
#define ABI_SHORT_ALIGNMENT 2
#endif