Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(600)

Side by Side Diff: third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp

Issue 1155973005: crazy linker: Fix incorrect link map l_addr value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/android_crazy_linker/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_library_list.h" 5 #include "crazy_linker_library_list.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <crazy_linker.h> 8 #include <crazy_linker.h>
9 #include <dlfcn.h> 9 #include <dlfcn.h>
10 10
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 LOG(" ... %p %s\n", dependencies[n], dependencies[n]->GetName()); 424 LOG(" ... %p %s\n", dependencies[n], dependencies[n]->GetName());
425 LOG(" dependencies @%p\n", &dependencies); 425 LOG(" dependencies @%p\n", &dependencies);
426 } 426 }
427 427
428 // Relocate the library. 428 // Relocate the library.
429 LOG("%s: Relocating %s\n", __FUNCTION__, base_name); 429 LOG("%s: Relocating %s\n", __FUNCTION__, base_name);
430 if (!lib->Relocate(this, &preloaded_libraries_, &dependencies, error)) 430 if (!lib->Relocate(this, &preloaded_libraries_, &dependencies, error))
431 return NULL; 431 return NULL;
432 432
433 // Notify GDB of load. 433 // Notify GDB of load.
434 lib->link_map_.l_addr = lib->load_address(); 434 lib->link_map_.l_addr = lib->load_bias();
435 lib->link_map_.l_name = const_cast<char*>(lib->base_name_); 435 lib->link_map_.l_name = const_cast<char*>(lib->base_name_);
436 lib->link_map_.l_ld = reinterpret_cast<uintptr_t>(lib->view_.dynamic()); 436 lib->link_map_.l_ld = reinterpret_cast<uintptr_t>(lib->view_.dynamic());
437 Globals::GetRDebug()->AddEntry(&lib->link_map_); 437 Globals::GetRDebug()->AddEntry(&lib->link_map_);
438 438
439 // The library was properly loaded, add it to the list of crazy 439 // The library was properly loaded, add it to the list of crazy
440 // libraries. IMPORTANT: Do this _before_ calling the constructors 440 // libraries. IMPORTANT: Do this _before_ calling the constructors
441 // because these could call dlopen(). 441 // because these could call dlopen().
442 lib->list_next_ = head_; 442 lib->list_next_ = head_;
443 lib->list_prev_ = NULL; 443 lib->list_prev_ = NULL;
444 if (head_) 444 if (head_)
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 const char* base_name = GetBaseNamePtr(name); 545 const char* base_name = GetBaseNamePtr(name);
546 for (size_t n = 0; n < known_libraries_.GetCount(); ++n) { 546 for (size_t n = 0; n < known_libraries_.GetCount(); ++n) {
547 LibraryView* wrap = known_libraries_[n]; 547 LibraryView* wrap = known_libraries_[n];
548 if (!strcmp(base_name, wrap->GetName())) 548 if (!strcmp(base_name, wrap->GetName()))
549 return wrap; 549 return wrap;
550 } 550 }
551 return NULL; 551 return NULL;
552 } 552 }
553 553
554 } // namespace crazy 554 } // namespace crazy
OLDNEW
« no previous file with comments | « third_party/android_crazy_linker/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698