Fix the target art method address within a method object

The target offset of art method within a method object should
take account of the offset of the image which is declaring this
method.

Bug: 31311504
Change-Id: Id6670dd3436b4bf5fb943d8d6234851fb336a4dc
(cherry picked from commit 1717159b07abefcf59d099bc81158644f0a0bffb)
Test: test-art-{host,target}
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 6d86f7d..3e6658e 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -1992,11 +1992,7 @@
       auto* dest = down_cast<mirror::AbstractMethod*>(copy);
       auto* src = down_cast<mirror::AbstractMethod*>(orig);
       ArtMethod* src_method = src->GetArtMethod();
-      auto it = native_object_relocations_.find(src_method);
-      CHECK(it != native_object_relocations_.end())
-          << "Missing relocation for AbstractMethod.artMethod " << PrettyMethod(src_method);
-      dest->SetArtMethod(
-          reinterpret_cast<ArtMethod*>(global_image_begin_ + it->second.offset));
+      dest->SetArtMethod(GetImageMethodAddress(src_method));
     } else if (!klass->IsArrayClass()) {
       ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
       if (klass == class_linker->GetClassRoot(ClassLinker::kJavaLangDexCache)) {