diff options
| author | Fangrui Song <maskray@google.com> | 2019-03-22 02:43:11 +0000 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2019-03-22 02:43:11 +0000 |
| commit | 4597dce48319437a80db95153f65e289832f979b (patch) | |
| tree | cc2a7741e814700dfa955f0bec7ba271c2c8cdd2 /llvm/lib/Target/AMDGPU/SIISelLowering.cpp | |
| parent | 1955c8f17267dc263aa7dfb2404341de05fdacaf (diff) | |
| download | bcm5719-llvm-4597dce48319437a80db95153f65e289832f979b.tar.gz bcm5719-llvm-4597dce48319437a80db95153f65e289832f979b.zip | |
[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries
Summary:
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 REL, but may be incorrect for RELA if the value
// stored in the location (getUnsigned(Off, Size)) is not zero.
return getUnsigned(Off, Size) + Rel->Value;
In this patch, we
* refactor these visit* functions to include a new parameter `uint64_t A`.
Since these visit* functions are no longer used as visitors, rename them to resolve*.
+ REL: A is used as the addend. A is the value stored in the location where the
relocation applies: getUnsigned(Off, Size)
+ RELA: The addend encoded in RelocationRef is used, e.g. getELFAddend(R)
* and add another set of supports* functions to check if a given relocation type is handled.
DWARFObjInMemory uses them to fail early.
Reviewers: echristo, dblaikie
Reviewed By: echristo
Subscribers: mgorny, aprantl, aheejin, fedor.sergeev, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57939
llvm-svn: 356729
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIISelLowering.cpp')
0 files changed, 0 insertions, 0 deletions

