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
This commit is contained in:
Dmitriy Ivanov
2014-05-09 09:10:14 -07:00
parent 6897b7b8b9
commit d59e50063a
9 changed files with 459 additions and 158 deletions

View File

@@ -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_;