From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 81A801382EB for ; Sat, 5 Jan 2013 20:40:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3951321C07F; Sat, 5 Jan 2013 20:39:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BB01421C07F for ; Sat, 5 Jan 2013 20:39:58 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D6F9633DA78 for ; Sat, 5 Jan 2013 20:39:57 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 559) id 9FF422171D; Sat, 5 Jan 2013 20:39:56 +0000 (UTC) From: "Mike Frysinger (vapier)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, vapier@gentoo.org Subject: [gentoo-commits] gentoo-projects commit in pax-utils: lddtree.py X-VCS-Repository: gentoo-projects X-VCS-Files: lddtree.py X-VCS-Directories: pax-utils X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20130105203956.9FF422171D@flycatcher.gentoo.org> Date: Sat, 5 Jan 2013 20:39:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 58b08af8-c9b4-4ab2-a61d-0c494b51b5d5 X-Archives-Hash: 2530aa9d0be8f7b2390752fb9684160a vapier 13/01/05 20:39:56 Modified: lddtree.py Log: lddtree.py: leverage the rpaths from the main executable to better locate libs that get used Revision Changes Path 1.18 pax-utils/lddtree.py file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.18&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.18&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.17&r2=1.18 Index: lddtree.py =================================================================== RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- lddtree.py 14 Dec 2012 04:22:52 -0000 1.17 +++ lddtree.py 5 Jan 2013 20:39:56 -0000 1.18 @@ -2,7 +2,7 @@ # Copyright 2012 Gentoo Foundation # Copyright 2012 Mike Frysinger # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.17 2012/12/14 04:22:52 vapier Exp $ +# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.18 2013/01/05 20:39:56 vapier Exp $ """Read the ELF dependency tree and show it @@ -224,10 +224,13 @@ """ if _first: _all_libs = {} + ldpaths = ldpaths.copy() ret = { 'interp': None, 'path': path, 'needed': [], + 'rpath': [], + 'runpath': [], 'libs': _all_libs, } @@ -272,7 +275,16 @@ # If both RPATH and RUNPATH are set, only the latter is used. rpaths = [] + # XXX: We assume there is only one PT_DYNAMIC. This is + # probably fine since the runtime ldso does the same. break + if _first: + # Propagate the rpaths used by the main ELF since those will be + # used at runtime to locate things. + ldpaths['rpath'] = rpaths + ldpaths['runpath'] = runpaths + ret['rpath'] = rpaths + ret['runpath'] = runpaths ret['needed'] = libs # Search for the libs this ELF uses. @@ -281,7 +293,7 @@ if lib in _all_libs: continue if all_ldpaths is None: - all_ldpaths = rpaths + ldpaths['env'] + runpaths + ldpaths['conf'] + ldpaths['interp'] + all_ldpaths = rpaths + ldpaths['rpath'] + ldpaths['env'] + runpaths + ldpaths['runpath'] + ldpaths['conf'] + ldpaths['interp'] fullpath = FindLib(elf, lib, all_ldpaths) _all_libs[lib] = { 'path': fullpath, @@ -301,7 +313,7 @@ def _ShowVersion(_option, _opt, _value, _parser): - id = '$Id: lddtree.py,v 1.17 2012/12/14 04:22:52 vapier Exp $'.split() + id = '$Id: lddtree.py,v 1.18 2013/01/05 20:39:56 vapier Exp $'.split() print('%s-%s %s %s' % (id[1].split('.')[0], id[2], id[3], id[4])) sys.exit(0)