Patrik Stridvall wrote:
> Hmm, EBX is 0. That shouldn't happend. This is perhaps
> because the GOT must be reloaded in EBX before the call.
Correct. You need to have the GOT in %ebx before calling any
PLT stub ... (Hmpf. I missed that as well :-/)
> Perhaps it worked for me by pure luck. A previous
> function had set EBX to the GOT. Not very unlikely though.
Probably because you loaded it just before, when calling
EnterCriticalSection ;-)
> Anyway, this new version works for me as well.
Hmmm. There's still one problem, though: both the Linux/ELF and
the Win32 ABI assume that %ebx is preserved across function calls.
This means on the one hand that you don't need to reload the GOT
all the time, but much more importantly on the other hand that you
really shouldn't corrupt the caller's %ebx :-/
This won't have any effect if you're just running trivial test
cases, but when a non-trivial routine calls one of these stubs,
it will matter ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
[EMAIL PROTECTED]