-/* $OpenBSD: ksyms.c,v 1.25 2014/07/08 17:19:25 deraadt Exp $ */
+/* $OpenBSD: ksyms.c,v 1.26 2014/12/22 02:55:48 deraadt Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>
#endif
extern char *esym; /* end of symbol table */
-#if defined(__sparc64__) || defined(__mips__)
+#if defined(__sparc64__) || defined(__mips__) || defined(__amd64__)
extern char *ssym; /* end of kernel */
#else
extern long end; /* end of kernel */
ksymsattach(int num)
{
-#if defined(__sparc64__) || defined(__mips__)
+#if defined(__sparc64__) || defined(__mips__) || defined(__amd64__)
if (esym <= ssym) {
printf("/dev/ksyms: Symbol table not valid.\n");
return;
#ifdef _NLIST_DO_ELF
do {
-#if defined(__sparc64__) || defined(__mips__)
+#if defined(__sparc64__) || defined(__mips__) || defined(__amd64__)
caddr_t symtab = ssym;
#else
caddr_t symtab = (caddr_t)&end;