aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-07-20 04:59:15 +0000
committerChristopher Faylor <me@cgf.cx>2002-07-20 04:59:15 +0000
commit5ec1dcc5bfc1762b4dec338e4a259272658c3c74 (patch)
treebc1c863df390b36bc99ec439830ee318ce9dda23
parent504628e7824cf2479572ad1a0738ed4947728879 (diff)
downloadnewlib-5ec1dcc5bfc1762b4dec338e4a259272658c3c74.zip
newlib-5ec1dcc5bfc1762b4dec338e4a259272658c3c74.tar.gz
newlib-5ec1dcc5bfc1762b4dec338e4a259272658c3c74.tar.bz2
* 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.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/autoload.cc17
2 files changed, 15 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 74d3eb6..01a2b09 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2002-07-20 Christopher Faylor <cgf@redhat.com>
+
+ * 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.
+
2002-07-18 Pierre Humblet <pierre.humblet@ieee.org>
* security.cc (get_unix_group_sidlist): Create.
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 05141e5..e3d34f4 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\