aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2010-08-07 21:24:05 -0700
committerUlrich Drepper <drepper@redhat.com>2010-08-07 21:24:05 -0700
commitd22e4cc9397ed41534c9422d0b0ffef8c77bfa53 (patch)
treecf2a4b5b9970dcb959f2b41e44e38ff2914657bd /sysdeps/i386
parent805bc17d6883bf6d47e49620d6f8e1b97cac9901 (diff)
downloadglibc-d22e4cc9397ed41534c9422d0b0ffef8c77bfa53.tar
glibc-d22e4cc9397ed41534c9422d0b0ffef8c77bfa53.tar.gz
glibc-d22e4cc9397ed41534c9422d0b0ffef8c77bfa53.tar.bz2
glibc-d22e4cc9397ed41534c9422d0b0ffef8c77bfa53.zip
x86: Add support for frame pointer less mcount
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/i386-mcount.S25
1 files changed, 25 insertions, 0 deletions
diff --git a/sysdeps/i386/i386-mcount.S b/sysdeps/i386/i386-mcount.S
index 8b11adb2e3..43bc0194dd 100644
--- a/sysdeps/i386/i386-mcount.S
+++ b/sysdeps/i386/i386-mcount.S
@@ -53,3 +53,28 @@ C_LABEL(_mcount)
#undef mcount
weak_alias (_mcount, mcount)
+
+ /* Same as above, but doesn't require a frame pointer */
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(__fentry__)
+ ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(__fentry__), @function)
+ .align ALIGNARG(4)
+C_LABEL(__fentry__)
+ /* Save the caller-clobbered registers. */
+ pushl %eax
+ pushl %ecx
+ pushl %edx
+
+ movl 12(%esp), %edx
+ movl 16(%esp), %eax
+
+ /* No need to access the PLT or GOT, __mcount_internal is an
+ internal function and we can make a relative call. */
+ call C_SYMBOL_NAME(__mcount_internal)
+
+ /* Pop the saved registers. Please note that `__fentry__' has no
+ return value. */
+ popl %edx
+ popl %ecx
+ popl %eax
+ ret
+ ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(__fentry__))