From patchwork Fri Nov 5 19:10:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 70284 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8D2891007D2 for ; Sat, 6 Nov 2010 06:10:51 +1100 (EST) Received: (qmail 21200 invoked by alias); 5 Nov 2010 19:10:48 -0000 Received: (qmail 21189 invoked by uid 22791); 5 Nov 2010 19:10:47 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Nov 2010 19:10:39 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 405D2CB029A; Fri, 5 Nov 2010 20:10:37 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7940WhJ6ImHw; Fri, 5 Nov 2010 20:10:37 +0100 (CET) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 4249ECB023F; Fri, 5 Nov 2010 20:10:36 +0100 (CET) From: Eric Botcazou To: Kai Tietz Subject: Re: [ping] couple of fixes for DWARF2 EH on Win32 Date: Fri, 5 Nov 2010 20:10:01 +0100 User-Agent: KMail/1.9.9 Cc: gcc-patches@gcc.gnu.org References: <201010241009.38345.ebotcazou@adacore.com> In-Reply-To: MIME-Version: 1.0 Message-Id: <201011052010.02409.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org > yeah both patches are ok. The changes in t-mingw* should be superflous > for newer mingw runtimes. For compatiblility sake they are ok. Thanks. > As the dw2 unwinder code is just of use for 32-bit, I have no > objections (there are some pointer/long casts withing that code, which > are fitting well to x64 win32's LLP64). FWIW we do use 64-bit DWARF-2 EH on Windows in our compilers and this works almost out of the box (you have to enable it of course). For the sake of completeness, I'm posting the attached patchlet that is needed to make it work with GCC 4.5 and later, but might be of interest to those playing with the DWARF-2 unwinder on 64-bit Windows and so worth integrating in the tree. It is necessary in order to avoid buffer overruns caused by the different set of call-used registers with the MS ABI. 2010-11-05 Eric Botcazou Pascal Obry * config/i386/cygming.h (DWARF_FRAME_REGISTERS): Redefine. Use 33 in 64-bit mode and 17 otherwise. Index: config/i386/cygming.h =================================================================== --- config/i386/cygming.h (revision 166350) +++ config/i386/cygming.h (working copy) @@ -84,6 +84,10 @@ along with GCC; see the file COPYING3. (TARGET_64BIT ? dbx64_register_map[(n)] \ : svr4_dbx_register_map[(n)]) +/* The MS_ABI changes the set of call-used registers. */ +#undef DWARF_FRAME_REGISTERS +#define DWARF_FRAME_REGISTERS (TARGET_64BIT ? 33 : 17) + #ifdef HAVE_GAS_PE_SECREL32_RELOC /* Use section relative relocations for debugging offsets. Unlike other targets that fake this by putting the section VMA at 0, PE