summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-29 12:56:52 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-29 12:56:52 +0000
commit9e9d77018e3f55466cbbebdf2573b0d62f355f02 (patch)
tree0961eec8b4ae4f083d7fa3f6d94acc1aa32c7a8a /loader
parent2199f67906e0fed86393263e0d37099fa3170283 (diff)
downloadmpv-9e9d77018e3f55466cbbebdf2573b0d62f355f02.tar.bz2
mpv-9e9d77018e3f55466cbbebdf2573b0d62f355f02.tar.xz
Get rid of stubs.S, move code to inline asm.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21384 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r--loader/Makefile2
-rw-r--r--loader/stubs.S17
-rw-r--r--loader/win32.c22
3 files changed, 21 insertions, 20 deletions
diff --git a/loader/Makefile b/loader/Makefile
index db76af84b1..299d5ed629 100644
--- a/loader/Makefile
+++ b/loader/Makefile
@@ -8,7 +8,7 @@ CFLAGS= -Idshow -DMPLAYER -D__WINE__ -DNOAVIFILE_HEADERS
SRCS= driver.c afl.c vfl.c
ifneq ($(TARGET_WIN32),yes)
SRCS+= ldt_keeper.c pe_image.c module.c ext.c win32.c \
- pe_resource.c resource.c registry.c elfdll.c stubs.S
+ pe_resource.c resource.c registry.c elfdll.c
# QTX emulation is not supported in Darwin
ifneq ($(TARGET_OS),Darwin)
SRCS+= wrapper.S
diff --git a/loader/stubs.S b/loader/stubs.S
deleted file mode 100644
index dac38b0fdf..0000000000
--- a/loader/stubs.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#if defined(__APPLE__)
-# define SYM(x) _ ## x
-#else
-# define SYM(x) x
-#endif
- .data
-.globl SYM(exp_EH_prolog)
-SYM(exp_EH_prolog):
- pushl $0xff
- pushl %eax
- pushl %fs:0
- movl %esp, %fs:0
- movl 12(%esp), %eax
- movl %ebp, 12(%esp)
- leal 12(%esp), %ebp
- pushl %eax
- ret
diff --git a/loader/win32.c b/loader/win32.c
index 9eae50b860..40059ab846 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -18,6 +18,7 @@ for DLL to know too much about its environment.
*/
#include "config.h"
+#include "mangle.h"
#ifdef MPLAYER
#ifdef USE_QTX_CODECS
@@ -4587,8 +4588,25 @@ static INT WINAPI expMessageBoxA(HWND hWnd, LPCSTR text, LPCSTR title, UINT type
/* these are needed for mss1 */
-/* defined in stubs.s */
-void exp_EH_prolog(void);
+/**
+ * \brief this symbol is defined within exp_EH_prolog_dummy
+ * \param dest jump target
+ */
+void exp_EH_prolog(void *dest);
+//! just a dummy function that acts a container for the asm section
+void exp_EH_prolog_dummy(void) {
+ asm volatile (
+// take care, this "function" may not change flags or
+// registers besides eax (which is also why we can't use
+// exp_EH_prolog_dummy directly)
+MANGLE(exp_EH_prolog)": \n\t"
+ "pop %eax \n\t"
+ "push %ebp \n\t"
+ "mov %esp, %ebp \n\t"
+ "lea -12(%esp), %esp \n\t"
+ "jmp *%eax \n\t"
+ );
+}
#include <netinet/in.h>
static WINAPI inline unsigned long int exphtonl(unsigned long int hostlong)