File tree 2 files changed +16
-10
lines changed
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:
138
138
#define sector (G.sector)
139
139
140
140
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
-
148
141
Finding non-shared duplicated strings
149
142
150
143
strings busybox | sort | uniq -c | sort -nr
@@ -224,6 +217,14 @@ Result (non-static busybox built against glibc):
224
217
225
218
Keeping code small
226
219
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
+
227
228
Set CONFIG_EXTRA_CFLAGS="-fno-inline-functions-called-once",
228
229
produce "make bloatcheck", see the biggest auto-inlined functions.
229
230
Now, set CONFIG_EXTRA_CFLAGS back to "", but add NOINLINE
Original file line number Diff line number Diff line change 7
7
# This software may be used and distributed according to the terms
8
8
# of the GNU General Public License, incorporated herein by reference.
9
9
10
- import sys , os #, re
10
+ import sys , os
11
11
12
12
def 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 )
15
18
16
19
f1 , f2 = (None , None )
17
20
flag_timing , dashes = (False , False )
@@ -31,6 +34,8 @@ for f in sys.argv[1:]:
31
34
f1 = f
32
35
elif f2 is None :
33
36
f2 = f
37
+ else :
38
+ usage ()
34
39
if flag_timing :
35
40
import time
36
41
if f1 is None or f2 is None :
You can’t perform that action at this time.
0 commit comments