gdb: move addrmap::relocate method to addrmap_fixed

The relocate method of addrmap is unnecessarily virtual.  Only
addrmap_fixed provides a meaningful implementation.  Move the method to
addrmap_fixed only and make it non-virtual.

Change-Id: If61d5e70abc12c17d1e600adf0dd0707e77a6ba2
Approved-By: Tom Tromey <tom@tromey.com>
diff --git a/gdb/addrmap.c b/gdb/addrmap.c
index e6799cc..1fc95f3 100644
--- a/gdb/addrmap.c
+++ b/gdb/addrmap.c
@@ -317,16 +317,6 @@ addrmap_fixed::addrmap_fixed (struct obstack *obstack,
   gdb_assert (num_transitions == transition_count);
 }
 
-
-void
-addrmap_mutable::relocate (CORE_ADDR offset)
-{
-  /* Not needed yet.  */
-  internal_error (_("addrmap_relocate is not implemented yet "
-		    "for mutable addrmaps"));
-}
-
-
 /* This is a splay_tree_foreach_fn.  */
 
 static int
@@ -450,7 +440,7 @@ test_addrmap ()
   CHECK_ADDRMAP_FIND (map, array, 13, 19, nullptr);
 
   /* Create corresponding fixed addrmap.  */
-  struct addrmap *map2
+  addrmap_fixed *map2
     = new (&temp_obstack) addrmap_fixed (&temp_obstack, map.get ());
   SELF_CHECK (map2 != nullptr);
   CHECK_ADDRMAP_FIND (map2, array, 0, 9, nullptr);
diff --git a/gdb/addrmap.h b/gdb/addrmap.h
index 06fc175..a2feb68 100644
--- a/gdb/addrmap.h
+++ b/gdb/addrmap.h
@@ -52,10 +52,6 @@ struct addrmap
   void *find (CORE_ADDR addr)
   { return this->do_find (addr); }
 
-  /* Relocate all the addresses in MAP by OFFSET.  (This can be applied
-     to either mutable or immutable maps.)  */
-  virtual void relocate (CORE_ADDR offset) = 0;
-
   /* Call FN for every address in MAP, following an in-order traversal.
      If FN ever returns a non-zero value, the iteration ceases
      immediately, and the value is returned.  Otherwise, this function
@@ -94,7 +90,8 @@ struct addrmap_fixed final : public addrmap,
   addrmap_fixed (addrmap_fixed &&other) = default;
   addrmap_fixed &operator= (addrmap_fixed &&) = default;
 
-  void relocate (CORE_ADDR offset) override;
+  /* Relocate all the addresses in this map by OFFSET.  */
+  void relocate (CORE_ADDR offset);
 
 private:
   void *do_find (CORE_ADDR addr) const override;
@@ -191,7 +188,6 @@ struct addrmap_mutable final : public addrmap
      representation.  */
   void set_empty (CORE_ADDR start, CORE_ADDR end_inclusive,
 		  void *obj);
-  void relocate (CORE_ADDR offset) override;
 
   /* Clear this addrmap.  */
   void clear ();