aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-07-31 04:25:00 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-07-31 04:25:00 +0000
commit7599c37f1cd240b62010ea6b17ae50514973385e (patch)
tree4a4f40c2424b42f18e609bae3357adca2a31eac9
parent0e020b66a36bf9b1fa8f9c1ad959d20b7996ba78 (diff)
downloadbusybox-w32-7599c37f1cd240b62010ea6b17ae50514973385e.tar.gz
busybox-w32-7599c37f1cd240b62010ea6b17ae50514973385e.tar.bz2
busybox-w32-7599c37f1cd240b62010ea6b17ae50514973385e.zip
Fix "nm --size-sort" on the busybox binary and document how to make it work.
git-svn-id: svn://busybox.net/trunk/busybox@10991 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--Rules.mak2
-rw-r--r--docs/busybox.net/FAQ.html87
2 files changed, 27 insertions, 62 deletions
diff --git a/Rules.mak b/Rules.mak
index 73adf80a0..66edaca9f 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -169,7 +169,7 @@ ifeq ($(strip $(CONFIG_DEBUG)),y)
169 STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging 169 STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
170else 170else
171 CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG 171 CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
172 LDFLAGS += -s -Wl,-warn-common 172 LDFLAGS += -Wl,-warn-common
173 STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment 173 STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment
174endif 174endif
175ifeq ($(strip $(CONFIG_STATIC)),y) 175ifeq ($(strip $(CONFIG_STATIC)),y)
diff --git a/docs/busybox.net/FAQ.html b/docs/busybox.net/FAQ.html
index a2264f9fe..a2d20bf5c 100644
--- a/docs/busybox.net/FAQ.html
+++ b/docs/busybox.net/FAQ.html
@@ -246,68 +246,33 @@ have additions to this FAQ document, we would love to add them,
246 trust PayPal... 246 trust PayPal...
247 247
248<hr /> 248<hr />
249<p>
250<h2><a name="optimize">I want to make busybox even smaller, how do I go about it?</a></h2>
251<p>
252 To conserve bytes it's good to know where they're being used, and the
253 size of the final executable isn't always a reliable indicator of
254 the size of the components (since various structures are rounded up,
255 so a small change may not even be visible by itself, but many small
256 savings add up).
257</p>
258<p>
259 To examine a busybox binary with an eye to saving bytes, build an
260 optimized debug version and run the "nm" command against it, like so:
261</p>
262<p>
263 make clean && make STRIPCMD=/bin/true && nm --size-sort busybox
264</p>
265<p>
266 This gives a list of symbols and the amount of space allocated for
267 each one, sorted by size. (Note: do not enable CONFIG_DEBUG for this,
268 as that disables compiler optimization which is great for running gdb
269 but misleading when trying to figure out how much space each component
270 is really using under normal circumstances.)
271</p>
272<hr />
273
274
249 275
250<br>
251<br>
252<br>
253<br>
254<br>
255<br>
256<br>
257<br>
258<br>
259<br>
260<br>
261<br>
262<br>
263<br>
264<br>
265<br>
266<br>
267<br>
268<br>
269<br>
270<br>
271<br>
272<br>
273<br>
274<br>
275<br>
276<br>
277<br>
278<br>
279<br>
280<br>
281<br>
282<br>
283<br>
284<br>
285<br>
286<br>
287<br>
288<br>
289<br>
290<br>
291<br>
292<br>
293<br>
294<br>
295<br>
296<br>
297<br>
298<br>
299<br>
300<br>
301<br>
302<br>
303<br>
304<br>
305<br>
306<br>
307<br>
308<br>
309<br>
310<br>
311<br> 276<br>
312<br> 277<br>
313<br> 278<br>