summaryrefslogtreecommitdiffstats
path: root/linker/linker_mips.cpp
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2015-02-03 16:06:47 -0800
committerDmitriy Ivanov <dimitry@google.com>2015-03-06 13:01:08 -0800
commitfa26eee77685e8dee7986e62a7d263003f5bd25a (patch)
tree62213ea06678718120ad1ff2e98c67e8a48c3198 /linker/linker_mips.cpp
parentf8ff6b103bde3433d6f7dbf762fc7bf657d7de5f (diff)
downloadbionic-fa26eee77685e8dee7986e62a7d263003f5bd25a.zip
bionic-fa26eee77685e8dee7986e62a7d263003f5bd25a.tar.gz
bionic-fa26eee77685e8dee7986e62a7d263003f5bd25a.tar.bz2
Refactoring: introduce reloc_iterators
Replace rel/rela array with reloc_iterators. Change-Id: I6165d062e0390b6bc60da2e8279aabbedf828ec9
Diffstat (limited to 'linker/linker_mips.cpp')
-rw-r--r--linker/linker_mips.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/linker/linker_mips.cpp b/linker/linker_mips.cpp
index 7fbde3d..d71659e 100644
--- a/linker/linker_mips.cpp
+++ b/linker/linker_mips.cpp
@@ -29,10 +29,15 @@
#include "linker.h"
#include "linker_debug.h"
#include "linker_relocs.h"
+#include "linker_reloc_iterators.h"
+
+template bool soinfo::relocate<plain_reloc_iterator>(plain_reloc_iterator&& rel_iterator, const soinfo_list_t& global_group, const soinfo_list_t& local_group);
+
+template <typename ElfRelIteratorT>
+bool soinfo::relocate(ElfRelIteratorT&& rel_iterator, const soinfo_list_t& global_group, const soinfo_list_t& local_group) {
+ for (size_t idx = 0; rel_iterator.has_next(); ++idx) {
+ const auto rel = rel_iterator.next();
-template<>
-bool soinfo::relocate(ElfW(Rel)* rel, unsigned count, const soinfo_list_t& global_group, const soinfo_list_t& local_group) {
- for (size_t idx = 0; idx < count; ++idx, ++rel) {
ElfW(Word) type = ELFW(R_TYPE)(rel->r_info);
ElfW(Word) sym = ELFW(R_SYM)(rel->r_info);