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
This commit is contained in:
Christopher Ferris 2022-08-11 17:27:50 -07:00
parent f9fac36f15
commit d37df2b638
1 changed files with 26 additions and 6 deletions

View File

@ -241,15 +241,41 @@ cc_defaults {
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 @@ cc_defaults {
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_",