summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>1998-12-08 08:14:37 +0000
committerarchie <archie@FreeBSD.org>1998-12-08 08:14:37 +0000
commit06772a0378c27ed139dd04508cab6cfde8920873 (patch)
treefd4c0d0605cb1f862130186a62da162bac92e84c /tools
parent9bbb7fe8d48c41cbf0c0657451b6b9bd7d8e75c3 (diff)
downloadFreeBSD-src-06772a0378c27ed139dd04508cab6cfde8920873.zip
FreeBSD-src-06772a0378c27ed139dd04508cab6cfde8920873.tar.gz
Automatically detect a.out vs. elf kernel
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/kernxref/kernxref.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/tools/tools/kernxref/kernxref.sh b/tools/tools/kernxref/kernxref.sh
index a600c6b..b29e8d6 100644
--- a/tools/tools/kernxref/kernxref.sh
+++ b/tools/tools/kernxref/kernxref.sh
@@ -7,14 +7,25 @@
# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
# ----------------------------------------------------------------------------
#
-# $Id: kernxref.sh,v 1.9 1998/11/27 10:18:56 bde Exp $
+# $Id: kernxref.sh,v 1.10 1998/12/06 21:39:07 archie Exp $
#
# This shellscript will make a cross reference of the symbols of the LINT
# kernel.
-cd /sys/compile/LINT
-nm -aout -gon `echo *.o /lkm/*.o | tr ' ' '\012' | egrep -v '(aicasm|genassym)'` |
- tr : ' ' | awk '
+COMPILEDIR=/sys/compile
+KERNELNAME=LINT
+
+cd ${COMPILEDIR}/${KERNELNAME}
+if file vers.o | grep -q ELF; then
+ OBJFORMAT=elf;
+else
+ OBJFORMAT=aout;
+fi
+
+OBJFORMAT=${OBJFORMAT} nm -gon `echo *.o /lkm/*.o \
+ | tr ' ' '\012' \
+ | egrep -v '(aicasm|genassym)'` \
+ | tr : ' ' | awk '
NF > 1 {
if (length($2) == 8) {
$2 = $3
OpenPOWER on IntegriCloud