OSDN Git Service

linux-user: Use correct alignment for long long on i386 guests
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 28 Jul 2016 11:57:59 +0000 (12:57 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Thu, 4 Aug 2016 13:34:59 +0000 (16:34 +0300)
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>
include/exec/user/abitypes.h

index a09d6c6..ba18860 100644 (file)
 #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