From patchwork Mon Nov 14 14:44:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 694553 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tHYF923ZTz9t0J for ; Tue, 15 Nov 2016 01:44:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="YtH1fww6"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=Axfdd6cC2chyhlFA33LwKEa+O0HYt ADBLzbuSOagO3zkBNFCkEb+UbmxXJQiercMb+BLt3k1c4X3FoQg7j81ilP0MpjUx od7N+A2ba63gUFtMMO0Z4d9Aj2RkHfdARHpvQy8KrQeO2kEoD4SO1bkMz3LIq7Ut R/iEVKterAZxlA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=F3RDKrf2XwKfcyMfhauJZH3oJCc=; b=YtH 1fww6d8FV+cWvGMmETka6+MN9cN8Xpka1XGV6lPQ8zjVupERTOHrCBNDp7+GKNAX rA+4TYUS5HjhTfPV6YlViARTgwL+9ljoA/9A/EG3gC81LxyNb0CjrprJ0DNfGUZY jvB80iBy56//X9kewBuQl9hhbysXvy/MoEj/PhVM= Received: (qmail 42320 invoked by alias); 14 Nov 2016 14:44:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 42293 invoked by uid 89); 14 Nov 2016 14:44:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:libc_hi, blr, Defining, rtld X-HELO: mx1.redhat.com To: GNU C Library From: Florian Weimer Subject: powerpc help needed: Defining hidden alias for __sigsetjmp Message-ID: Date: Mon, 14 Nov 2016 15:44:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 I'm trying to create a hidden alias for __sigsetjmp on powerpc. The problem is that powerpc uses the generic wrapper, which has a libc_hidden_proto for it, but the implementation of that redirect never happens. I came up with the attached patch. It adds a definition of the hidden redirect to libc.so, as expected. But in addition to that, I get this ABI difference on powerpc32: -GLIBC_2.3.4 __longjmp F This does not happen on powerpc64. I really can't explain that. Any ideas? Florian powerpc: Add hidden definition for __sigsetjmp 2016-11-14 Florian Weimer * sysdeps/powerpc/powerpc64/setjmp-common.S (__GI___sigsetjmp): Define. * sysdeps/powerpc/powerpc32/setjmp.S (__sigsetjmp): Add hidden definition. diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp.S b/sysdeps/powerpc/powerpc32/fpu/setjmp.S index 6a4016c..de6cdcf 100644 --- a/sysdeps/powerpc/powerpc32/fpu/setjmp.S +++ b/sysdeps/powerpc/powerpc32/fpu/setjmp.S @@ -32,6 +32,7 @@ versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4) # define __sigsetjmp_symbol __vmx__sigsetjmp # define __sigjmp_save_symbol __vmx__sigjmp_save # include "setjmp-common.S" +libc_hidden_ver (__vmx__sigsetjmp, __sigsetjmp) # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) # define __NO_VMX__ diff --git a/sysdeps/powerpc/powerpc32/setjmp.S b/sysdeps/powerpc/powerpc32/setjmp.S index 88f7f82..285d40c 100644 --- a/sysdeps/powerpc/powerpc32/setjmp.S +++ b/sysdeps/powerpc/powerpc32/setjmp.S @@ -31,6 +31,7 @@ versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4) # define __sigsetjmp_symbol __vmx__sigsetjmp # define __sigjmp_save_symbol __vmx__sigjmp_save # include "setjmp-common.S" +libc_hidden_ver (__vmx__sigsetjmp, __sigsetjmp) # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) # define __NO_VMX__ diff --git a/sysdeps/powerpc/powerpc64/setjmp-common.S b/sysdeps/powerpc/powerpc64/setjmp-common.S index 83361f5..b5de49e 100644 --- a/sysdeps/powerpc/powerpc64/setjmp-common.S +++ b/sysdeps/powerpc/powerpc64/setjmp-common.S @@ -232,3 +232,14 @@ L(no_vmx): blr #endif END (__sigsetjmp_symbol) + +#if defined SHARED && !IS_IN (rtld) && !defined __NO_VMX__ +/* When called from within libc we need a special version of __sigsetjmp + that saves r2 since the call won't go via a plt call stub. See + bugz #269. */ +ENTRY (__GI___sigsetjmp) + std r2,FRAME_TOC_SAVE(r1) /* Save the callers TOC in the save area. */ + CALL_MCOUNT 1 + b JUMPTARGET (GLUE(__sigsetjmp_symbol,_ent)) +END (__GI___sigsetjmp) +#endif