From patchwork Fri Sep 18 07:05:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 8765 X-Patchwork-Delegate: vapier@gentoo.org Received: (qmail 128422 invoked by alias); 18 Sep 2015 07:05:20 -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 128413 invoked by uid 89); 18 Sep 2015 07:05:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, SPF_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Cc: David Lamparter Subject: [PATCH] arm: setjmp/longjmp: fix PIC vs SHARED thinkos Date: Fri, 18 Sep 2015 03:05:07 -0400 Message-Id: <1442559907-31957-1-git-send-email-vapier@gentoo.org> In-Reply-To: <201109191506.36854.vapier@gentoo.org> References: <201109191506.36854.vapier@gentoo.org> From: David Lamparter The logic in setjmp/__longjmp incorrectly uses "PIC" to figure out whether the code is going into a shared library when it should be using "SHARED". If you build glibc with a gcc version that has PIE enabled by default, then the code will try to use symbols that are only in the shared library. 2015-09-18 David Lamparter * sysdeps/arm/setjmp.S: Change PIC to SHARED. * sysdeps/arm/__longjmp.S: Likewise --- Note: This was previously posted here: https://sourceware.org/ml/libc-ports/2011-09/msg00018.html But I never got around to cleaning things up. Fortunately, Roland did that for me in commit 8c2b1ed8bbd20d35314c2a602b903159fa567ffb. sysdeps/arm/__longjmp.S | 2 +- sysdeps/arm/setjmp.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/arm/__longjmp.S b/sysdeps/arm/__longjmp.S index fc60a5d..1033e13 100644 --- a/sysdeps/arm/__longjmp.S +++ b/sysdeps/arm/__longjmp.S @@ -81,7 +81,7 @@ ENTRY (__longjmp) C_SYMBOL_NAME(_rtld_local_ro) \ + RTLD_GLOBAL_RO_DL_HWCAP_OFFSET) # else -# ifdef PIC +# ifdef SHARED LDR_GLOBAL (a4, a3, C_SYMBOL_NAME(_rtld_global_ro), \ RTLD_GLOBAL_RO_DL_HWCAP_OFFSET) # else diff --git a/sysdeps/arm/setjmp.S b/sysdeps/arm/setjmp.S index e44beb4..be0a4ec 100644 --- a/sysdeps/arm/setjmp.S +++ b/sysdeps/arm/setjmp.S @@ -62,7 +62,7 @@ ENTRY (__sigsetjmp) C_SYMBOL_NAME(_rtld_local_ro) \ + RTLD_GLOBAL_RO_DL_HWCAP_OFFSET) # else -# ifdef PIC +# ifdef SHARED LDR_GLOBAL (a3, a4, C_SYMBOL_NAME(_rtld_global_ro), \ RTLD_GLOBAL_RO_DL_HWCAP_OFFSET) # else