diff options
| author | Jiyong Park <jiyong@google.com> | 2019-08-28 23:06:42 +0900 |
|---|---|---|
| committer | Jiyong Park <jiyong@google.com> | 2019-09-10 12:51:19 +0900 |
| commit | 5e88b099ec6b96852794dffa3b3f2585c774e05b (patch) | |
| tree | 1a84634bb17761848fdaca9e68d6e933eb069a31 /annotations/generate_annotated_java_files.py | |
| parent | 3e6b27338e687a465889a4ac0d0d8ec6d51abf6e (diff) | |
Don't give up when loader.findLibrary() fails
When System.loadLibrary(libname) is called, the library file for the
libname is searched in the native library paths set to the current
classloader. Previously, if the search was failed, actual loading of the
lib was not attempted at all. This however is too restrictive in Android
where the dynamic linker that actually is responsible for finding and
loading libraries has a concept of linker namespaces. With linker
namespaces, whether a library can be loaded or not is not simply
determined by checking whether the lib is found in one of the library
search paths. A lib can be loaded also when there is a link from the
current linker namespace to another linker namespace with the library's
soname specified over the link. In that case, the library is searched in
the search paths of the target linker namespace.
So, a failure of loader.findLibrary() doesn't necessary mean that the
library is never loadable. This caused a problem like b/93333337, which
required us to do the non-trivial ad-hoc change:
cfe38cdb1cc45c8b7dcbe4f39329551f6602b9ce in frameworks/base.
In this change, even when loader.findLibrary() fails, we try to load the
library with its soname, not with the absolute file path.
Bug: 109720125
Test: System.loadLibrary("adsprpc") is successful in Pixel (because
libadsprpc.so is in Pixel's vendor public lib list)
Test: atest cts/tests/tests/jni
Merged-In: Ia2525e736f91460a50f2def3d6a04bf3cf8c221d
(cherry picked from commit 8f712189dfc02285573337e2b4ab17678011db14)
Change-Id: Ia2525e736f91460a50f2def3d6a04bf3cf8c221d
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions
