summary refs log tree commit diff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-03-04 15:36:18 -0800
committerH.J. Lu <hjl.tools@gmail.com>2016-03-04 16:15:41 -0800
commit16b23e03632623cd81a21fc5a24db546595addac (patch)
treeccaaa129b0d8e1a0060809309be814ee7746e236
parent21683b5a7d9b8460e120e061f66a6ad84fa47e98 (diff)
downloadglibc-16b23e03632623cd81a21fc5a24db546595addac.tar.gz
glibc-16b23e03632623cd81a21fc5a24db546595addac.tar.xz
glibc-16b23e03632623cd81a21fc5a24db546595addac.zip
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.
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/x86_64/crti.S2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index af555291a9..f5b8d1e552 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
 
diff --git a/sysdeps/x86_64/crti.S b/sysdeps/x86_64/crti.S
index a34525974a..e9d86ed08a 100644
--- a/sysdeps/x86_64/crti.S
+++ b/sysdeps/x86_64/crti.S
@@ -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