commit:     f3771c85733121119db11be6424c8f46e21a288e
Author:     Manoj Gupta <manojgupta <AT> google <DOT> com>
AuthorDate: Sun Nov 17 03:05:42 2019 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Mar 26 17:09:11 2020 +0000
URL:        https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=f3771c85

lddtree: Put ldso interpreter library path at end

Put ldso interpreter library path at end of libpaths search.
It is supposed to be a final fallback path in case library
search was incomplete.

As a side effect, it currently mitigates the incorrect
libbfd being loaded for aarch64 standalone toolchain.

Bug: https://crbug.com/917193
Reviewed-on: https://crrev.com/c/1920643
Signed-off-by: Manoj Gupta <manojgupta <AT> chromium.org>
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 lddtree.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lddtree.py b/lddtree.py
index f453d13..6e57a99 100755
--- a/lddtree.py
+++ b/lddtree.py
@@ -147,7 +147,8 @@ def GenerateLdsoWrapper(root, path, interp, libpaths=()):
   """
   basedir = os.path.dirname(path)
   interp_dir, interp_name = os.path.split(interp)
-  libpaths = dedupe([interp_dir] + list(libpaths))
+  # Add ldso interpreter dir to end of libpaths as a fallback library path.
+  libpaths = dedupe(list(libpaths) + [interp_dir])
   replacements = {
       'interp': os.path.join(os.path.relpath(interp_dir, basedir),
                              interp_name),

Reply via email to