diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 341da8e7dd57..0d19ba9057d8 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -161,6 +161,10 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +#ifdef DDB +void *ksym_start, *ksym_end; +#endif + static void cpu_startup(dummy) void *dummy; @@ -1134,6 +1138,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) kmdp = preload_search_by_type("elf64 kernel"); boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *) + KERNBASE; + ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, void *); + ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, void *); /* Init basic tunables, hz etc */ init_param1(); diff --git a/sys/ddb/db_elf.c b/sys/ddb/db_elf.c index 4ebdc8e7c0d8..a24f3b729431 100644 --- a/sys/ddb/db_elf.c +++ b/sys/ddb/db_elf.c @@ -402,7 +402,7 @@ kdb_init(void) elf.e_ident[EI_MAG1] = ELFMAG1; elf.e_ident[EI_MAG2] = ELFMAG2; elf.e_ident[EI_MAG3] = ELFMAG3; - elf.e_machine = EM_486; + elf.e_machine = ELF_ARCH; elf.e_shoff = (uintptr_t)(void *)&sh[0] - (uintptr_t)(void *)&elf; sh[0].sh_type = SHT_SYMTAB; sh[0].sh_offset = (uintptr_t)ksym_start + sizeof(long) -