return getSymbolName(symb, Result);
}
-error_code COFFObjectFile::getSymbolFileOffset(DataRefImpl Symb,
+error_code COFFObjectFile::getSymbolOffset(DataRefImpl Symb,
uint64_t &Result) const {
const coff_symbol *symb = toSymb(Symb);
const coff_section *Section = NULL;
if (Type == 'U' || Type == 'w')
Result = UnknownAddressOrSize;
else if (Section)
- Result = Section->PointerToRawData + symb->Value;
+ Result = Section->VirtualAddress + symb->Value;
else
Result = symb->Value;
return object_error::success;
if (Type == 'U' || Type == 'w')
Result = UnknownAddressOrSize;
else if (Section)
- Result = Section->VirtualAddress + symb->Value;
+ Result = reinterpret_cast<uintptr_t>(base() +
+ Section->PointerToRawData +
+ symb->Value);
else
- Result = symb->Value;
+ Result = reinterpret_cast<uintptr_t>(base() + symb->Value);
return object_error::success;
}
Res = toRel(Rel)->VirtualAddress;
return object_error::success;
}
-error_code COFFObjectFile::getRelocationOffset(DataRefImpl Rel,
- uint64_t &Res) const {
- Res = toRel(Rel)->VirtualAddress;
- return object_error::success;
-}
error_code COFFObjectFile::getRelocationSymbol(DataRefImpl Rel,
SymbolRef &Res) const {
const coff_relocation* R = toRel(Rel);