diff options
author | Christopher Ferris <cferris@google.com> | 2014-03-18 14:50:09 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2014-03-18 17:34:41 -0700 |
commit | a6e2f9322c47ac02546aa436341fa42afd0000c5 (patch) | |
tree | d159588a6013b962458d7bff15d628ec7d65fcf0 /core/dynamic_binary.mk | |
parent | bce52ca5fae5d0062e7622d758a3619f2279c666 (diff) | |
download | build-a6e2f9322c47ac02546aa436341fa42afd0000c5.zip build-a6e2f9322c47ac02546aa436341fa42afd0000c5.tar.gz build-a6e2f9322c47ac02546aa436341fa42afd0000c5.tar.bz2 |
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
Diffstat (limited to 'core/dynamic_binary.mk')
-rw-r--r-- | core/dynamic_binary.mk | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk index 1d3b99e..32f2c91 100644 --- a/core/dynamic_binary.mk +++ b/core/dynamic_binary.mk @@ -116,6 +116,14 @@ $(strip_output): PRIVATE_OBJCOPY := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY $(strip_output): $(strip_input) | $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) $(transform-to-stripped) else +ifeq ($(my_strip_module),keep_symbols) +# Strip only the debug frames, but leave the symbol table. +$(strip_output): PRIVATE_STRIP := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) +$(strip_output): PRIVATE_OBJCOPY := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY) +$(strip_output): PRIVATE_READELF := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_READELF) +$(strip_output): $(strip_input) | $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) + $(transform-to-stripped-keep-symbols) +else # Don't strip the binary, just copy it. We can't skip this step # because a copy of the binary must appear at LOCAL_BUILT_MODULE. # @@ -130,6 +138,7 @@ $(strip_output): $(strip_input) @echo "target Unstripped: $(PRIVATE_MODULE) ($@)" $(copy-file-to-target-with-cp) endif +endif endif # my_strip_module |