From 90ec6fd4ba705775bea97a744f2ab5bd96e868ae Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 1 Aug 2017 04:49:54 +0000 Subject: [PATCH] Let lockstat use ksyms(4)'s mmap interface. The workaround described in the deleted comment is no longer needed. MFC after: 1 week --- cddl/contrib/opensolaris/cmd/lockstat/sym.c | 24 --------------------- 1 file changed, 24 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/lockstat/sym.c b/cddl/contrib/opensolaris/cmd/lockstat/sym.c index f3feb549c477..e668b54ee5b3 100644 --- a/cddl/contrib/opensolaris/cmd/lockstat/sym.c +++ b/cddl/contrib/opensolaris/cmd/lockstat/sym.c @@ -194,33 +194,9 @@ symtab_init(void) return (-1); #endif -#ifdef illumos (void) elf_version(EV_CURRENT); elf = elf_begin(fd, ELF_C_READ, NULL); -#else - /* - * XXX - libelf needs to be fixed so it will work with - * non 'ordinary' files like /dev/ksyms. The following - * is a work around for now. - */ - if (elf_version(EV_CURRENT) == EV_NONE) { - close(fd); - return (-1); - } - if (ioctl(fd, KIOCGSIZE, &sz) < 0) { - close(fd); - return (-1); - } - if (ioctl(fd, KIOCGADDR, &ksyms) < 0) { - close(fd); - return (-1); - } - if ((elf = elf_memory(ksyms, sz)) == NULL) { - close(fd); - return (-1); - } -#endif for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) { Shdr *shdr = elf_getshdr(scn);