am 5c07dfd7: (-s ours) am 3e092571: Libunwind: Remove unused function

* commit '5c07dfd7970c57d741bb6cb04254f81dae90f7f1':
diff --git a/include/libunwind-aarch64.h b/include/libunwind-aarch64.h
index 700ed17..9883cf3 100644
--- a/include/libunwind-aarch64.h
+++ b/include/libunwind-aarch64.h
@@ -194,7 +194,7 @@
      "stp x8, x9, [%[base], #64]\n" \
      "stp x10, x11, [%[base], #80]\n" \
      "stp x12, x13, [%[base], #96]\n" \
-     "stp x14, x13, [%[base], #112]\n" \
+     "stp x14, x15, [%[base], #112]\n" \
      "stp x16, x17, [%[base], #128]\n" \
      "stp x18, x19, [%[base], #144]\n" \
      "stp x20, x21, [%[base], #160]\n" \
diff --git a/src/Los-common.c b/src/Los-common.c
index 6341545..111caba 100644
--- a/src/Los-common.c
+++ b/src/Los-common.c
@@ -186,7 +186,16 @@
     {
       *ei = map->ei;
       *segbase = map->start;
-      *mapoff = map->offset;
+      if (ei->mapped)
+        *mapoff = map->offset;
+      else
+        /* Always use zero as the map offset for in memory maps. The
+         * dlopen of a shared library from an APK will result in a
+         * non-zero offset so it won't match the elf data and cause
+         * unwinds to fail. Currently, only in memory unwinds of an APK
+         * are possible, so only modify this path.
+         */
+        *mapoff = 0;
       if (path != NULL)
         {
           if (map->path)
diff --git a/src/os-common.c b/src/os-common.c
index 8f32af9..751c9d2 100644
--- a/src/os-common.c
+++ b/src/os-common.c
@@ -50,7 +50,17 @@
 
   *ei = map->ei;
   *segbase = map->start;
-  *mapoff = map->offset;
+  if (ei->mapped)
+    *mapoff = map->offset;
+  else
+    /* Always use zero as the map offset for in memory maps. The
+     * dlopen of a shared library from an APK will result in a
+     * non-zero offset so it won't match the elf data and cause
+     * unwinds to fail. Currently, only in memory unwinds of an APK
+     * are possible, so only modify this path.
+     */
+    *mapoff = 0;
+
   if (path != NULL)
     {
       *path = strdup (map->path);