summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-09-17 05:16:06 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-09-17 05:16:06 +0000
commitff8c6efd9e03c449b128db7104fca027529c00b2 (patch)
treee9b4e97a22e206f83575398825385bc03445304a
parent714189a28d672dc3a13b04da994e50849d265276 (diff)
make ksyms work on sparc64 (requires essentially same goop as db_sym)
-rw-r--r--sys/dev/ksyms.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/ksyms.c b/sys/dev/ksyms.c
index 86cd4c8d3b0..f72555c1ffb 100644
--- a/sys/dev/ksyms.c
+++ b/sys/dev/ksyms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ksyms.c,v 1.8 2001/06/08 08:09:36 art Exp $ */
+/* $OpenBSD: ksyms.c,v 1.9 2001/09/17 05:16:05 jason Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>
@@ -44,7 +44,11 @@
#include <vm/vm.h>
extern char *esym; /* end of symbol table */
+#ifdef __sparc64__
+extern char *ssym; /* end of kernel */
+#else
extern long end; /* end of kernel */
+#endif
static caddr_t ksym_head;
static caddr_t ksym_syms;
@@ -66,14 +70,25 @@ ksymsattach(num)
int num;
{
+#ifdef __sparc64__
+ if (esym <= ssym) {
+ printf("/dev/ksyms: Symbol table not valid.\n");
+ return;
+ }
+#else
if (esym <= (char *)&end) {
printf("/dev/ksyms: Symbol table not valid.\n");
return;
}
+#endif
#ifdef _NLIST_DO_ELF
do {
+#ifdef __sparc64__
+ caddr_t symtab = ssym;
+#else
caddr_t symtab = (caddr_t)&end;
+#endif
Elf_Ehdr *elf;
Elf_Shdr *shdr;
int i;
@@ -88,7 +103,7 @@ ksymsattach(num)
for (i = 0; i < elf->e_shnum; i++) {
if (shdr[i].sh_type == SHT_SYMTAB) {
break;
- }
+ }
}
/*