On Mon, Mar 27, 2006 at 11:30:05PM +0100, Blaisorblade wrote:
> That is problem #1, and exists; but when answering I thought to problem #2, 
> i.e. that the stub code currently hardcodes the location of the stub data 
> page, and that this must be fixed; I didn't notice that we must first put the
> stubs somewhere.

I see - you're one problem ahead of me.

I'm wondering if we can play some linker tricks for this.  Stick a
word of data on the code page and put the data page address in it.
Then the stub just reads that in order to get the data.

> 
> So I remembered that trick to get EIP which I read time ago (the purpose was 
> to make some code Position-Independent exactly injecting some code into 
> another process address space).

That's the standard way of getting your EIP on x86 since there's no
move from EIP instruction.  That will work, too, but (as you point
out) requires a register.

> > Another approach is to start with the current top of stack

Hmmmm :-)  Maybe easier said than done.  I was thinking about figuring
that out as basically the first thing in main, but I can think of
reasons that wouldn't be robust.

Other schemes, which involve a binary search for the boundary by using
test mmaps, involve the risk of unmapping part of the stack.

                                Jeff


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to