Dr. David Alan Gilbert <dgilb...@redhat.com> writes: > * Ayaz Akram (aaq...@gmail.com) wrote: >> Thanks for your answers. The thing that i still do not get is once we have >> host assembly code (output assembly log generated for compiled TBs ), >> should we still worry about problems like self modifying code and other >> dynamic conditions? Moreover, assuming static linking, will not this code >> be enough to generate .text section of an executable that could be run >> directly on host (if somehow other sections of that host executable can be >> generated, which is itself difficult) ? > > It can certainly help, but you can still walk into a piece of code > that you've not previously translated, and a shared library for example > might change, and your code might change due to other things such as > randomisation of library loading addresses. <snip> > You say 'should we still worry about problems like self modifying code and > other > dynamic conditions?' - well you hope that for most 'normal' programs that > self modification doesn't happen; but it keeps turning up even when you don't > expect it, e.g. loading/unloading of plugins or if you happen to be > emulating a JIT (such as qemu!).
I think PLT patching is another case of self modifying code you often come across. -- Alex Bennée