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: 82122 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1041481qge; Mon, 14 Nov 2016 06:44:14 -0800 (PST) X-Received: by 10.99.171.10 with SMTP id p10mr4729882pgf.36.1479134654500; Mon, 14 Nov 2016 06:44:14 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c15si5581610pgn.20.2016.11.14.06.44.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 06:44:14 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-74708-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-74708-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74708-patch=linaro.org@sourceware.org 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=dyGYfHtcln7QZgjQ1fwY6OqOZY1Tu 4LYTkrPo7sV8hQywgU9/rzg9zuU9NexKozqaqTn61i2LXYRCr1/RspuBHztWBV2w +X5lYCwoZNQ7MoJICXlOjNkhyr92Pu2BCmO4x+CoGylOvtgfqLosa55TYc3dm4Kh 7ODcXL/h62rGuM= 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=HOI ZFaWzjRSLxKFrmK2CR4ek+8lazoDrhnh6w56DmitH6+PCryTgx41A7XFqF60kotd NuLPkipeBrn45DxnGR7uUP9UTfZEDu2WLis4UH9LBDCM5AgGKUTnMHqPzt4JLTb9 6hQbRya0HCcUfJszpS6pZaP3xcoK92I6CovqfG6c= 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