am 14b740f1: (-s ours) am 4036eb50: Libunwind: Remove unused variable
* commit '14b740f1abba10d9042211e8a4568c13a9ad6b96':
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/arm/Gex_tables.c b/src/arm/Gex_tables.c
index 7b3e151..64ff380 100644
--- a/src/arm/Gex_tables.c
+++ b/src/arm/Gex_tables.c
@@ -53,12 +53,6 @@
unw_dyn_info_t di; /* info about the ARM exidx segment */
};
-static inline uint32_t CONST_ATTR
-prel31_read (uint32_t prel31)
-{
- return ((int32_t)prel31 << 1) >> 1;
-}
-
static inline int
prel31_to_addr (unw_addr_space_t as, void *arg, unw_word_t prel31,
unw_word_t *val)
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);