OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "crazy_linker_shared_library.h" | 5 #include "crazy_linker_shared_library.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <sys/mman.h> | 9 #include <sys/mman.h> |
10 #include <elf.h> | 10 #include <elf.h> |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 Error* error) { | 289 Error* error) { |
290 // Apply relocations. | 290 // Apply relocations. |
291 LOG("%s: Applying relocations to %s\n", __FUNCTION__, base_name_); | 291 LOG("%s: Applying relocations to %s\n", __FUNCTION__, base_name_); |
292 | 292 |
293 ElfRelocations relocations; | 293 ElfRelocations relocations; |
294 | 294 |
295 if (!relocations.Init(&view_, error)) | 295 if (!relocations.Init(&view_, error)) |
296 return false; | 296 return false; |
297 | 297 |
298 SharedLibraryResolver resolver(this, lib_list, dependencies); | 298 SharedLibraryResolver resolver(this, lib_list, dependencies); |
299 if (!relocations.ApplyAll(&symbols_, &resolver, error)) | 299 if (!relocations.ApplyAll(&symbols_, &resolver, full_path_, error)) |
300 return false; | 300 return false; |
301 | 301 |
302 LOG("%s: Relocations applied for %s\n", __FUNCTION__, base_name_); | 302 LOG("%s: Relocations applied for %s\n", __FUNCTION__, base_name_); |
303 return true; | 303 return true; |
304 } | 304 } |
305 | 305 |
306 const ELF::Sym* SharedLibrary::LookupSymbolEntry(const char* symbol_name) { | 306 const ELF::Sym* SharedLibrary::LookupSymbolEntry(const char* symbol_name) { |
307 return symbols_.LookupByName(symbol_name); | 307 return symbols_.LookupByName(symbol_name); |
308 } | 308 } |
309 | 309 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 if (iter_.GetTag() == DT_NEEDED) { | 441 if (iter_.GetTag() == DT_NEEDED) { |
442 dep_name_ = symbols_->GetStringById(iter_.GetValue()); | 442 dep_name_ = symbols_->GetStringById(iter_.GetValue()); |
443 iter_.GetNext(); | 443 iter_.GetNext(); |
444 return true; | 444 return true; |
445 } | 445 } |
446 } | 446 } |
447 return false; | 447 return false; |
448 } | 448 } |
449 | 449 |
450 } // namespace crazy | 450 } // namespace crazy |
OLD | NEW |