From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32618 invoked by alias); 10 Apr 2012 20:23:49 -0000 Received: (qmail 32576 invoked by uid 22791); 10 Apr 2012 20:23:43 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail1.windriver.com (HELO mail1.windriver.com) (147.11.146.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Apr 2012 20:23:26 +0000 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca [147.11.189.40]) by mail1.windriver.com (8.14.3/8.14.3) with ESMTP id q3AKNNhL028969 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 10 Apr 2012 13:23:23 -0700 (PDT) Received: from msp-dhcp19.wrs.com (172.25.34.19) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.1.255.0; Tue, 10 Apr 2012 13:23:22 -0700 Message-ID: <4F8496BA.3010706@windriver.com> Date: Tue, 10 Apr 2012 20:23:00 -0000 From: Mark Hatle User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Maxim Kuvyrkov CC: Subject: Re: [PATCH, cross prelink] 0001-Pull-ld.so-s-name-from-PT_INTERP-to-avoid-the-runtim.patch References: <78E2B6DA-6156-43B6-B788-C8501057C234@codesourcery.com> <4F848E15.1030905@windriver.com> <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> In-Reply-To: <9C676A7D-F066-4041-B3FB-4F02653D8588@codesourcery.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00003.txt.bz2 On 4/10/12 2:56 PM, Maxim Kuvyrkov wrote: > On 11/04/2012, at 7:46 AM, Mark Hatle wrote: > >> On 4/10/12 2:27 PM, Maxim Kuvyrkov wrote: >>> Mark, >>> >>> This patch makes rtld emulator in cross prelink use ld.so's name as it is encoded in PT_INTERP header. >>> >>> 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 beginning causes prelink checks done by the runtime linker to fail and not use prelink information. >>> >>> 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. >>> >>> 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. >>> >>> Any comments? Please merge at your leisure. >> >> prelinker currently checks that the ld.so name matches what it's expecting for any given arch in the PL_ARCH structure. Does this change any of that 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 that 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. Thanks, I think I understand what is going on now. I'll look into getting this merged into the cross prelinker later today or tomorrow. --Mark > -- > Maxim Kuvyrkov > CodeSourcery / Mentor Graphics >