Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Call x86-64 __mcount_internal/__sigjmp_save directly
Since __mcount_internal and __sigjmp_save are internal to x86-64 libc.so:

3532: 0000000000104530   289 FUNC    LOCAL  DEFAULT   13 __mcount_internal
3391: 0000000000034170    38 FUNC    LOCAL  DEFAULT   13 __sigjmp_save

they can be called directly without PLT.

	* sysdeps/x86_64/_mcount.S (C_LABEL(_mcount)): Call
	__mcount_internal directly.
	(C_LABEL(__fentry__)): Likewise.
	* sysdeps/x86_64/setjmp.S __sigsetjmp): Call __sigjmp_save
	directly.
  • Loading branch information
H.J. Lu committed Mar 2, 2016
1 parent 521266a commit ec21534
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
@@ -1,3 +1,11 @@
2016-03-01 H.J. Lu <hongjiu.lu@intel.com>

* sysdeps/x86_64/_mcount.S (C_LABEL(_mcount)): Call
__mcount_internal directly.
(C_LABEL(__fentry__)): Likewise.
* sysdeps/x86_64/setjmp.S __sigsetjmp): Call __sigjmp_save
directly.

2016-03-01 H.J. Lu <hongjiu.lu@intel.com>

* sysdeps/unix/sysv/linux/x86_64/__start_context.S
Expand Down
8 changes: 0 additions & 8 deletions sysdeps/x86_64/_mcount.S
Expand Up @@ -43,11 +43,7 @@ C_LABEL(_mcount)
movq 56(%rsp),%rsi
/* Get frompc via the frame pointer. */
movq 8(%rbp),%rdi
#ifdef PIC
call C_SYMBOL_NAME(__mcount_internal)@PLT
#else
call C_SYMBOL_NAME(__mcount_internal)
#endif
/* Pop the saved registers. Please note that `mcount' has no
return value. */
movq 48(%rsp),%r9
Expand Down Expand Up @@ -84,11 +80,7 @@ C_LABEL(__fentry__)
movq 64(%rsp),%rsi
/* caller is the return address above it */
movq 72(%rsp),%rdi
#ifdef PIC
call C_SYMBOL_NAME(__mcount_internal)@PLT
#else
call C_SYMBOL_NAME(__mcount_internal)
#endif
/* Pop the saved registers. Please note that `__fentry__' has no
return value. */
movq 48(%rsp),%r9
Expand Down
4 changes: 0 additions & 4 deletions sysdeps/x86_64/setjmp.S
Expand Up @@ -60,11 +60,7 @@ ENTRY (__sigsetjmp)
retq
#else
/* Make a tail call to __sigjmp_save; it takes the same args. */
# ifdef PIC
jmp C_SYMBOL_NAME (__sigjmp_save)@PLT
# else
jmp __sigjmp_save
# endif
#endif
END (__sigsetjmp)
hidden_def (__sigsetjmp)

0 comments on commit ec21534

Please sign in to comment.