summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2019-11-16 19:05:42 -0800
committerMike Frysinger <vapier@gentoo.org>2020-03-26 13:09:11 -0400
commitf3771c85733121119db11be6424c8f46e21a288e (patch)
treeab9b840a782a23a1b5518d293bccc2ac4e6ed049
parentpylintrc: enable more warnings (diff)
downloadpax-utils-f3771c85733121119db11be6424c8f46e21a288e.tar.gz
pax-utils-f3771c85733121119db11be6424c8f46e21a288e.tar.bz2
pax-utils-f3771c85733121119db11be6424c8f46e21a288e.zip
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@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xlddtree.py3
1 files changed, 2 insertions, 1 deletions
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),