Fix injecting data into a .o file
am: 52226ad920
Change-Id: I742e9ffe508d06d1d9f5763f8bdbff2fc844e759
This commit is contained in:
commit
e5f32c8091
1 changed files with 1 additions and 1 deletions
|
@ -56,7 +56,7 @@ func calculateElfSymbolOffset(file *elf.File, symbol elf.Symbol) (uint64, error)
|
|||
case elf.ET_REL:
|
||||
// "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."
|
||||
return file.Sections[symbol.Section].Addr + symbol.Value, nil
|
||||
return section.Offset + symbol.Value, nil
|
||||
case elf.ET_EXEC, elf.ET_DYN:
|
||||
// "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)
|
||||
|
|
Loading…
Reference in a new issue