Merge changes from topic "host_bionic_no_inject" am: f77d3804fc

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1735341

Change-Id: Ie55dfa7dacf0d27e2dd2a6916c60211c5fb02344
This commit is contained in:
Colin Cross 2021-06-16 17:05:01 +00:00 committed by Automerger Merge Worker
commit 75decc4e97

View file

@ -61,8 +61,15 @@ func main() {
continue
}
sectionName := fmt.Sprintf(".linker.sect%d", load)
symName := fmt.Sprintf("__dlwrap_linker_sect%d", load)
var progName string
progSection := progToFirstSection(prog, ef.Sections)
if progSection != nil {
progName = progSection.Name
} else {
progName = fmt.Sprintf(".sect%d", load)
}
sectionName := ".linker" + progName
symName := "__dlwrap_linker" + strings.ReplaceAll(progName, ".", "_")
flags := ""
if prog.Flags&elf.PF_W != 0 {
@ -125,3 +132,12 @@ func bytesToAsm(asm io.Writer, buf []byte) {
}
fmt.Fprintln(asm)
}
func progToFirstSection(prog *elf.Prog, sections []*elf.Section) *elf.Section {
for _, section := range sections {
if section.Addr == prog.Vaddr {
return section
}
}
return nil
}