| Index: base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
|
| diff --git a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
|
| index dcf0754e23ac642dcd000c8a4cfeb601f9689a4b..4e7c6d63ed2d1eed7e455d5fd35c77fcf2c47db5 100644
|
| --- a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
|
| +++ b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
|
| @@ -161,9 +161,6 @@ public class LibraryLoader {
|
| boolean useChromiumLinker = Linker.isUsed();
|
|
|
| if (useChromiumLinker) {
|
| - // Load libraries using the Chromium linker.
|
| - Linker.prepareLibraryLoad();
|
| -
|
| // Check if the device supports loading a library directly from the APK file.
|
| String apkfile = context.getApplicationInfo().sourceDir;
|
| if (Linker.isInBrowserProcess()) {
|
| @@ -171,6 +168,8 @@ public class LibraryLoader {
|
| apkfile);
|
| }
|
|
|
| + Linker.prepareLibraryLoad();
|
| +
|
| for (String library : NativeLibraries.LIBRARIES) {
|
| String zipfile = null;
|
| if (Linker.isInZipFile()) {
|
| @@ -181,25 +180,27 @@ public class LibraryLoader {
|
| }
|
|
|
| boolean isLoaded = false;
|
| + String fallbackDir = context.getDir(
|
| + "fallback", Context.MODE_WORLD_READABLE).getPath();
|
| if (Linker.isUsingBrowserSharedRelros()) {
|
| sIsUsingBrowserSharedRelros = true;
|
| try {
|
| if (zipfile != null) {
|
| - Linker.loadLibraryInZipFile(zipfile, library);
|
| + Linker.loadLibraryInZipFile(zipfile, library, fallbackDir);
|
| } else {
|
| Linker.loadLibrary(library);
|
| }
|
| isLoaded = true;
|
| } catch (UnsatisfiedLinkError e) {
|
| Log.w(TAG, "Failed to load native library with shared RELRO, " +
|
| - "retrying without");
|
| + "retrying without");
|
| Linker.disableSharedRelros();
|
| sLoadAtFixedAddressFailed = true;
|
| }
|
| }
|
| if (!isLoaded) {
|
| if (zipfile != null) {
|
| - Linker.loadLibraryInZipFile(zipfile, library);
|
| + Linker.loadLibraryInZipFile(zipfile, library, fallbackDir);
|
| } else {
|
| Linker.loadLibrary(library);
|
| }
|
| @@ -214,7 +215,7 @@ public class LibraryLoader {
|
| System.loadLibrary(library);
|
| } catch (UnsatisfiedLinkError e) {
|
| if (context != null
|
| - && LibraryLoaderHelper.tryLoadLibraryUsingWorkaround(context,
|
| + && LibraryLoaderHelper.tryLoadLibraryUsingWorkaround(context,
|
| library)) {
|
| sNativeLibraryHackWasUsed = true;
|
| } else {
|
| @@ -225,10 +226,10 @@ public class LibraryLoader {
|
| }
|
|
|
| if (context != null
|
| - && shouldDeleteOldWorkaroundLibraries
|
| - && !sNativeLibraryHackWasUsed) {
|
| + && shouldDeleteOldWorkaroundLibraries
|
| + && !sNativeLibraryHackWasUsed) {
|
| LibraryLoaderHelper.deleteWorkaroundLibrariesAsynchronously(
|
| - context);
|
| + context);
|
| }
|
|
|
| long stopTime = SystemClock.uptimeMillis();
|
|
|