Index: head/sys/ddb/db_main.c =================================================================== --- head/sys/ddb/db_main.c +++ head/sys/ddb/db_main.c @@ -100,6 +100,7 @@ c_linker_sym_t lsym; Elf_Sym *sym, *match; unsigned long diff; + db_addr_t stoffs; if (symtab->private == NULL) { if (!linker_ddb_search_symbol((caddr_t)off, &lsym, &diff)) { @@ -111,19 +112,20 @@ diff = ~0UL; match = NULL; + stoffs = DB_STOFFS(off); for (sym = (Elf_Sym*)symtab->start; (char*)sym < symtab->end; sym++) { if (sym->st_name == 0 || sym->st_shndx == SHN_UNDEF) continue; - if (off < sym->st_value) + if (stoffs < sym->st_value) continue; if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT && ELF_ST_TYPE(sym->st_info) != STT_FUNC && ELF_ST_TYPE(sym->st_info) != STT_NOTYPE) continue; - if ((off - sym->st_value) > diff) + if ((stoffs - sym->st_value) > diff) continue; - if ((off - sym->st_value) < diff) { - diff = off - sym->st_value; + if ((stoffs - sym->st_value) < diff) { + diff = stoffs - sym->st_value; match = sym; } else { if (match == NULL) Index: head/sys/ddb/ddb.h =================================================================== --- head/sys/ddb/ddb.h +++ head/sys/ddb/ddb.h @@ -72,6 +72,10 @@ #define DB_MAXSCRIPTRECURSION 3 #endif +#ifndef DB_STOFFS +#define DB_STOFFS(offs) (offs) +#endif + #ifndef DB_CALL #define DB_CALL db_fncall_generic #else Index: head/sys/powerpc/include/db_machdep.h =================================================================== --- head/sys/powerpc/include/db_machdep.h +++ head/sys/powerpc/include/db_machdep.h @@ -85,4 +85,8 @@ #define inst_load(ins) 0 #define inst_store(ins) 0 +#ifdef __powerpc64__ +#define DB_STOFFS(offs) ((offs) & ~DMAP_BASE_ADDRESS) +#endif + #endif /* _POWERPC_DB_MACHDEP_H_ */ Index: head/sys/powerpc/pseries/platform_chrp.c =================================================================== --- head/sys/powerpc/pseries/platform_chrp.c +++ head/sys/powerpc/pseries/platform_chrp.c @@ -146,7 +146,7 @@ /* Set up important VPA fields */ for (i = 0; i < MAXCPU; i++) { - bzero(splpar_vpa[i], sizeof(splpar_vpa)); + bzero(splpar_vpa[i], sizeof(splpar_vpa[i])); /* First two: VPA size */ splpar_vpa[i][4] = (uint8_t)((sizeof(splpar_vpa[i]) >> 8) & 0xff);