Add the .debug_frame for arm32.

As with libc.so, add the debug frame into the linker for arm32
to make any crashes unwindable.

Bug: 242162222

Test: Forced a crash on wembley where an unwind failed before and
Test: verified it unwinds properly with the debug frame.
Change-Id: I2b904af63f670b038d169f5a7d907637b352ab4e
diff --git a/linker/Android.bp b/linker/Android.bp
index d5e7367..5e53079 100644
--- a/linker/Android.bp
+++ b/linker/Android.bp
@@ -241,15 +241,41 @@
     arch: {
         arm: {
             srcs: [":linker_sources_arm"],
+
+            // Arm 32 bit does not produce complete exidx unwind information
+            // so keep the .debug_frame which is relatively small and does
+            // include needed unwind information.
+            // See b/242162222 for details.
+            strip: {
+                keep_symbols_and_debug_frame: true,
+            },
         },
         arm64: {
             srcs: [":linker_sources_arm64"],
+
+            // Leave the symbols in the shared library so that stack unwinders can produce
+            // meaningful name resolution.
+            strip: {
+                keep_symbols: true,
+            },
         },
         x86: {
             srcs: [":linker_sources_x86"],
+
+            // Leave the symbols in the shared library so that stack unwinders can produce
+            // meaningful name resolution.
+            strip: {
+                keep_symbols: true,
+            },
         },
         x86_64: {
             srcs: [":linker_sources_x86_64"],
+
+            // Leave the symbols in the shared library so that stack unwinders can produce
+            // meaningful name resolution.
+            strip: {
+                keep_symbols: true,
+            },
         },
     },
 
@@ -275,12 +301,6 @@
 
     static_executable: true,
 
-    // Leave the symbols in the shared library so that stack unwinders can produce
-    // meaningful name resolution.
-    strip: {
-        keep_symbols: true,
-    },
-
     // Insert an extra objcopy step to add prefix to symbols. This is needed to prevent gdb
     // looking up symbols in the linker by mistake.
     prefix_symbols: "__dl_",