aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/include/db_machdep.h
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2018-05-10 03:59:48 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2018-05-10 03:59:48 +0000
commitb4a0a5987135379c4e7f208fa3690d9d02e93552 (patch)
treef6e12f74cf56c6b48d1c6baed7527c8a2ba02500 /sys/powerpc/include/db_machdep.h
parent8951f05525ee4e9a93cc568dccd154405aae7419 (diff)
downloadsrc-b4a0a5987135379c4e7f208fa3690d9d02e93552.tar.gz
src-b4a0a5987135379c4e7f208fa3690d9d02e93552.zip
Fix PPC symbol resolution
Summary: There were 2 issues that were preventing correct symbol resolution on PowerPC/pseries: 1- memory corruption at chrp_attach() - this caused the inital part of the symbol table to become zeroed, which would cause the kernel linker to fail to parse it. (this was probably zeroing out other memory parts as well) 2- DDB symbol resolution wasn't working because symtab contained not relocated addresses but it was given relocated offsets. Although relocating the symbol table fixed this, it broke the linker, that already handled this case. Thus, the fix for this consists in adding a new DDB macro: DB_STOFFS(offs) that converts a (potentially) relocated offset into one that can be compared with symbol table values. PR: 227093 Submitted by: Leandro Lupori <leandro.lupori_gmail.com> Differential Revision: https://reviews.freebsd.org/D15372
Notes
Notes: svn path=/head/; revision=333447
Diffstat (limited to 'sys/powerpc/include/db_machdep.h')
-rw-r--r--sys/powerpc/include/db_machdep.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/powerpc/include/db_machdep.h b/sys/powerpc/include/db_machdep.h
index c0dd7415bcbf..ff516c9b9942 100644
--- a/sys/powerpc/include/db_machdep.h
+++ b/sys/powerpc/include/db_machdep.h
@@ -85,4 +85,8 @@ typedef intptr_t db_expr_t; /* expression - signed */
#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_ */