Index: base/android/java/src/org/chromium/base/library_loader/Linker.java |
diff --git a/base/android/java/src/org/chromium/base/library_loader/Linker.java b/base/android/java/src/org/chromium/base/library_loader/Linker.java |
index 2a3006ad174741b127dd62194b72abfbd2e21bf1..abb597861eaddb4d3f3d862775edd0eab2deb6b4 100644 |
--- a/base/android/java/src/org/chromium/base/library_loader/Linker.java |
+++ b/base/android/java/src/org/chromium/base/library_loader/Linker.java |
@@ -769,27 +769,28 @@ public class Linker { |
loadAddress = sCurrentLoadAddress; |
} |
+ String errorMessage = null; |
String sharedRelRoName = libName; |
if (zipFile != null) { |
- if (!nativeLoadLibraryInZipFile( |
- zipFile, libName, loadAddress, libInfo)) { |
- String errorMessage = |
- "Unable to load library: " + libName + " in: " + |
- zipFile; |
- Log.e(TAG, errorMessage); |
- throw new UnsatisfiedLinkError(errorMessage); |
+ if (!nativeLoadLibraryInZipFile(zipFile, libName, loadAddress, libInfo)) { |
+ errorMessage = "Unable to load library: " + libName + " in: " + zipFile; |
} |
sharedRelRoName = zipFile; |
} else { |
if (!nativeLoadLibrary(libName, loadAddress, libInfo)) { |
- String errorMessage = "Unable to load library: " + libName; |
- Log.e(TAG, errorMessage); |
- throw new UnsatisfiedLinkError(errorMessage); |
+ errorMessage = "Unable to load library: " + libName; |
} |
} |
- // Keep track whether the library has been loaded at the expected load address. |
- if (loadAddress != 0 && loadAddress != libInfo.mLoadAddress) |
- sLoadAtFixedAddressFailed = true; |
+ |
+ // If loading failed, note any new failure to use a fixed address, then log |
+ // and throw an UnsatisfiedLinkError. |
+ if (errorMessage != null) { |
+ if (loadAddress != 0) { |
+ sLoadAtFixedAddressFailed = true; |
rmcilroy
2014/10/01 12:14:42
Does this only happen when there is an errorMessag
simonb (inactive)
2014/10/02 15:15:30
Yes. However, it can be deleted, because of what
|
+ } |
+ Log.e(TAG, errorMessage); |
+ throw new UnsatisfiedLinkError(errorMessage); |
+ } |
// Print the load address to the logcat when testing the linker. The format |
// of the string is expected by the Python test_runner script as one of: |