From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13710 invoked by alias); 26 May 2012 03:42:28 -0000 Received: (qmail 13702 invoked by uid 22791); 26 May 2012 03:42:27 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 May 2012 03:42:14 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SY7tN-0005vm-6n from Maxim_Kuvyrkov@mentor.com ; Fri, 25 May 2012 20:42:13 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 25 May 2012 20:42:13 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Sat, 26 May 2012 04:42:10 +0100 Subject: Re: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch MIME-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset="iso-8859-1" From: Maxim Kuvyrkov In-Reply-To: <4F8496BA.3010706@windriver.com> Date: Sat, 26 May 2012 03:42:00 -0000 CC: Content-Transfer-Encoding: quoted-printable Message-ID: <10862750-7E5E-4B2C-9FEF-1EADEB197044@codesourcery.com> References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@windriver.com> <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> <4F8496BA.3010706@windriver.com> To: Mark Hatle Mailing-List: contact prelink-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: prelink-owner@sourceware.org X-SW-Source: 2012-q2/txt/msg00004.txt.bz2 On 11/04/2012, at 8:23 AM, Mark Hatle wrote: > On 4/10/12 2:56 PM, Maxim Kuvyrkov wrote: >> On 11/04/2012, at 7:46 AM, Mark Hatle wrote: >>=20 >>> On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: >>>> Mark, >>>>=20 >>>> This patch makes rtld emulator in cross prelink use ld.so's name as it= is encoded in PT_INTERP header. >>>>=20 >>>> Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's na= me, but the linker actually expects "/lib/ld.so.1" -- that one slash at the= beginning causes prelink checks done by the runtime linker to fail and not= use prelink information. >>>>=20 >>>> The runtime linker sets up a map for itself under the name stored in P= T_INTERP header of the executable, and this patch makes rtld emulator follo= w the suit. >>>>=20 >>>> I have tested this patch using a different version of rtld emulator (t= he one that CodeSourcery / Mentor maintains), but the function in question = is the same in both, so this patch is also relevant for Yocto's prelink. >>>>=20 >>>> Any comments? Please merge at your leisure. >>>=20 >>> prelinker currently checks that the ld.so name matches what it's expect= ing for any given arch in the PL_ARCH structure. Does this change any of t= hat behavior? Or does it simply change the internal prelink-rtld behavior = so that it the prelink-rtld acts as if it's name is the PT_INTERP element? >>=20 >> It is the latter. Only behavior of prelink-rtld is change to the effect= that it outputs "/lib/ld.so.1 -> /lib/ld.so.1 ..." as executable's depend= ency. >>=20 >> Forgot to mention: the dependency on ld.so.1 [usually] comes from libdl.= so, which is, probably, why this bug wasn't noticed before. >=20 > Thanks, I think I understand what is going on now. I'll look into gettin= g this merged into the cross prelinker later today or tomorrow. Mark, This patch is still not merged to cross-prelink, did you encounter a proble= m with it? Thank you, -- Maxim Kuvyrkov CodeSourcery / Mentor Graphics