From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39173 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhoAq-0007P1-Jp for qemu-devel@nongnu.org; Tue, 25 Jan 2011 14:03:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhoAp-0000Wu-ET for qemu-devel@nongnu.org; Tue, 25 Jan 2011 14:03:28 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:33140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhoAp-0000WN-3r for qemu-devel@nongnu.org; Tue, 25 Jan 2011 14:03:27 -0500 Received: by wwi18 with SMTP id 18so118061wwi.10 for ; Tue, 25 Jan 2011 11:03:26 -0800 (PST) Message-ID: <4D3F1E7C.6050200@gmail.com> Date: Tue, 25 Jan 2011 20:03:24 +0100 From: Stefano Bonifazi MIME-Version: 1.0 Subject: Re: [Qemu-devel] qemu-user: relocating target code weakness References: <4D3D63B3.1030402@gmail.com> <4D3DD713.10405@twiddle.net> <4D3DF2A9.3080609@gmail.com> <4D3E292E.9090001@twiddle.net> <4D3E8E22.7070208@gmail.com> <4D3EAA40.30300@gmail.com> <4D3EF8C1.8010507@twiddle.net> In-Reply-To: <4D3EF8C1.8010507@twiddle.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: QEMU Developers , Mike Frysinger On 01/25/2011 05:22 PM, Richard Henderson wrote: > On 01/25/2011 02:47 AM, Stefano Bonifazi wrote: >> You keep getting the name of the dynamic linker from the PT_INTERP program segment, but that gives you the absolute position of the dynamic linker inside the machine the target binary was created in. >> Here qemu-user is an emultaor used for running that binary into another machine.. >> Qemu default to usr/gnemul/ the path where the libs for the target machines are stored... >> So we need to patch the absolute dynamic linker name with the proper path.. > In load_elf_interp, > > fd = open(path(filename), O_RDONLY); > > Notice the path function call. That does the translation into gnemul, given > the proper configure option, or -L command-line option. > > > r~ Hi! Strange, I have all the target libs in the default host usr/gnemul folder, but your fixed qemu still complained for not finding ld.so.1 until I fixed the code.. I'll try to check why "path" doesn't work! Thank you! Best regards! Stefano B.