summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rw-r--r--sbin/savecore/savecore.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c
index 2d33858..5e1a001 100644
--- a/sbin/savecore/savecore.c
+++ b/sbin/savecore/savecore.c
@@ -70,7 +70,7 @@ static const char rcsid[] =
#endif
#ifdef __i386__
-#define ok(number) ((number) - KERNBASE)
+#define ok(number) ((number) - kernbase)
#endif
struct nlist current_nl[] = { /* Namelist for currently running system. */
@@ -86,6 +86,8 @@ struct nlist current_nl[] = { /* Namelist for currently running system. */
{ "_panicstr" },
#define X_DUMPMAG 5
{ "_dumpmag" },
+#define X_KERNBASE 6
+ { "_kernbase" },
{ "" },
};
int cursyms[] = { X_DUMPLO, X_VERSION, X_DUMPMAG, -1 };
@@ -98,6 +100,7 @@ struct nlist dump_nl[] = { /* Name list for dumped system. */
{ "_version" },
{ "_panicstr" },
{ "_dumpmag" },
+ { "_kernbase" },
{ "" },
};
@@ -118,6 +121,10 @@ char panic_mesg[1024]; /* panic message */
int panicstr; /* flag: dump was caused by panic */
char vers[1024]; /* version of kernel that crashed */
+#ifdef __i386__
+u_long kernbase; /* offset of kvm to core file */
+#endif
+
int clear, compress, force, verbose; /* flags */
int keep; /* keep dump on device */
@@ -251,6 +258,13 @@ kmem_setup()
exit(1);
}
+#ifdef __i386__
+ if (dump_nl[X_KERNBASE].n_value != 0)
+ kernbase = dump_nl[X_KERNBASE].n_value;
+ else
+ kernbase = KERNBASE;
+#endif
+
len = sizeof dumpdev;
if (sysctlbyname("kern.dumpdev", &dumpdev, &len, NULL, 0) == -1) {
syslog(LOG_ERR, "sysctl: kern.dumpdev: %m");
OpenPOWER on IntegriCloud