From 9e9d77018e3f55466cbbebdf2573b0d62f355f02 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 29 Nov 2006 12:56:52 +0000 Subject: 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 --- loader/Makefile | 2 +- loader/stubs.S | 17 ----------------- loader/win32.c | 22 ++++++++++++++++++++-- 3 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 loader/stubs.S (limited to 'loader') 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 static WINAPI inline unsigned long int exphtonl(unsigned long int hostlong) -- cgit v1.2.3