OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_elf_symbols.h" | 5 #include "crazy_linker_elf_symbols.h" |
6 | 6 |
7 #include "crazy_linker_debug.h" | 7 #include "crazy_linker_debug.h" |
8 #include "crazy_linker_elf_view.h" | 8 #include "crazy_linker_elf_view.h" |
9 | 9 |
10 namespace crazy { | 10 namespace crazy { |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 bool ElfSymbols::Init(const ElfView* view) { | 29 bool ElfSymbols::Init(const ElfView* view) { |
30 LOG("%s: Parsing dynamic table\n", __FUNCTION__); | 30 LOG("%s: Parsing dynamic table\n", __FUNCTION__); |
31 ElfView::DynamicIterator dyn(view); | 31 ElfView::DynamicIterator dyn(view); |
32 for (; dyn.HasNext(); dyn.GetNext()) { | 32 for (; dyn.HasNext(); dyn.GetNext()) { |
33 uintptr_t dyn_addr = dyn.GetAddress(view->load_bias()); | 33 uintptr_t dyn_addr = dyn.GetAddress(view->load_bias()); |
34 switch (dyn.GetTag()) { | 34 switch (dyn.GetTag()) { |
35 case DT_HASH: | 35 case DT_HASH: |
36 LOG(" DT_HASH addr=%p\n", dyn_addr); | 36 LOG(" DT_HASH addr=%p\n", dyn_addr); |
37 { | 37 { |
38 ELF::Addr* data = reinterpret_cast<uintptr_t*>(dyn_addr); | 38 ELF::Word* data = reinterpret_cast<ELF::Word*>(dyn_addr); |
39 hash_bucket_size_ = data[0]; | 39 hash_bucket_size_ = data[0]; |
40 hash_chain_size_ = data[1]; | 40 hash_chain_size_ = data[1]; |
41 hash_bucket_ = data + 2; | 41 hash_bucket_ = data + 2; |
42 hash_chain_ = data + 2 + hash_bucket_size_; | 42 hash_chain_ = data + 2 + hash_bucket_size_; |
43 } | 43 } |
44 break; | 44 break; |
45 case DT_STRTAB: | 45 case DT_STRTAB: |
46 LOG(" DT_STRTAB addr=%p\n", dyn_addr); | 46 LOG(" DT_STRTAB addr=%p\n", dyn_addr); |
47 string_table_ = reinterpret_cast<const char*>(dyn_addr); | 47 string_table_ = reinterpret_cast<const char*>(dyn_addr); |
48 break; | 48 break; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 case STB_WEAK: | 137 case STB_WEAK: |
138 return symbol; | 138 return symbol; |
139 default: | 139 default: |
140 ; | 140 ; |
141 } | 141 } |
142 } | 142 } |
143 return NULL; | 143 return NULL; |
144 } | 144 } |
145 | 145 |
146 } // namespace crazy | 146 } // namespace crazy |
OLD | NEW |