merge in mnc-release history after reset to mnc-dev
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);