summaryrefslogtreecommitdiff
path: root/hack/analyses/nm-symbols-analysis.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hack/analyses/nm-symbols-analysis.sh')
-rwxr-xr-xhack/analyses/nm-symbols-analysis.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/hack/analyses/nm-symbols-analysis.sh b/hack/analyses/nm-symbols-analysis.sh
new file mode 100755
index 000000000..924246715
--- /dev/null
+++ b/hack/analyses/nm-symbols-analysis.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/bash
+
+if test "$#" -ne 1; then
+ echo "invalid arguments: usage: $0 path/to/binary"
+ exit 1
+fi
+
+DATA=$(go tool nm -size "$1" \
+ | awk 'NF==4 {printf "%s\t%s\t%s\n", $2, $3, $4}' \
+ | grep -v -P "\t_\t" \
+ | grep -P "\tt\t" \
+ | awk ' {printf "%s\t\t%s\n", $1, $3} ' \
+ )
+
+echo "$DATA"