Fix registration issue in the devfs rc script.
[dragonfly.git] / tools / tools / local_syms / local_syms.sh
blobf5743ccd602baabe966506544208fda656c47957
1 #! /bin/sh
2 # $DragonFly: src/tools/tools/local_syms/local_syms.sh,v 1.1 2005/01/10 22:13:45 joerg Exp $
4 # Process all object files in the current directory and build a list
5 # of symbols which are used only locally. Those are good candidates
6 # for static.
8 tempfoo=`basename $0`
9 TMPFILE=`mktemp -d -t ${tempfoo}` || exit 1
11 for a in *.o
13 nm -gpu "$a" | sed 's/^ *U //'
14 done | sort | uniq > ${TMPFILE}/external_syms
16 for a in *.o
18 nm -pg --defined-only $a | awk '{ print $3 ; }' | sort > ${TMPFILE}/defined_syms
19 comm -23 ${TMPFILE}/defined_syms ${TMPFILE}/external_syms > ${TMPFILE}/uniq_syms
20 if test `wc -l < ${TMPFILE}/uniq_syms` -gt 0
21 then
22 echo "$a:"
23 cat ${TMPFILE}/uniq_syms
24 echo
26 done
28 rm -R ${TMPFILE}