diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-09-26 14:20:09 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-09-26 14:20:09 +0000 |
commit | 2e85e3acedc25e1646e19ea6923f5e7b45bff881 (patch) | |
tree | be718b9c1fcfdc4be36907bbd8fca91d063eb667 /contrib/gcc | |
parent | 22936fe435847a6e743572294f52c3f75e107c9d (diff) | |
download | FreeBSD-src-2e85e3acedc25e1646e19ea6923f5e7b45bff881.zip FreeBSD-src-2e85e3acedc25e1646e19ea6923f5e7b45bff881.tar.gz |
Check for NULL link registers as found in initial stack frames when doing
stack unwinding, instead of naively trying to check the instruction at
that location. This fixes signal handling in threaded applications after
recent changes regarding unwinding in libthr. While here, clean up our
MD_FROB_UPDATE_CONTEXT() implementation a little.
Diffstat (limited to 'contrib/gcc')
-rw-r--r-- | contrib/gcc/config/rs6000/freebsd.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/contrib/gcc/config/rs6000/freebsd.h b/contrib/gcc/config/rs6000/freebsd.h index 2ce115d..34c93b8 100644 --- a/contrib/gcc/config/rs6000/freebsd.h +++ b/contrib/gcc/config/rs6000/freebsd.h @@ -219,17 +219,16 @@ | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \ : DW_EH_PE_absptr) +#ifdef __powerpc64__ #define MD_FROB_UPDATE_CONTEXT(CTX, FS) \ - if (TARGET_64BIT) { \ if ((FS)->regs.reg[2].how == REG_UNSAVED) \ { \ - unsigned int *insn \ - = (unsigned int *) \ + unsigned int *insn = (unsigned int *) \ _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \ - if (*insn == 0xE8410028) \ + if (insn != NULL && *insn == 0xE8410028) \ _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \ - } \ - } + } +#endif /* FreeBSD doesn't support saving and restoring 64-bit regs with a 32-bit kernel. This is supported when running on a 64-bit kernel with |