From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8648 invoked by alias); 4 Nov 2016 17:47:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 8623 invoked by uid 89); 4 Nov 2016 17:47:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,NO_DNS_FOR_FROM,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mga11.intel.com X-ExtLoop1: 1 Date: Fri, 04 Nov 2016 17:47:00 -0000 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Don't use PLT nor GOT in libc.a [BZ #20750] Message-ID: <20161104174739.GA5880@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-SW-Source: 2016-11/txt/msg00191.txt.bz2 There is no need to use PLT nor GOT in libc.a to branch to a function, regardless whether libc.a is compiled with PIC or not. Tested on x86-64. OK for master? H.J. --- [BZ #20750] * sysdeps/x86_64/sysdep.h (JUMPTARGET): Check SHARED instead of PIC. --- sysdeps/x86_64/sysdep.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h index 75ac747..fd25c90 100644 --- a/sysdeps/x86_64/sysdep.h +++ b/sysdeps/x86_64/sysdep.h @@ -89,13 +89,14 @@ lose: \ END (name) #undef JUMPTARGET -#ifdef PIC +#ifdef SHARED # ifdef BIND_NOW # define JUMPTARGET(name) *name##@GOTPCREL(%rip) # else # define JUMPTARGET(name) name##@PLT # endif #else +/* For libc.a, we want to branch to target directly. */ # define JUMPTARGET(name) name #endif -- 2.7.4