Fix debug information relocation (when imports present) (#1997)

This commit is contained in:
Yury Delendik
2020-07-09 08:52:35 -05:00
committed by GitHub
parent 5c35a9631c
commit c53b253261
3 changed files with 7 additions and 5 deletions

View File

@@ -448,7 +448,9 @@ impl<'a> ObjectBuilder<'a> {
let section_id = *dwarf_sections_ids.get(name).unwrap();
for reloc in relocs {
let target_symbol = match reloc.target {
DwarfSectionRelocTarget::Func(index) => func_symbols[FuncIndex::new(index)],
DwarfSectionRelocTarget::Func(index) => {
func_symbols[module.local.func_index(DefinedFuncIndex::new(index))]
}
DwarfSectionRelocTarget::Section(name) => {
obj.section_symbol(*dwarf_sections_ids.get(name).unwrap())
}