Fix relocation to look for symbols in local group

  The local group is a sequence of libraries in default (breadth-first)
  order. It allows RTLD_LOCALLY loaded library to correctly relocate
  symbols within its group (see test-cases).

  Local group lookup is performed after main executable and ld_preloads.

Bug: 2643900
Bug: 15432753
Change-Id: I9bb013b46d17dbb5cbdfb8fef26f552748385541
diff --git a/linker/linked_list.h b/linker/linked_list.h
index 4e62e20..72a32b4 100644
--- a/linker/linked_list.h
+++ b/linker/linked_list.h
@@ -86,7 +86,7 @@
   }
 
   template<typename F>
-  void for_each(F action) {
+  void for_each(F action) const {
     visit([&] (T* si) {
       action(si);
       return true;
@@ -94,7 +94,7 @@
   }
 
   template<typename F>
-  bool visit(F action) {
+  bool visit(F action) const {
     for (LinkedListEntry<T>* e = head_; e != nullptr; e = e->next) {
       if (!action(e->element)) {
         return false;