From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9uXT-0000Ib-6K for qemu-devel@nongnu.org; Tue, 30 Jun 2015 08:21:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9uXP-0003vH-5z for qemu-devel@nongnu.org; Tue, 30 Jun 2015 08:21:23 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:35208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9uXO-0003uc-Vm for qemu-devel@nongnu.org; Tue, 30 Jun 2015 08:21:19 -0400 Received: by wiga1 with SMTP id a1so96638653wig.0 for ; Tue, 30 Jun 2015 05:21:17 -0700 (PDT) References: <20150629151352.GA24772@stefanha-thinkpad.redhat.com> <20150630112608.GC2142@work-vm> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <20150630112608.GC2142@work-vm> Date: Tue, 30 Jun 2015 13:21:16 +0100 Message-ID: <877fql75fn.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] QEMU to generate host binary List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: Ayaz Akram , Peter Crosthwaite , "qemu-devel@nongnu.org Developers" , Stefan Hajnoczi Dr. David Alan Gilbert writes: > * Ayaz Akram (aaqemu@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. > 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