getRelocatedValue may compute incorrect value for SHT_RELA-typed relocation entries.
// DWARFDataExtractor.cpp uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off, ... // This formula is correct for SHT_REL-typed relocation entries. // But for SHT_RELA-typed, if the implicit r_addend (getUnsigned(Off, Size)) is not zero, it will be incorrect. return getUnsigned(Off, Size) + Rel->Value;
In this patch, we refactor these visit* functions to include a new
parameter int64_t A (implicit r_addend). They should use either the
explicit r_addend (SHT_RELA: getELFAddend(R)) or the implicit r_addend (SHT_REL: A) according to processor supplement requirements.
Since these visit* functions are no longer used as a prescan manner but
will be called on-demand in getRelocatedValue, rename them to resolve*.