File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -138,13 +138,6 @@ less readable, use #defines:
138138#define sector (G.sector)
139139
140140
141- Word of caution
142-
143- If applet doesn't use much of global data, converting it to use
144- one of above methods is not worth the resulting code obfuscation.
145- If you have less than ~300 bytes of global data - don't bother.
146-
147-
148141 Finding non-shared duplicated strings
149142
150143strings busybox | sort | uniq -c | sort -nr
@@ -224,6 +217,14 @@ Result (non-static busybox built against glibc):
224217
225218 Keeping code small
226219
220+ Use scripts/bloat-o-meter to check whether introduced changes
221+ didn't generate unnecessary bloat. This script needs unstripped binaries
222+ to generate a detailed report. To automate this, just use
223+ "make bloatcheck". It requires busybox_old binary to be present,
224+ use "make baseline" to generate it from unmodified source, or
225+ copy busybox_unstripped to busybox_old before modifying sources
226+ and rebuilding.
227+
227228Set CONFIG_EXTRA_CFLAGS="-fno-inline-functions-called-once",
228229produce "make bloatcheck", see the biggest auto-inlined functions.
229230Now, set CONFIG_EXTRA_CFLAGS back to "", but add NOINLINE
Original file line number Diff line number Diff line change 77# This software may be used and distributed according to the terms
88# of the GNU General Public License, incorporated herein by reference.
99
10- import sys , os #, re
10+ import sys , os
1111
1212def usage ():
13- sys .stderr .write ("usage: %s [-t] file1 file2\n " % sys .argv [0 ])
14- sys .exit (- 1 )
13+ sys .stderr .write ("usage: %s [-t] file1 file2 [-- <readelf options>]\n "
14+ % sys .argv [0 ])
15+ sys .stderr .write ("\t -t\t Show time spent on parsing/processing\n " )
16+ sys .stderr .write ("\t --\t Pass additional parameters to readelf\n " )
17+ sys .exit (1 )
1518
1619f1 , f2 = (None , None )
1720flag_timing , dashes = (False , False )
@@ -31,6 +34,8 @@ for f in sys.argv[1:]:
3134 f1 = f
3235 elif f2 is None :
3336 f2 = f
37+ else :
38+ usage ()
3439if flag_timing :
3540 import time
3641if f1 is None or f2 is None :
You can’t perform that action at this time.
0 commit comments