commit 2cb53c9535ca35d9e0e879c18f6b69adb531c4af parent 3a1522c9a4a69083b867f2cf5e599ec8a61e1883 Author: William Casarin <jb55@jb55.com> Date: Sat, 19 Sep 2020 05:09:02 -0700 bin/undefined-symbols: init Diffstat:
A | bin/undefined-symbols | | | 15 | +++++++++++++++ |
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/bin/undefined-symbols b/bin/undefined-symbols @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +usage () { + printf "usage: undefined-symbols lib.a\n\n" + printf " print external undefined symbols in an archive\n\n" + exit 1 +} + +[ -z "$1" ] && usage + +exec comm -13 \ + <(nm "$1" | egrep ' [BDTW] ' | sed -e 's/.* [BDTW] //' | sort -u) \ + <(nm "$1" | grep ' U ' | sed -e 's/.* U //' | sort -u) \ + | grep -v '^_' \ + | less