From owner-svn-src-projects@FreeBSD.ORG Tue Feb 9 22:01:42 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8BCD1065672; Tue, 9 Feb 2010 22:01:42 +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 BE1EA8FC12; Tue, 9 Feb 2010 22:01:42 +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 o19M1gUi094034; Tue, 9 Feb 2010 22:01:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19M1giU094032; Tue, 9 Feb 2010 22:01:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002092201.o19M1giU094032@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 9 Feb 2010 22:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203725 - projects/ppc64/contrib/gcc/config/rs6000 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 22:01:43 -0000 Author: nwhitehorn Date: Tue Feb 9 22:01:42 2010 New Revision: 203725 URL: http://svn.freebsd.org/changeset/base/203725 Log: Some updates to our ABI definition, mostly related to exception handling. This makes C++ exceptions work properly. Modified: projects/ppc64/contrib/gcc/config/rs6000/freebsd.h Modified: projects/ppc64/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- projects/ppc64/contrib/gcc/config/rs6000/freebsd.h Tue Feb 9 21:31:53 2010 (r203724) +++ projects/ppc64/contrib/gcc/config/rs6000/freebsd.h Tue Feb 9 22:01:42 2010 (r203725) @@ -23,7 +23,7 @@ #ifdef IN_LIBGCC2 #undef TARGET_64BIT -#ifdef __ppc64__ +#ifdef __powerpc64__ #define TARGET_64BIT 1 #else #define TARGET_64BIT 0 @@ -164,3 +164,43 @@ " .previous"); #endif +/* __throw will restore its own return address to be the same as the + return address of the function that the throw is being made to. + This is unfortunate, because we want to check the original + return address to see if we need to restore the TOC. + So we have to squirrel it away with this. */ +#define SETUP_FRAME_ADDRESSES() \ + do { if (TARGET_64BIT) rs6000_aix_emit_builtin_unwind_init (); } while (0) + +/* Select a format to encode pointers in exception handling data. CODE + is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is + true if the symbol may be affected by dynamic relocations. */ +#undef ASM_PREFERRED_EH_DATA_FORMAT +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ + ((TARGET_64BIT || flag_pic || TARGET_RELOCATABLE) \ + ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \ + | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \ + : DW_EH_PE_absptr) + +#define MD_FROB_UPDATE_CONTEXT(CTX, FS) \ + if (TARGET_64BIT) { \ + if ((FS)->regs.reg[2].how == REG_UNSAVED) \ + { \ + unsigned int *insn \ + = (unsigned int *) \ + _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \ + if (*insn == 0xE8410028) \ + _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \ + } \ + } + +/* Indicate that jump tables go in the text section. */ +#undef JUMP_TABLES_IN_TEXT_SECTION +#define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT + +/* 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 + COMPAT_FREEBSD32, but tell GCC it isn't so that our 32-bit binaries + are compatible. */ +#define OS_MISSING_POWERPC64 !TARGET_64BIT +