diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-06-09 04:43:16 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-06-09 04:43:31 -0700 |
commit | ac187dc4abde9ca6504c646106e2a7f7b2806262 (patch) | |
tree | 6399e3373227afacaa5575f18f9304ad9ddd7a86 /ChangeLog | |
parent | 75437079e4c5a7416052940ca641a41ddbf6f5fd (diff) | |
download | glibc-ac187dc4abde9ca6504c646106e2a7f7b2806262.zip glibc-ac187dc4abde9ca6504c646106e2a7f7b2806262.tar.gz glibc-ac187dc4abde9ca6504c646106e2a7f7b2806262.tar.bz2 |
Always indirect branch to __libc_start_main via GOT
Since __libc_start_main in libc.so is called very early, lazy binding
isn't relevant. Always call __libc_start_main with indirect branch via
GOT to avoid extra branch to PLT slot. In case of static executable,
ld in binutils 2.26 or above can convert indirect branch into direct
branch:
0000000000400a80 <_start>:
400a80: 31 ed xor %ebp,%ebp
400a82: 49 89 d1 mov %rdx,%r9
400a85: 5e pop %rsi
400a86: 48 89 e2 mov %rsp,%rdx
400a89: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp
400a8d: 50 push %rax
400a8e: 54 push %rsp
400a8f: 49 c7 c0 20 1b 40 00 mov $0x401b20,%r8
400a96: 48 c7 c1 90 1a 40 00 mov $0x401a90,%rcx
400a9d: 48 c7 c7 c0 03 40 00 mov $0x4003c0,%rdi
400aa4: 67 e8 96 09 00 00 addr32 callq 401440 <__libc_start_main>
400aaa: f4 hlt
* sysdeps/x86_64/start.S (_start): Always indirect branch to
__libc_start_main via GOT.
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1,5 +1,10 @@ 2016-06-09 H.J. Lu <hongjiu.lu@intel.com> + * sysdeps/x86_64/start.S (_start): Always indirect branch to + __libc_start_main via GOT. + +2016-06-09 H.J. Lu <hongjiu.lu@intel.com> + * sysdeps/x86_64/memcopy.h: New file. * sysdeps/x86_64/wordcopy.c: Likewise. |