summaryrefslogtreecommitdiff
path: root/scripts/find_stray_common_vars
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/find_stray_common_vars')
-rwxr-xr-xscripts/find_stray_common_vars10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/find_stray_common_vars b/scripts/find_stray_common_vars
new file mode 100755
index 0000000..9f26bc7
--- /dev/null
+++ b/scripts/find_stray_common_vars
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Common variables are elusive, they don't show up in size output!
+# This script will show all commons in *.o, sorted by size
+
+find -name '*.o' \
+| while read name; do
+ b=`basename "$name"`
+ nm "$name" | sed "s/^/$b: /"
+done | grep -i ' c ' | sort -k2