Quoth Geert Uytterhoeven: > b. Use 2 separate stacks: > 1. The standard stack for return addresses (jump to > subroutine), so you can relocate all addresses (pointers > to code) when moving/copying the code, > 2. A second stack for storing data (mix of "pointers" > and other variables), which you don't touch when moving > (remember, all pointers are actually offsets relative to > the base register).
What about other pointers to code (vtables, app-defined variables, etc)? I don't think you can rely on everything being in the stack. Although as long as processes aren't modifying their own code (which can't always be guaranteed, but isn't common) then there's no need to copy the code at all. Just point both parent and child at the same code but copy their data segment (and keep data pointers relative to the base register). _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev