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) STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging else CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG - LDFLAGS += -s -Wl,-warn-common + LDFLAGS += -Wl,-warn-common STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment endif ifeq ($(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, trust PayPal...
+
+ To conserve bytes it's good to know where they're being used, and the + size of the final executable isn't always a reliable indicator of + the size of the components (since various structures are rounded up, + so a small change may not even be visible by itself, but many small + savings add up). +
++ To examine a busybox binary with an eye to saving bytes, build an + optimized debug version and run the "nm" command against it, like so: +
++ make clean && make STRIPCMD=/bin/true && nm --size-sort busybox +
++ This gives a list of symbols and the amount of space allocated for + each one, sorted by size. (Note: do not enable CONFIG_DEBUG for this, + as that disables compiler optimization which is great for running gdb + but misleading when trying to figure out how much space each component + is really using under normal circumstances.) +
+