Add prefix_symbols support to cc_object
Test: add cc_object with prefix_symbols, use objdump to check Change-Id: I15eb47e6888eb1c4837734a44a7ad86205a48c02
This commit is contained in:
3
cc/cc.go
3
cc/cc.go
@@ -140,6 +140,9 @@ type Flags struct {
|
||||
type ObjectLinkerProperties struct {
|
||||
// names of other cc_object modules to link into this module using partial linking
|
||||
Objs []string `android:"arch_variant"`
|
||||
|
||||
// if set, add an extra objcopy --prefix-symbols= step
|
||||
Prefix_symbols string
|
||||
}
|
||||
|
||||
// Properties used to compile all C or C++ modules
|
||||
|
19
cc/object.go
19
cc/object.go
@@ -78,12 +78,29 @@ func (object *objectLinker) link(ctx ModuleContext,
|
||||
objs = objs.Append(deps.Objs)
|
||||
|
||||
var outputFile android.Path
|
||||
builderFlags := flagsToBuilderFlags(flags)
|
||||
|
||||
if len(objs.objFiles) == 1 {
|
||||
outputFile = objs.objFiles[0]
|
||||
|
||||
if object.Properties.Prefix_symbols != "" {
|
||||
output := android.PathForModuleOut(ctx, ctx.ModuleName()+objectExtension)
|
||||
TransformBinaryPrefixSymbols(ctx, object.Properties.Prefix_symbols, outputFile,
|
||||
builderFlags, output)
|
||||
outputFile = output
|
||||
}
|
||||
} else {
|
||||
output := android.PathForModuleOut(ctx, ctx.ModuleName()+objectExtension)
|
||||
TransformObjsToObj(ctx, objs.objFiles, flagsToBuilderFlags(flags), output)
|
||||
outputFile = output
|
||||
|
||||
if object.Properties.Prefix_symbols != "" {
|
||||
input := android.PathForModuleOut(ctx, "unprefixed", ctx.ModuleName()+objectExtension)
|
||||
TransformBinaryPrefixSymbols(ctx, object.Properties.Prefix_symbols, input,
|
||||
builderFlags, output)
|
||||
output = input
|
||||
}
|
||||
|
||||
TransformObjsToObj(ctx, objs.objFiles, builderFlags, output)
|
||||
}
|
||||
|
||||
ctx.CheckbuildFile(outputFile)
|
||||
|
Reference in New Issue
Block a user