Strip libgcc to only keep fallback symbols

We use libgcc as fallback for symbols not present in libclang_rt
builtins, however we didn't know what exact symbols were being used,
some may not be intended to fallback.

Create libgcc_stripped, which only contains unwind symbols from libgcc.

Bug: 29275768
Test: bionic-unit-tests
Change-Id: I5b349fa6138e51663bf3b67109b880b4356da8e8
This commit is contained in:
Yi Kong
2019-03-29 20:05:14 -07:00
parent feef2ef4d7
commit acee27cd72
9 changed files with 201 additions and 27 deletions

View File

@@ -255,6 +255,7 @@ type builderFlags struct {
groupStaticLibs bool
stripKeepSymbols bool
stripKeepSymbolsList string
stripKeepMiniDebugInfo bool
stripAddGnuDebuglink bool
stripUseGnuStrip bool
@@ -835,6 +836,9 @@ func TransformStrip(ctx android.ModuleContext, inputFile android.Path,
if flags.stripKeepSymbols {
args += " --keep-symbols"
}
if flags.stripKeepSymbolsList != "" {
args += " -k" + flags.stripKeepSymbolsList
}
if flags.stripUseGnuStrip {
args += " --use-gnu-strip"
}