From patchwork Tue Mar 1 23:30:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lu, Hongjiu" X-Patchwork-Id: 11163 Received: (qmail 61583 invoked by alias); 1 Mar 2016 23:31:09 -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 61545 invoked by uid 89); 1 Mar 2016 23:31:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, KAM_STOCKGEN, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:1694, 289, UD:setjmp.S, setjmpS X-HELO: mga14.intel.com X-ExtLoop1: 1 Date: Tue, 1 Mar 2016 15:30:58 -0800 From: "H.J. Lu" To: GNU C Library Subject: PATCH: Call x86-64 __mcount_internal/__sigjmp_save directly Message-ID: <20160301233058.GA3545@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Since __mcount_internal and __sigjmp_save are internal to x86-64 libc.so: 3532: 0000000000104530 289 FUNC LOCAL DEFAULT 13 __mcount_internal 3391: 0000000000034170 38 FUNC LOCAL DEFAULT 13 __sigjmp_save they can be called directly without PLT. I will check it in. H.J. * sysdeps/x86_64/_mcount.S (C_LABEL(_mcount)): Call __mcount_internal directly. * sysdeps/x86_64/setjmp.S __sigsetjmp): Call __sigjmp_save directly. diff --git a/sysdeps/x86_64/_mcount.S b/sysdeps/x86_64/_mcount.S index 5d7edd2..ba13643 100644 --- a/sysdeps/x86_64/_mcount.S +++ b/sysdeps/x86_64/_mcount.S @@ -43,11 +43,7 @@ C_LABEL(_mcount) movq 56(%rsp),%rsi /* Get frompc via the frame pointer. */ movq 8(%rbp),%rdi -#ifdef PIC - call C_SYMBOL_NAME(__mcount_internal)@PLT -#else call C_SYMBOL_NAME(__mcount_internal) -#endif /* Pop the saved registers. Please note that `mcount' has no return value. */ movq 48(%rsp),%r9 @@ -84,11 +80,7 @@ C_LABEL(__fentry__) movq 64(%rsp),%rsi /* caller is the return address above it */ movq 72(%rsp),%rdi -#ifdef PIC - call C_SYMBOL_NAME(__mcount_internal)@PLT -#else call C_SYMBOL_NAME(__mcount_internal) -#endif /* Pop the saved registers. Please note that `__fentry__' has no return value. */ movq 48(%rsp),%r9 diff --git a/sysdeps/x86_64/setjmp.S b/sysdeps/x86_64/setjmp.S index 3e93967..e37c223 100644 --- a/sysdeps/x86_64/setjmp.S +++ b/sysdeps/x86_64/setjmp.S @@ -60,11 +60,7 @@ ENTRY (__sigsetjmp) retq #else /* Make a tail call to __sigjmp_save; it takes the same args. */ -# ifdef PIC - jmp C_SYMBOL_NAME (__sigjmp_save)@PLT -# else jmp __sigjmp_save -# endif #endif END (__sigsetjmp) hidden_def (__sigsetjmp)