aboutsummaryrefslogtreecommitdiffstats
path: root/linker/linker_allocator.cpp
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-08-08 16:57:15 -0700
committerDmitriy Ivanov <dimitry@google.com>2014-08-11 09:22:48 -0700
commit51a22a12ab370933a35463f5c81223132ec64dcb (patch)
tree83033d1672090d93a22d349669bbe9159322f4e8 /linker/linker_allocator.cpp
parenta0db46418757dd1b399acb97ff42083cc274e8ae (diff)
downloadandroid_bionic-51a22a12ab370933a35463f5c81223132ec64dcb.tar.gz
android_bionic-51a22a12ab370933a35463f5c81223132ec64dcb.tar.bz2
android_bionic-51a22a12ab370933a35463f5c81223132ec64dcb.zip
Label pages mapped by linker_allocator
Change-Id: I7e0bf29bc1a480e9be0d1ae573ca1063d90d82ff
Diffstat (limited to 'linker/linker_allocator.cpp')
-rw-r--r--linker/linker_allocator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/linker/linker_allocator.cpp b/linker/linker_allocator.cpp
index f5d3745b4..92220e8c4 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 @@ void LinkerBlockAllocator::create_new_page() {
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);