From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19901 invoked by alias); 10 Apr 2012 19:57:19 -0000 Received: (qmail 19891 invoked by uid 22791); 10 Apr 2012 19:57:18 -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; Tue, 10 Apr 2012 19:57:03 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SHhBW-0005Oq-Lf from Maxim_Kuvyrkov@mentor.com ; Tue, 10 Apr 2012 12:57:02 -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); Tue, 10 Apr 2012 12:57:02 -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; Tue, 10 Apr 2012 20:57:00 +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 v1257) Content-Type: text/plain; charset="iso-8859-1" From: Maxim Kuvyrkov In-Reply-To: <4F848E15.1030905@windriver.com> Date: Tue, 10 Apr 2012 19:57:00 -0000 CC: Content-Transfer-Encoding: quoted-printable Message-ID: <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@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/msg00002.txt.bz2 On 11/04/2012, at 7:46 AM, Mark Hatle wrote: > 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 i= s encoded in PT_INTERP header. >>=20 >> Currently, rtld emulator returns "lib/ld.so.1" for runtime linker's name= , but the linker actually expects "/lib/ld.so.1" -- that one slash at the b= eginning causes prelink checks done by the runtime linker to fail and not u= se prelink information. >>=20 >> The runtime linker sets up a map for itself under the name stored in PT_= INTERP header of the executable, and this patch makes rtld emulator follow = the suit. >>=20 >> I have tested this patch using a different version of rtld emulator (the= 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 expectin= g for any given arch in the PL_ARCH structure. Does this change any of tha= t 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? It is the latter. Only behavior of prelink-rtld is change to the effect th= at it outputs "/lib/ld.so.1 -> /lib/ld.so.1 ..." as executable's dependency. Forgot to mention: the dependency on ld.so.1 [usually] comes from libdl.so,= which is, probably, why this bug wasn't noticed before. -- Maxim Kuvyrkov CodeSourcery / Mentor Graphics