Index: build/android/pylib/linker/test_case.py |
diff --git a/build/android/pylib/linker/test_case.py b/build/android/pylib/linker/test_case.py |
index b8a256676341f90169677342d5c8983e293566ce..d44c52d6f4b543488b7295f70b11c73a0f3eaf20 100644 |
--- a/build/android/pylib/linker/test_case.py |
+++ b/build/android/pylib/linker/test_case.py |
@@ -52,6 +52,10 @@ _PACKAGE_NAME='org.chromium.content_linker_test_apk' |
_ACTIVITY_NAME='.ContentLinkerTestActivity' |
_COMMAND_LINE_FILE='/data/local/tmp/content-linker-test-command-line' |
+# Set this to False if the implemetation doesn't always place Shared RELROs |
+# in the browser process. |
+_BROWSER_USES_SHARED_RELRO = True |
+ |
# Logcat filters used during each test. Only the 'chromium' one is really |
# needed, but the logs are added to the TestResult in case of error, and |
# it is handy to have the 'content_android_linker' ones as well when |
@@ -401,10 +405,9 @@ class LinkerLibraryAddressTest(LinkerTestCaseBase): |
logging.error('Renderer libraries loaded at high addresses: %s', bad_libs) |
return ResultType.FAIL, logs |
- if self.is_low_memory: |
- # For low-memory devices, the libraries must all be loaded at the same |
- # addresses. This also implicitly checks that the browser libraries are at |
- # low addresses. |
+ if _BROWSER_USES_SHARED_RELRO or self.is_low_memory: |
+ # The libraries must all be loaded at the same addresses. This also |
+ # implicitly checks that the browser libraries are at low addresses. |
addr_mismatches = [] |
for lib_name, lib_address in browser_libs.iteritems(): |
lib_address2 = renderer_libs[lib_name] |
@@ -416,10 +419,10 @@ class LinkerLibraryAddressTest(LinkerTestCaseBase): |
addr_mismatches) |
return ResultType.FAIL, logs |
- # For regular devices, check that libraries are loaded at 'high-addresses'. |
+ # Otherwise, check that libraries are loaded at 'high-addresses'. |
# Note that for low-memory devices, the previous checks ensure that they |
# were loaded at low-addresses. |
- if not self.is_low_memory: |
+ else: |
bad_libs = [] |
for lib_name, lib_address in browser_libs.iteritems(): |
if lib_address < memory_boundary: |
@@ -474,7 +477,7 @@ class LinkerRandomizationTest(LinkerTestCaseBase): |
renderer_lib_map_list, 'Renderer') |
if not browser_status: |
- if self.is_low_memory: |
+ if _BROWSER_USES_SHARED_RELRO or self.is_low_memory: |
return ResultType.FAIL, browser_logs |
# IMPORTANT NOTE: The system's ASLR implementation seems to be very poor |