aboutsummaryrefslogtreecommitdiffstats
path: root/linker/linker_allocator.cpp
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-05-09 09:10:14 -0700
committerDmitriy Ivanov <dimitry@google.com>2014-05-14 15:16:35 -0700
commitd59e50063ad708509f3ad83350be33f5612c4f54 (patch)
tree4179117769c38d28aff06e56427f54e72e5eed6b /linker/linker_allocator.cpp
parent6897b7b8b95beae120fd53e6fd15921d6420bea7 (diff)
downloadandroid_bionic-d59e50063ad708509f3ad83350be33f5612c4f54.tar.gz
android_bionic-d59e50063ad708509f3ad83350be33f5612c4f54.tar.bz2
android_bionic-d59e50063ad708509f3ad83350be33f5612c4f54.zip
Improve detection of already loaded libraries
Linker is now able to resolve symlinked libraries correctly. soinfo is extended to save the graph of dependencies during load/unload. Dependencies are used only in CallConstructor. Bug: 9741592 Change-Id: Id9c48a74c46aa89bcdf3d54ec2f8ba3d398130b1
Diffstat (limited to 'linker/linker_allocator.cpp')
-rw-r--r--linker/linker_allocator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/linker/linker_allocator.cpp b/linker/linker_allocator.cpp
index 573809075..c8b97b121 100644
--- a/linker/linker_allocator.cpp
+++ b/linker/linker_allocator.cpp
@@ -55,8 +55,7 @@ void* LinkerBlockAllocator::alloc() {
free_block_list_ = block_info->next_block;
}
- block_info->next_block = nullptr;
- block_info->num_free_blocks = 0;
+ memset(block_info, 0, block_size_);
return block_info;
}
@@ -78,6 +77,8 @@ void LinkerBlockAllocator::free(void* block) {
abort();
}
+ memset(block, 0, block_size_);
+
FreeBlockInfo* block_info = reinterpret_cast<FreeBlockInfo*>(block);
block_info->next_block = free_block_list_;
@@ -100,6 +101,7 @@ void LinkerBlockAllocator::create_new_page() {
if (page == MAP_FAILED) {
abort(); // oom
}
+ memset(page, 0, PAGE_SIZE);
FreeBlockInfo* first_block = reinterpret_cast<FreeBlockInfo*>(page->bytes);
first_block->next_block = free_block_list_;