svn commit: trunk/busybox/docs
vda at busybox.net
vda at busybox.net
Mon Mar 19 16:04:11 UTC 2007
Author: vda
Date: 2007-03-19 09:04:11 -0700 (Mon, 19 Mar 2007)
New Revision: 18165
Log:
expand documentation
Modified:
trunk/busybox/docs/keep_data_small.txt
Changeset:
Modified: trunk/busybox/docs/keep_data_small.txt
===================================================================
--- trunk/busybox/docs/keep_data_small.txt 2007-03-19 15:15:06 UTC (rev 18164)
+++ trunk/busybox/docs/keep_data_small.txt 2007-03-19 16:04:11 UTC (rev 18165)
@@ -125,3 +125,32 @@
If applet doesn't use much of global data, converting it to use
one of above methods is not worth the resulting code obfuscation.
If you have less than ~300 bytes of global data - don't bother.
+
+
+ gcc's data alignment problem
+
+The following attribute added in vi.c:
+
+static int tabstop;
+static struct termios term_orig __attribute__ ((aligned (4)));
+static struct termios term_vi __attribute__ ((aligned (4)));
+
+reduced bss size by 32 bytes, because gcc sometimes aligns structures to
+ridiculously large values. asm output diff for above example:
+
+ tabstop:
+ .zero 4
+ .section .bss.term_orig,"aw", at nobits
+- .align 32
++ .align 4
+ .type term_orig, @object
+ .size term_orig, 60
+ term_orig:
+ .zero 60
+ .section .bss.term_vi,"aw", at nobits
+- .align 32
++ .align 4
+ .type term_vi, @object
+ .size term_vi, 60
+
+gcc doesn't seem to have options for altering this behaviour.
More information about the busybox-cvs
mailing list