summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2007-03-19 16:04:11 +0000
committerDenis Vlasenko2007-03-19 16:04:11 +0000
commit3d101dd4670e449a064bd8ea88d5343d83144f49 (patch)
tree659c174c2656c573b167bfd0f314caf4c18101f0
parentbe862096c0b07c42dd3f2f6e3530716efe0fc83c (diff)
downloadbusybox-3d101dd4670e449a064bd8ea88d5343d83144f49.zip
busybox-3d101dd4670e449a064bd8ea88d5343d83144f49.tar.gz
expand documentation
-rw-r--r--docs/keep_data_small.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/keep_data_small.txt b/docs/keep_data_small.txt
index 66f92b3..fcd8df4 100644
--- a/docs/keep_data_small.txt
+++ b/docs/keep_data_small.txt
@@ -125,3 +125,32 @@ less readable, use #defines:
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",@nobits
+- .align 32
++ .align 4
+ .type term_orig, @object
+ .size term_orig, 60
+ term_orig:
+ .zero 60
+ .section .bss.term_vi,"aw",@nobits
+- .align 32
++ .align 4
+ .type term_vi, @object
+ .size term_vi, 60
+
+gcc doesn't seem to have options for altering this behaviour.