From owner-svn-src-all@FreeBSD.ORG Sun Sep 26 14:20:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 904BE106566B; Sun, 26 Sep 2010 14:20:09 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4878FC13; Sun, 26 Sep 2010 14:20:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8QEK9Ax094979; Sun, 26 Sep 2010 14:20:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8QEK99f094977; Sun, 26 Sep 2010 14:20:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201009261420.o8QEK99f094977@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 26 Sep 2010 14:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213185 - head/contrib/gcc/config/rs6000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Sep 2010 14:20:09 -0000 Author: nwhitehorn Date: Sun Sep 26 14:20:09 2010 New Revision: 213185 URL: http://svn.freebsd.org/changeset/base/213185 Log: 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. Modified: head/contrib/gcc/config/rs6000/freebsd.h Modified: head/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- head/contrib/gcc/config/rs6000/freebsd.h Sun Sep 26 12:52:23 2010 (r213184) +++ head/contrib/gcc/config/rs6000/freebsd.h Sun Sep 26 14:20:09 2010 (r213185) @@ -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