From patchwork Fri Nov 18 16:17:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 126442 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 EA1E5B725D for ; Sat, 19 Nov 2011 03:17:47 +1100 (EST) Received: (qmail 30011 invoked by alias); 18 Nov 2011 16:17:39 -0000 Received: (qmail 29999 invoked by uid 22791); 18 Nov 2011 16:17:36 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_GJ, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Nov 2011 16:17:10 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 8C91F851; Fri, 18 Nov 2011 17:17:08 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Qw08gb-R8cyB; Fri, 18 Nov 2011 17:17:06 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 4161F850; Fri, 18 Nov 2011 17:17:06 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id pAIGH5eg014146; Fri, 18 Nov 2011 17:17:05 +0100 (MET) From: Rainer Orth To: Richard Henderson Cc: gcc-patches@gcc.gnu.org Subject: Re: [libitm] Support Solaris 8 and 9/x86 with Sun as References: <4EC40B3A.2060202@redhat.com> Date: Fri, 18 Nov 2011 17:17:05 +0100 In-Reply-To: <4EC40B3A.2060202@redhat.com> (Richard Henderson's message of "Wed, 16 Nov 2011 09:12:58 -1000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes 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 Richard Henderson writes: > On 11/16/2011 08:38 AM, Rainer Orth wrote: >> * config/generic/asmcfi.h: Fix comment. >> * config/x86/sjlj.S (_ITM_beginTransaction): Provide PIC code >> sequence without .hidden support. >> (GTM_longjmp) [__ELF__]: Only use .hidden if >> HAVE_ATTRIBUTE_VISIBILITY. > > Nearly ok. > >> + subl $4, %esp >> + movl %ebx, 24(%esp) >> + call 1f >> +1: popl %ebx >> + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx >> + call GTM_begin_transaction@PLT >> + movl 24(%esp), %ebx >> + addl $4, %esp > > This is overly complicated. We've saved %ebx at 12(%esp) above. > This should be as simple as > > call 1f > 1: popl %ebx > addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx > call GTM_begin_transaction@PLT > movl 12(%esp), %ebx > > It also needs wrapping like > > #elif defined(__ELF__) > ... > #else > # error "Unsupported PIC sequence" > #endif > > ... which will almost certainly immediately fail on Darwin, but > at least not with some reference to @PLT. Here's what I've installed after re-bootstrapping on i386-pc-solaris2.{8, 9, 10, 11} with both Sun as and gas. Rainer 2011-11-14 Rainer Orth * config/generic/asmcfi.h: Fix comment. * config/x86/sjlj.S (_ITM_beginTransaction): Provide ELF PIC code sequence without .hidden support, error for non-ELF targets. (GTM_longjmp) [__ELF__]: Only use .hidden if HAVE_ATTRIBUTE_VISIBILITY. # HG changeset patch # Parent 3173fc5da3ec7582cb682ba14d4acc6bcc44a0e0 Support Solaris 8 and 9/x86 with Sun as diff --git a/libitm/config/generic/asmcfi.h b/libitm/config/generic/asmcfi.h --- a/libitm/config/generic/asmcfi.h +++ b/libitm/config/generic/asmcfi.h @@ -41,4 +41,4 @@ #define cfi_def_cfa(r,n) #define cfi_register(o,n) -#endif /* HAVE_ASM_CFI */ +#endif /* HAVE_AS_CFI_PSEUDO_OP */ diff --git a/libitm/config/x86/sjlj.S b/libitm/config/x86/sjlj.S --- a/libitm/config/x86/sjlj.S +++ b/libitm/config/x86/sjlj.S @@ -60,7 +60,17 @@ _ITM_beginTransaction: movl %edi, 20(%esp) movl %ebp, 24(%esp) leal 8(%esp), %edx +#if defined HAVE_ATTRIBUTE_VISIBILITY || !defined __PIC__ call GTM_begin_transaction +#elif defined __ELF__ + call 1f +1: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx + call GTM_begin_transaction@PLT + movl 12(%esp), %ebx +#else +# error "Unsupported PIC sequence" +#endif addl $28, %esp cfi_def_cfa_offset(4) ret @@ -108,7 +118,9 @@ GTM_longjmp: #ifdef __ELF__ .type GTM_longjmp, @function +#ifdef HAVE_ATTRIBUTE_VISIBILITY .hidden GTM_longjmp +#endif .size GTM_longjmp, .-GTM_longjmp #endif