public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger (vapier)" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-projects commit in pax-utils: lddtree.py
Date: Sat,  5 Jan 2013 20:39:56 +0000 (UTC)	[thread overview]
Message-ID: <20130105203956.9FF422171D@flycatcher.gentoo.org> (raw)

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 <vapier@gentoo.org>
 # 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)
 





             reply	other threads:[~2013-01-05 20:40 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-05 20:39 Mike Frysinger (vapier) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-20  1:22 [gentoo-commits] gentoo-projects commit in pax-utils: lddtree.py Mike Frysinger (vapier)
2014-11-20  1:17 Mike Frysinger (vapier)
2014-11-20  1:13 Mike Frysinger (vapier)
2014-08-01  2:20 Mike Frysinger (vapier)
2014-08-01  1:39 Mike Frysinger (vapier)
2014-07-30 14:35 Mike Frysinger (vapier)
2014-07-30  8:22 Mike Frysinger (vapier)
2014-07-30  4:34 Mike Frysinger (vapier)
2014-07-30  4:28 Mike Frysinger (vapier)
2014-07-30  4:16 Mike Frysinger (vapier)
2014-07-30  4:07 Mike Frysinger (vapier)
2014-07-30  4:06 Mike Frysinger (vapier)
2014-03-20  8:25 Mike Frysinger (vapier)
2014-03-20  8:18 Mike Frysinger (vapier)
2013-04-23  2:16 Mike Frysinger (vapier)
2013-04-22 22:02 Mike Frysinger (vapier)
2013-04-22 18:31 Mike Frysinger (vapier)
2013-04-05 22:26 Mike Frysinger (vapier)
2013-04-03  4:51 Mike Frysinger (vapier)
2013-03-28 17:14 Mike Frysinger (vapier)
2013-03-28  1:17 Mike Frysinger (vapier)
2013-03-28  0:58 Mike Frysinger (vapier)
2013-03-27  3:22 Mike Frysinger (vapier)
2013-03-27  3:20 Mike Frysinger (vapier)
2013-03-27  3:20 Mike Frysinger (vapier)
2013-03-27  3:07 Mike Frysinger (vapier)
2013-03-26  5:22 Mike Frysinger (vapier)
2013-03-26  5:03 Mike Frysinger (vapier)
2013-03-26  4:50 Mike Frysinger (vapier)
2013-03-25 22:35 Mike Frysinger (vapier)
2013-03-24  5:37 Mike Frysinger (vapier)
2013-03-24  5:27 Mike Frysinger (vapier)
2013-03-23  7:28 Mike Frysinger (vapier)
2013-03-21 22:55 Mike Frysinger (vapier)
2013-03-21  3:04 Mike Frysinger (vapier)
2013-03-21  3:03 Mike Frysinger (vapier)
2012-12-14  4:22 Mike Frysinger (vapier)
2012-11-26 20:06 Mike Frysinger (vapier)
2012-11-24 19:44 Mike Frysinger (vapier)
2012-11-24 17:01 Mike Frysinger (vapier)
2012-11-24 16:54 Mike Frysinger (vapier)
2012-11-17  0:11 Mike Frysinger (vapier)
2012-11-16 23:53 Mike Frysinger (vapier)
2012-11-15 20:39 Mike Frysinger (vapier)
2012-11-15 20:28 Mike Frysinger (vapier)
2012-11-15 20:26 Mike Frysinger (vapier)
2012-11-15 19:33 Mike Frysinger (vapier)
2012-11-13  5:10 Mike Frysinger (vapier)
2012-11-13  2:33 Mike Frysinger (vapier)
2012-11-12 23:08 Mike Frysinger (vapier)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130105203956.9FF422171D@flycatcher.gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox