diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-20 15:53:11 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-20 15:53:11 +0000 |
commit | f36306502108c35c574c3f2eb0b7b6d93a0a483e (patch) | |
tree | 9f3eddbcefac04263b8fd5caffb9fe5a164b548e /docs | |
parent | c86e052b81210e762f8ca6b79cb46b8c4bdfbfe0 (diff) | |
download | busybox-w32-f36306502108c35c574c3f2eb0b7b6d93a0a483e.tar.gz busybox-w32-f36306502108c35c574c3f2eb0b7b6d93a0a483e.tar.bz2 busybox-w32-f36306502108c35c574c3f2eb0b7b6d93a0a483e.zip |
small doc update
Diffstat (limited to 'docs')
-rw-r--r-- | docs/keep_data_small.txt | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/docs/keep_data_small.txt b/docs/keep_data_small.txt index 72de2d1ef..15e41aefd 100644 --- a/docs/keep_data_small.txt +++ b/docs/keep_data_small.txt | |||
@@ -163,14 +163,20 @@ ridiculously large values. asm output diff for above example: | |||
163 | 163 | ||
164 | gcc doesn't seem to have options for altering this behaviour. | 164 | gcc doesn't seem to have options for altering this behaviour. |
165 | 165 | ||
166 | gcc 3.4.3: | 166 | gcc 3.4.3 and 4.1.1 tested: |
167 | char c = 1; | ||
167 | // gcc aligns to 32 bytes if sizeof(struct) >= 32 | 168 | // gcc aligns to 32 bytes if sizeof(struct) >= 32 |
168 | struct st { | 169 | struct { |
169 | int c_iflag,c_oflag,c_cflag,c_lflag; | 170 | int a,b,c,d; |
170 | int i1,i2,i3; // struct will be aligned to 4 bytes | 171 | int i1,i2,i3; |
171 | // int i1,i2,i3,i4; // struct will be aligned to 32 bytes | 172 | } s28 = { 1 }; // struct will be aligned to 4 bytes |
172 | }; | 173 | struct { |
173 | struct st t = { 1 }; | 174 | int a,b,c,d; |
175 | int i1,i2,i3,i4; | ||
176 | } s32 = { 1 }; // struct will be aligned to 32 bytes | ||
174 | // same for arrays | 177 | // same for arrays |
175 | char vc31[31] = { 1 }; // unaligned | 178 | char vc31[31] = { 1 }; // unaligned |
176 | char vc32[32] = { 1 }; // aligned to 32 bytes | 179 | char vc32[32] = { 1 }; // aligned to 32 bytes |
180 | |||
181 | -fpack-struct=1 reduces alignment of s28 to 1 (but probably will break layout | ||
182 | of many libc structs) but s32 and vc32 are still aligned to 32 bytes. | ||