Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ddb PR/14498: Wesley Chen: Identify loaded modules vs. k...
details: https://anonhg.NetBSD.org/src/rev/60977b666972
branches: trunk
changeset: 517198:60977b666972
user: christos <christos%NetBSD.org@localhost>
date: Thu Nov 08 15:01:35 2001 +0000
description:
PR/14498: Wesley Chen: Identify loaded modules vs. kernel, because we don't
load the elf header with them.
diffstat:
sys/ddb/db_elf.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diffs (24 lines):
diff -r 9c73ddfe27e1 -r 60977b666972 sys/ddb/db_elf.c
--- a/sys/ddb/db_elf.c Thu Nov 08 15:00:17 2001 +0000
+++ b/sys/ddb/db_elf.c Thu Nov 08 15:01:35 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_elf.c,v 1.16 2001/07/31 22:31:47 bjh21 Exp $ */
+/* $NetBSD: db_elf.c,v 1.17 2001/11/08 15:01:35 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -215,6 +215,14 @@
Elf_Shdr *shp = STAB_TO_SHDR(stab, elf);
int i;
+ /*
+ * We don't load ELF header for ELF modules.
+ * Find out if this is a loadable module. If so,
+ * string table comes right after symbol table.
+ */
+ if ((Elf_Sym *)elf == STAB_TO_SYMSTART(stab)) {
+ return ((char *)STAB_TO_SYMEND(stab));
+ }
for (i = 0; i < elf->e_shnum; i++) {
if (shp[i].sh_type == SHT_SYMTAB)
return ((char*)elf + shp[shp[i].sh_link].sh_offset);
Home |
Main Index |
Thread Index |
Old Index