diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-06-18 09:45:37 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-06-18 09:45:37 +0000 |
commit | 943072f45ca34caf7b55db16f412bed94f7c27bc (patch) | |
tree | e796b9b0b1179779b5388554aa81d3198206ecb5 /winsup/cygwin/mcountFunc.S | |
parent | c38196884232bb12c0c4e04d1d31f6cbe1aca446 (diff) | |
download | cygnal-943072f45ca34caf7b55db16f412bed94f7c27bc.tar.gz cygnal-943072f45ca34caf7b55db16f412bed94f7c27bc.tar.bz2 cygnal-943072f45ca34caf7b55db16f412bed94f7c27bc.zip |
* Makefile.in (VPATH): Drop CONFIG_DIR.
(EXTRA_DLL_OFILES): Remove.
(DLL_OFILES): Remove EXTRA_DLL_OFILES.
(ASFLAGS): Define as -D_WIN64 on x86_64.
(GMON_OFILES): Add mcountFunc.o.
($(srcdir)/$(TLSOFFSETS_H)): Use target_cpu rather than CONFIG_DIR.
* configure.ac (CONFIG_DIR): Remove definition.
* configure: Regenerate.
* gcrt0.c: Use latest version from Mingw-w64 project.
* gmon.c: Ditto.
* gmon.h: Ditto.
* mcount.c: Ditto.
* mcountFunc.S: Ditto, new file.
* profil.c: Ditto.
* profil.h: Ditto.
* config: Remove entire directory.
Diffstat (limited to 'winsup/cygwin/mcountFunc.S')
-rw-r--r-- | winsup/cygwin/mcountFunc.S | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/winsup/cygwin/mcountFunc.S b/winsup/cygwin/mcountFunc.S new file mode 100644 index 000000000..e1b9136cf --- /dev/null +++ b/winsup/cygwin/mcountFunc.S @@ -0,0 +1,115 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#include <_mingw_mac.h> + + .file "mcountFunc.S" + .text +#ifdef _WIN64 + .align 8 +#else + .align 4 +#endif + +/* gcc always assumes the mcount public symbol has a single leading underscore + for our target. See gcc/config/i386.h; it isn't overridden in + config/i386/cygming.h or any other places for mingw */ +.globl _mcount + .def _mcount; .scl 2; .type 32; .endef +_mcount: +#ifndef _WIN64 + push %ebp + mov %esp, %ebp + push %eax + push %ecx + push %edx + movl 4(%ebp),%edx + movl (%ebp),%eax + movl 4(%eax),%eax + push %edx + push %eax + call __MINGW_USYMBOL(_mcount_private) + add $8, %esp + pop %edx + pop %ecx + pop %eax + leave + ret +#else + push %rbp + mov %rsp, %rbp + push %rax + push %rcx + push %rdx + push %r8 + push %r9 + push %r10 + push %r11 + movq 8(%rbp),%rdx + movq (%rbp),%rax + movq 8(%rax),%rcx + sub $40, %rsp + call __MINGW_USYMBOL(_mcount_private) + add $40, %rsp + pop %r11 + pop %r10 + pop %r9 + pop %r8 + pop %rdx + pop %rcx + pop %rax + leave + ret +#endif + +/* gcc always assumes the mcount public symbol has a single leading underscore + for our target. See gcc/config/i386.h; it isn't overridden in + config/i386/cygming.h or any other places for mingw. This is the entry + for new prologue mechanism required for x64 seh calling convention. */ +.globl __fentry__ + .def _mcount_top; .scl 2; .type 32; .endef +__fentry__: +#ifndef _WIN64 + push %ebp + mov %esp, %ebp + push %eax + push %ecx + push %edx + movl 4(%ebp),%edx + movl 8(%ebp),%eax + push %edx + push %eax + call __MINGW_USYMBOL(_mcount_private) + add $8, %esp + pop %edx + pop %ecx + pop %eax + leave + ret +#else + push %rbp + mov %rsp, %rbp + push %rax + push %rcx + push %rdx + push %r8 + push %r9 + push %r10 + push %r11 + movq 8(%rbp),%rdx + movq 16(%rbp),%rcx + sub $40, %rsp + call __MINGW_USYMBOL(_mcount_private) + add $40, %rsp + pop %r11 + pop %r10 + pop %r9 + pop %r8 + pop %rdx + pop %rcx + pop %rax + leave + ret +#endif |