Skip to contentSkip to conversation

Win32: Reduce section alignment for Windows.

PATCH In review Stefan Weil 2 participants 2 messages Jun 18, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Win32: Reduce section alignment for Windows.

Maximum alignment for Win32 is 16, so don't try to set it to 32. Otherwise the compiler complains:

exec.c:102: warning: alignment of 'code_gen_prologue' is greater than maximum object file alignment. Using 16

---
 exec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
exec.c +4 -0
index 92ee4e2..688f603 100644
@@ -94,6 +94,10 @@ spinlock_t tb_lock = SPIN_LOCK_UNLOCKED;
 #define code_gen_section                                \
     __attribute__((__section__(".gen_code")))           \
     __attribute__((aligned (32)))
+#elif defined(_WIN32)
+/* Maximum alignment for Win32 is 16. */
+#define code_gen_section                                \
+    __attribute__((aligned (16)))
 #else
 #define code_gen_section                                \
     __attribute__((aligned (32)))
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 3 lines · Stefan Weil

Maximum alignment for Win32 is 16, so don't try to set it to 32. Otherwise the compiler complains:

Isn't 16 enough on other platforms? For Win32 8 seems to be quite enough.