Label pages mapped by linker_allocator
(cherry picked from commit 51a22a12ab370933a35463f5c81223132ec64dcb)
Bug: 17013324
Change-Id: I345c9d0fecc29d3626c5be01cc3c0ed1583ac361
diff --git a/linker/linker_allocator.cpp b/linker/linker_allocator.cpp
index f5d3745..92220e8 100644
--- a/linker/linker_allocator.cpp
+++ b/linker/linker_allocator.cpp
@@ -18,6 +18,8 @@
#include <sys/mman.h>
#include <unistd.h>
+#include "private/bionic_prctl.h"
+
struct LinkerAllocatorPage {
LinkerAllocatorPage* next;
uint8_t bytes[PAGE_SIZE-sizeof(LinkerAllocatorPage*)];
@@ -96,6 +98,9 @@
if (page == MAP_FAILED) {
abort(); // oom
}
+
+ prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, page, PAGE_SIZE, "linker_alloc");
+
memset(page, 0, PAGE_SIZE);
FreeBlockInfo* first_block = reinterpret_cast<FreeBlockInfo*>(page->bytes);