From: David van Moolenbroek Date: Mon, 12 Jul 2010 23:12:21 +0000 (+0000) Subject: datasizes(1): gcc/clang support X-Git-Tag: v3.1.8~254 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=78a0260993c4938c8d09fad15ba23a6aee5f35fc;p=minix.git datasizes(1): gcc/clang support --- diff --git a/commands/datasizes/datasizes.sh b/commands/datasizes/datasizes.sh index e85661998..fa97833c5 100644 --- a/commands/datasizes/datasizes.sh +++ b/commands/datasizes/datasizes.sh @@ -5,4 +5,10 @@ then echo "Usage: $0 " exit 1 fi -nm -d -n $1 | grep ' [bBdD] ' | awk '{ printf "%10ld kB %s\n", ($1-lastpos)/1024, lastname; lastpos=$1; lastname=$3 }' | sort -n +if file $1 | grep NSYM >/dev/null 2>&1; then + NM="gnm --radix=d" +else + NM="nm -d" +fi + +$NM -n $1 | grep ' [bBdD] [^.]' | awk '{ if (lastpos) printf "%10ld kB %s\n", ($1-lastpos)/1024, lastname; lastpos=$1; lastname=$3 }' | sort -n