diff options
author | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-05-10 03:59:48 +0000 |
---|---|---|
committer | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-05-10 03:59:48 +0000 |
commit | b4a0a5987135379c4e7f208fa3690d9d02e93552 (patch) | |
tree | f6e12f74cf56c6b48d1c6baed7527c8a2ba02500 /sys/powerpc | |
parent | 8951f05525ee4e9a93cc568dccd154405aae7419 (diff) | |
download | src-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')
-rw-r--r-- | sys/powerpc/include/db_machdep.h | 4 | ||||
-rw-r--r-- | sys/powerpc/pseries/platform_chrp.c | 2 |
2 files changed, 5 insertions, 1 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_ */ diff --git a/sys/powerpc/pseries/platform_chrp.c b/sys/powerpc/pseries/platform_chrp.c index b85b19d05cb3..c254c0f5c425 100644 --- a/sys/powerpc/pseries/platform_chrp.c +++ b/sys/powerpc/pseries/platform_chrp.c @@ -146,7 +146,7 @@ chrp_attach(platform_t plat) /* 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); |