[MPlayer-dev-eng] OT: loader/stubs.s:EH_prolog convertion to C

Alex Beregszaszi alex at naxine.org
Wed Oct 23 21:21:21 CEST 2002


Hi,

> > i've converted it into C using gcc __asm__, but I got some questions:
> > 
> > original function:
> > 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
> 
> This function is very magical by the looks of things - it doesn't return to
> caller, it jumps to some place else that it figured out and passes various args
> to that place. This plain CANNOT be done in C. Why do you want to do it? if it
> is to get rid of the file, just put the whole thing into at asm() block and
> leave it alone :) (Your version will cause stack corruption too if we ever go
> back up the stack as gcc has pushed some garbage onto there)
read my mail to the end first.

i do not want to convert it to C, only insert it into C source file as __asm__(...)

and yes, it doesn't returns to the caller, instead it calls some functions inside the caller
dll (and it works).

first it did corruptions, but after some tricks it's working nice. I only wanted to get
some hints if it can be done better.

-- 
Alex Beregszaszi  <alex at naxine.org>



More information about the MPlayer-dev-eng mailing list