From 9ff9ae1b792e3d986f68a127e0b3f8679e6bea17 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 4 Mar 2016 15:36:18 -0800
Subject: [PATCH 2/2] Replace PREINIT_FUNCTION@PLT with *%rax in call
Since we have loaded address of PREINIT_FUNCTION into %rax, we can
avoid extra branch to PLT slot.
[BZ #19745]
* sysdeps/x86_64/crti.S (_init): Replace PREINIT_FUNCTION@PLT
with *%rax in call.
---
ChangeLog | 6 ++++++
sysdeps/x86_64/crti.S | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
@@ -1,6 +1,12 @@
2016-03-04 H.J. Lu <hongjiu.lu@intel.com>
[BZ #19745]
+ * sysdeps/x86_64/crti.S (_init): Replace PREINIT_FUNCTION@PLT
+ with *%rax in call.
+
+2016-03-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #19745]
* sysdeps/x86_64/start.S (_start): Replace __libc_start_main@PLT
with *__libc_start_main@GOTPCREL(%rip) in call.
@@ -66,7 +66,7 @@ _init:
movq PREINIT_FUNCTION@GOTPCREL(%rip), %rax
testq %rax, %rax
je .Lno_weak_fn
- call PREINIT_FUNCTION@PLT
+ call *%rax
.Lno_weak_fn:
#else
call PREINIT_FUNCTION
--
2.5.0