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:
@@ -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_;
|
||||
|
Reference in New Issue
Block a user