Add a method to leave the symbol table in a library.
When LOCAL_STRIP_MODULE := keep_symbols is set, then the normal strip rules
will be modified so that only the .debug_* sections are removed. The original
symbol table is left alone.
This allows the compilation of certain libraries so that libbacktrace library
can provide meaningful names to functions.
Bug: 12958251
Change-Id: I82bdc304a463012e29086325ccb51163464cb4a9
diff --git a/core/definitions.mk b/core/definitions.mk
index 9cbd647..d6cd9d1 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1327,6 +1327,12 @@
$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_STRIP_COMMAND)
endef
+define transform-to-stripped-keep-symbols
+@mkdir -p $(dir $@)
+@echo "target Strip (keep symbols): $(PRIVATE_MODULE) ($@)"
+$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)TARGET_STRIP_KEEP_SYMBOLS_COMMAND)
+endef
+
###########################################################
## Commands for running gcc to link an executable