aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/keep_data_small.txt28
1 files changed, 26 insertions, 2 deletions
diff --git a/docs/keep_data_small.txt b/docs/keep_data_small.txt
index 15e41aefd..3c3d27396 100644
--- a/docs/keep_data_small.txt
+++ b/docs/keep_data_small.txt
@@ -178,5 +178,29 @@ struct {
178char vc31[31] = { 1 }; // unaligned 178char vc31[31] = { 1 }; // unaligned
179char vc32[32] = { 1 }; // aligned to 32 bytes 179char vc32[32] = { 1 }; // aligned to 32 bytes
180 180
181-fpack-struct=1 reduces alignment of s28 to 1 (but probably will break layout 181-fpack-struct=1 reduces alignment of s28 to 1 (but probably
182of many libc structs) but s32 and vc32 are still aligned to 32 bytes. 182will break layout of many libc structs) but s32 and vc32
183are still aligned to 32 bytes.
184
185I will try to cook up a patch to add a gcc option for disabling it.
186Meanwhile, this is where it can be disabled in gcc source:
187
188gcc/config/i386/i386.c
189int
190ix86_data_alignment (tree type, int align)
191{
192#if 0
193 if (AGGREGATE_TYPE_P (type)
194 && TYPE_SIZE (type)
195 && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
196 && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 256
197 || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 256)
198 return 256;
199#endif
200
201Result (non-static busybox built against glibc):
202
203# size /usr/srcdevel/bbox/fix/busybox.t0/busybox busybox
204 text data bss dec hex filename
205 634416 2736 23856 661008 a1610 busybox
206 632580 2672 22944 658196 a0b14 busybox_noalign