From 21683b5a7d9b8460e120e061f66a6ad84fa47e98 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 4 Mar 2016 15:28:59 -0800 Subject: Replace @PLT with @GOTPCREL(%rip) in call 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. [BZ #19745] * sysdeps/x86_64/start.S (_start): __libc_start_main@PLT with *__libc_start_main@GOTPCREL(%rip) in call. --- sysdeps/x86_64/start.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/x86_64/start.S b/sysdeps/x86_64/start.S index 1374974..2369b69 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 -- cgit v1.1