summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>2001-09-17 05:16:05 +0000
committerjason <jason@openbsd.org>2001-09-17 05:16:05 +0000
commitdea2358bdee49ff405c801716daef04be9addb39 (patch)
tree6a0d22d0215daf278bbc421c176d52ea26c3a96c
parentmake vi exit if it can't create a temp file. From NetBSD, ok millert (diff)
downloadwireguard-openbsd-dea2358bdee49ff405c801716daef04be9addb39.tar.xz
wireguard-openbsd-dea2358bdee49ff405c801716daef04be9addb39.zip
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;
- }
+ }
}
/*