3 # ----------------------------------------------------------------------------
4 # "THE BEER-WARE LICENSE" (Revision 42):
5 # <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
6 # can do whatever you want with this stuff. If we meet some day, and you think
7 # this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
8 # ----------------------------------------------------------------------------
10 # $FreeBSD: src/tools/tools/kernxref/kernxref.sh,v 1.13 1999/08/28 00:54:30 peter Exp $
11 # $DragonFly: src/tools/tools/kernxref/kernxref.sh,v 1.2 2003/06/17 04:29:11 dillon Exp $
13 # This shellscript will make a cross reference of the symbols of the LINT
16 COMPILEDIR=/sys/compile
19 cd ${COMPILEDIR}/${KERNELNAME}
20 if file vers.o | grep -q ELF; then
26 OBJFORMAT=${OBJFORMAT} nm -gon `echo *.o /modules/*.ko \
28 | egrep -v '(aicasm|genassym)'` \
31 if (length($2) == 8) {
42 } else if ($2 == "T" || $2 == "D" || $2 == "A") {
47 } else if ($2 == "?") {
50 else if (def[$3] != "")
55 } else if ($2 == "C") {
58 else if (def[$3] == "")
68 printf "%s {%s} %s\n",i,def[i],ref[i]
75 if (length($3) == 0) {
76 printf "%-30s %3d %s\n\tUNREF\n",$1,0, $2
78 } else if ($2 == "{}") {
79 printf "%-30s %3d {UNDEF}\n",$1, NF-2
82 printf "%-30s %3d %s",$1,NF-2,$2
84 for (i = 3 ; i <= NF; i++) {
85 if (p+length ($i)+1 > 78) {
102 printf "Total symbols: %5d\n",N1+N2+N3
103 printf "unref symbols: %5d\n",N1
104 printf "undef symbols: %5d\n",N2
105 printf "1 ref symbols: %5d\n",N4
106 printf "2 ref symbols: %5d\n",N5