From 306811ea503c4a00f2e565ddd543134c44e3a2a1 Mon Sep 17 00:00:00 2001 From: simonb Date: Fri, 17 Oct 2014 10:02:33 -0700 Subject: [PATCH] Correctly report failure to swap RELRO pages. If no RELRO pages are swapped, the library reports an error by returning false, but currently does not supply any message for the log. Add one. BUG= Review URL: https://codereview.chromium.org/649183006 Cr-Commit-Position: refs/heads/master@{#300120} --- third_party/android_crazy_linker/README.chromium | 2 ++ third_party/android_crazy_linker/src/src/crazy_linker_elf_relro.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/third_party/android_crazy_linker/README.chromium b/third_party/android_crazy_linker/README.chromium index f447d692deb9..4b11d57ab3c8 100644 --- a/third_party/android_crazy_linker/README.chromium +++ b/third_party/android_crazy_linker/README.chromium @@ -45,3 +45,5 @@ Local Modifications: - Fix phdr_table_get_dynamic_section() call in ElfView::InitUnmapped(). - Fix typo in LOG() call, added in arm64 packed relative relocations change. + +- Add an error message for failures where no shared RELRO pages are swapped. diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_elf_relro.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_elf_relro.cpp index d8f30317b40a..8ce31e7298df 100644 --- a/third_party/android_crazy_linker/src/src/crazy_linker_elf_relro.cpp +++ b/third_party/android_crazy_linker/src/src/crazy_linker_elf_relro.cpp @@ -217,8 +217,10 @@ bool SharedRelro::InitFrom(size_t relro_start, similar_size * 100 / size, (size - similar_size) / 4096); - if (similar_size == 0) + if (similar_size == 0) { + error->Format("No pages were swapped into RELRO ashmem\n"); return false; + } start_ = relro_start; size_ = relro_size; -- 2.11.4.GIT