summaryrefslogtreecommitdiff
path: root/tools/list-globals
diff options
context:
space:
mode:
Diffstat (limited to 'tools/list-globals')
-rwxr-xr-xtools/list-globals9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/list-globals b/tools/list-globals
new file mode 100755
index 0000000000..d8b04f23bc
--- /dev/null
+++ b/tools/list-globals
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+[ -z "$@" ] && { echo "Usage: $0 <foo.[oa]>" > /dev/stderr; exit 2; }
+
+nm -A -f sysv "$@" |\
+ awk '
+ BEGIN {FS = " *[|] *"}
+ NF > 1 && $4 != "TLS" && $7 != ".text" && $7 != "*COM*" && $3 !~ /^[TtURr]$/ {print $3 " " $1}
+ '