From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45377 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Phlf6-0005z3-69 for qemu-devel@nongnu.org; Tue, 25 Jan 2011 11:22:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Phlf3-0003Tx-IC for qemu-devel@nongnu.org; Tue, 25 Jan 2011 11:22:30 -0500 Received: from b.mail.sonic.net ([64.142.19.5]:42659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Phlf3-0003Tc-AY for qemu-devel@nongnu.org; Tue, 25 Jan 2011 11:22:29 -0500 Message-ID: <4D3EF8C1.8010507@twiddle.net> Date: Tue, 25 Jan 2011 08:22:25 -0800 From: Richard Henderson 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> In-Reply-To: <4D3EAA40.30300@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Bonifazi Cc: QEMU Developers , Mike Frysinger 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~