From adf4503de10b5af9c4ca4327d9a29e6851f8b2c7 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Tue, 26 Mar 2019 16:30:23 +0000 Subject: [PATCH] Apply the standard system linker config to all of /data. This is necessary to get the correct APEX namespace setup for apps that executes binaries from there. In older releases no linker config applied to binaries in /data, so the fallback config in /system/bin/linker was used, which basically just looked up libraries in /system/{lib,lib64}. With the introduction of APEXes that location no longer contains the complete set of libraries, so this is necessary to retain functional parity. Strictly speaking this fallback rule should apply as last resort for a binary in any location, but the linker does not accept "dir.system = /". Test: Flash and boot Test: The app regression in b/128569634 Bug: 128569634 Change-Id: Icfcd66f0a7d8d898618be1b6186bb1111d20d688 --- rootdir/etc/ld.config.legacy.txt | 9 ++++----- rootdir/etc/ld.config.txt | 9 ++++----- rootdir/etc/ld.config.vndk_lite.txt | 9 ++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/rootdir/etc/ld.config.legacy.txt b/rootdir/etc/ld.config.legacy.txt index 9cf93ca02..7a4ee3ab5 100644 --- a/rootdir/etc/ld.config.legacy.txt +++ b/rootdir/etc/ld.config.legacy.txt @@ -11,14 +11,13 @@ dir.legacy = /vendor dir.legacy = /odm dir.legacy = /sbin -dir.legacy = /data/nativetest -dir.legacy = /data/nativetest64 -dir.legacy = /data/benchmarktest -dir.legacy = /data/benchmarktest64 - # Except for /postinstall, where only /system and /product are searched dir.postinstall = /postinstall +# Fallback entry to provide APEX namespace lookups for binaries anywhere else. +# This must be last. +dir.legacy = /data + [legacy] namespace.default.isolated = false diff --git a/rootdir/etc/ld.config.txt b/rootdir/etc/ld.config.txt index 85deacf75..b61c65734 100644 --- a/rootdir/etc/ld.config.txt +++ b/rootdir/etc/ld.config.txt @@ -27,13 +27,12 @@ dir.unrestricted = /data/nativetest64/unrestricted # necessary) the unrestricted subdirs above. Then clean this up. dir.unrestricted = /data/local/tmp -dir.system = /data/nativetest -dir.system = /data/nativetest64 -dir.system = /data/benchmarktest -dir.system = /data/benchmarktest64 - dir.postinstall = /postinstall +# Fallback entry to provide APEX namespace lookups for binaries anywhere else. +# This must be last. +dir.system = /data + [system] additional.namespaces = runtime,conscrypt,media,resolv,sphal,vndk,rs diff --git a/rootdir/etc/ld.config.vndk_lite.txt b/rootdir/etc/ld.config.vndk_lite.txt index 26e1dd9ac..16d2bf245 100644 --- a/rootdir/etc/ld.config.vndk_lite.txt +++ b/rootdir/etc/ld.config.vndk_lite.txt @@ -27,13 +27,12 @@ dir.unrestricted = /data/nativetest64/unrestricted # necessary) the unrestricted subdirs above. Then clean this up. dir.unrestricted = /data/local/tmp -dir.system = /data/nativetest -dir.system = /data/nativetest64 -dir.system = /data/benchmarktest -dir.system = /data/benchmarktest64 - dir.postinstall = /postinstall +# Fallback entry to provide APEX namespace lookups for binaries anywhere else. +# This must be last. +dir.system = /data + [system] additional.namespaces = runtime,conscrypt,media,resolv,sphal,vndk,rs