summaryrefslogtreecommitdiff
path: root/cmds
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2021-06-04 13:24:10 -0700
committerRyan Prichard <rprichard@google.com>2021-06-15 13:14:41 -0700
commit8bc1c3484cd8af74d044f5503fc078259cdca882 (patch)
treed572c9e97199dfdf1933f0680a932e2ce9ff3ecb /cmds
parentf34c9ede734be8bb831304bfd3a9ba22461cec6d (diff)
Stop exporting symbols from app_process
Any symbols exported from the executable override everything else in every linker namespace. Previously, app_process exported the signal/sigchain API, but that interposition is now handled by libsigchain.so. Bug: http://b/190100879 Test: `nm -D --defined-only app_process{32,64}` shows no symbols Change-Id: I1ab1fc700c34e91535c3e679a471debbb4eb71e3 (cherry picked from commit 6b86dfb159bd26bff4aa74895221e09dce7b0718)
Diffstat (limited to 'cmds')
-rw-r--r--cmds/app_process/Android.bp11
-rw-r--r--cmds/app_process/version-script.txt4
2 files changed, 14 insertions, 1 deletions
diff --git a/cmds/app_process/Android.bp b/cmds/app_process/Android.bp
index 0eff83c99282..a1575173ded6 100644
--- a/cmds/app_process/Android.bp
+++ b/cmds/app_process/Android.bp
@@ -29,7 +29,16 @@ cc_binary {
},
},
- ldflags: ["-Wl,--export-dynamic"],
+ // Symbols exported from the executable in .dynsym interpose symbols in every
+ // linker namespace, including an app's classloader namespace. Provide this
+ // version script to prevent unwanted interposition.
+ //
+ // By default, the static linker doesn't export most of an executable's symbols,
+ // but it will export a symbol that appears to override a symbol in a needed DSO.
+ // This commonly happens with C++ vaguely-linked entities, such as template
+ // functions or type_info variables. Hence, a version script is needed even for
+ // an executable.
+ version_script: "version-script.txt",
shared_libs: [
"libandroid_runtime",
diff --git a/cmds/app_process/version-script.txt b/cmds/app_process/version-script.txt
new file mode 100644
index 000000000000..a98066a67675
--- /dev/null
+++ b/cmds/app_process/version-script.txt
@@ -0,0 +1,4 @@
+{
+ local:
+ *;
+};