Merge "Add Symbol_ordering_file property"

This commit is contained in:
Treehugger Robot 2019-01-16 17:52:48 +00:00 committed by Gerrit Code Review
commit cdfaaf4d75
1 changed files with 15 additions and 0 deletions

View File

@ -150,6 +150,9 @@ type BaseLinkerProperties struct {
// local file name to pass to the linker as --version_script
Version_script *string `android:"arch_variant"`
// Local file name to pass to the linker as --symbol-ordering-file
Symbol_ordering_file *string `android:"arch_variant"`
}
func NewBaseLinker(sanitize *sanitize) *baseLinker {
@ -279,6 +282,8 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
linker.Properties.Target.Vendor.Version_script)
}
android.ExtractSourceDeps(ctx, linker.Properties.Symbol_ordering_file)
return deps
}
@ -435,6 +440,16 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
}
}
if !linker.dynamicProperties.BuildStubs {
symbolOrderingFile := ctx.ExpandOptionalSource(
linker.Properties.Symbol_ordering_file, "Symbol_ordering_file")
if symbolOrderingFile.Valid() {
flags.LdFlags = append(flags.LdFlags,
"-Wl,--symbol-ordering-file,"+symbolOrderingFile.String())
flags.LdFlagsDeps = append(flags.LdFlagsDeps, symbolOrderingFile.Path())
}
}
return flags
}