aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/x86_64/start.S6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 143d4a65bc..af555291a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2016-03-04 Roland McGrath <roland@hack.frob.com>
* Makefile (tests-special): Add $(objpfx)c++-types-check.out only
diff --git a/sysdeps/x86_64/start.S b/sysdeps/x86_64/start.S
index 1374974307..2369b69ec3 100644
--- a/sysdeps/x86_64/start.S
+++ b/sysdeps/x86_64/start.S
@@ -104,8 +104,10 @@ ENTRY (_start)
mov main@GOTPCREL(%rip), %RDI_LP
/* Call the user's main function, and exit with its value.
- But let the libc call main. */
- call __libc_start_main@PLT
+ But let the libc call main. Since __libc_start_main is
+ called very early, lazy binding isn't relevant here. Use
+ indirect branch via GOT to avoid extra branch to PLT slot. */
+ call *__libc_start_main@GOTPCREL(%rip)
#else
/* Pass address of our own entry points to .fini and .init. */
mov $__libc_csu_fini, %R8_LP