Fix injecting data into a .o file am: 52226ad920

am: e5f32c8091

Change-Id: I4cc5e7aba362185c2a9191964c06266110ddd33c
This commit is contained in:
Colin Cross 2018-02-20 18:14:16 +00:00 committed by android-build-merger
commit a205f6274e

View file

@ -56,7 +56,7 @@ func calculateElfSymbolOffset(file *elf.File, symbol elf.Symbol) (uint64, error)
case elf.ET_REL: case elf.ET_REL:
// "In relocatable files, st_value holds a section offset for a defined symbol. // "In relocatable files, st_value holds a section offset for a defined symbol.
// That is, st_value is an offset from the beginning of the section that st_shndx identifies." // That is, st_value is an offset from the beginning of the section that st_shndx identifies."
return file.Sections[symbol.Section].Addr + symbol.Value, nil return section.Offset + symbol.Value, nil
case elf.ET_EXEC, elf.ET_DYN: case elf.ET_EXEC, elf.ET_DYN:
// "In executable and shared object files, st_value holds a virtual address. To make these // "In executable and shared object files, st_value holds a virtual address. To make these
// files symbols more useful for the dynamic linker, the section offset (file interpretation) // files symbols more useful for the dynamic linker, the section offset (file interpretation)