Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-07-20 08:59:15 +0400
committerChristopher Faylor <me@cgf.cx>2002-07-20 08:59:15 +0400
commit5ec1dcc5bfc1762b4dec338e4a259272658c3c74 (patch)
treebc1c863df390b36bc99ec439830ee318ce9dda23 /winsup/cygwin/autoload.cc
parent504628e7824cf2479572ad1a0738ed4947728879 (diff)
* autoload.cc (LoadDLLprime): Add jmp call to allow streamlining of later jmp
rewrite. (doit): Avoid use of cx register. Just change one word to avoid races.
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r--winsup/cygwin/autoload.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 05141e53f..e3d34f42c 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -84,9 +84,11 @@ details. */
.align 8 \n\
_" mangle (name, n) ": \n\
_win32_" mangle (name, n) ": \n\
- movl (1f),%eax \n\
+ .byte 0xe9 \n\
+ .long -4 + 1f - . \n\
+1:movl (2f),%eax \n\
call *(%eax) \n\
-1:.long ." #dllname "_info \n\
+2:.long ." #dllname "_info \n\
.long (" #n "+" #notimp ") | " #err "<<16 \n\
.asciz \"" #name "\" \n\
.text \n\
@@ -153,12 +155,11 @@ dll_func_load: \n\
jne gotit # Yes \n\
jmp noload # Issue an error or return \n\
gotit: \n\
- popl %ecx # Pointer to 'return address' \n\
- movb $0xe9,-7(%ecx) # Turn preceding call to a jmp *%eax \n\
- movl %eax,%edx # Save \n\
- subl %ecx,%eax # Make it relative \n\
- addl $2,%eax # Tweak \n\
- movl %eax,-6(%ecx) # Move relative address after jump \n\
+ popl %edx # Pointer to 'return address' \n\
+ subl %edx,%eax # Make it relative \n\
+ addl $7,%eax # Tweak \n\
+ subl $12,%edx # Point to jmp \n\
+ movl %eax,1(%edx) # Move relative address after jump \n\
jmp *%edx # Jump to actual function \n\
\n\
.global dll_chain \n\