diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-05-23 12:53:18 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-05-23 12:53:18 +0000 |
commit | cf575ca8561c53ef8299e9efcebb9dce96de2ff0 (patch) | |
tree | fbba0514cabc2a2b017d4e2c651470efd5b99ce8 | |
parent | 61082ec1cccd25495ee102ba80a42e55eafe1b27 (diff) | |
download | busybox-w32-cf575ca8561c53ef8299e9efcebb9dce96de2ff0.tar.gz busybox-w32-cf575ca8561c53ef8299e9efcebb9dce96de2ff0.tar.bz2 busybox-w32-cf575ca8561c53ef8299e9efcebb9dce96de2ff0.zip |
- optionally pass additional flags down to nm
-rw-r--r-- | coreutils/false.c | 2 | ||||
-rwxr-xr-x | scripts/bloat-o-meter | 15 |
2 files changed, 11 insertions, 6 deletions
diff --git a/coreutils/false.c b/coreutils/false.c index 5beb58a28..e3121363c 100644 --- a/coreutils/false.c +++ b/coreutils/false.c | |||
@@ -8,7 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | /* BB_AUDIT SUSv3 compliant */ | 10 | /* BB_AUDIT SUSv3 compliant */ |
11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/false.html */ | 11 | /* http://www.opengroup.org/onlinepubs/000095399/utilities/false.html */ |
12 | 12 | ||
13 | #include "libbb.h" | 13 | #include "libbb.h" |
14 | 14 | ||
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index 76d342cae..02e8c8a0f 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter | |||
@@ -9,24 +9,29 @@ | |||
9 | 9 | ||
10 | import sys, os, re | 10 | import sys, os, re |
11 | 11 | ||
12 | if len(sys.argv) != 3: | 12 | def usage(): |
13 | sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0]) | 13 | sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0]) |
14 | sys.exit(-1) | 14 | sys.exit(-1) |
15 | 15 | ||
16 | if len(sys.argv) < 3: | ||
17 | usage() | ||
18 | |||
16 | for f in sys.argv[1], sys.argv[2]: | 19 | for f in sys.argv[1], sys.argv[2]: |
17 | if not os.path.exists(f): | 20 | if not os.path.exists(f): |
18 | sys.stderr.write("Error: file '%s' does not exist\n" % f) | 21 | sys.stderr.write("Error: file '%s' does not exist\n" % f) |
19 | sys.exit(-1) | 22 | usage() |
20 | 23 | ||
24 | nm_args = " ".join([x for x in sys.argv[3:]]) | ||
21 | def getsizes(file): | 25 | def getsizes(file): |
22 | sym = {} | 26 | sym = {} |
23 | for l in os.popen("nm --size-sort " + file).readlines(): | 27 | for l in os.popen("nm --size-sort %s %s" % (nm_args, file)).readlines(): |
28 | l = l.strip() | ||
24 | # Skip empty lines | 29 | # Skip empty lines |
25 | if not len(l.strip()): continue | 30 | if not len(l): continue |
26 | # Skip archive members | 31 | # Skip archive members |
27 | if len(l.split()) == 1 and l.endswith(':'): | 32 | if len(l.split()) == 1 and l.endswith(':'): |
28 | continue | 33 | continue |
29 | size, type, name = l[:-1].split() | 34 | size, type, name = l.split() |
30 | if type in "tTdDbBrR": | 35 | if type in "tTdDbBrR": |
31 | if "." in name: name = "static." + name.split(".")[0] | 36 | if "." in name: name = "static." + name.split(".")[0] |
32 | sym[name] = sym.get(name, 0) + int(size, 16) | 37 | sym[name] = sym.get(name, 0) + int(size, 16) |