[RuntimeDyld] Change the return type of decodeAddend to match the storage type.
llvm-svn: 213686
This commit is contained in:
parent
8c714213d5
commit
175b78b02e
|
@ -27,9 +27,9 @@ using namespace llvm::object;
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
uint64_t RuntimeDyldMachO::decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
|
int64_t RuntimeDyldMachO::decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
|
||||||
uint32_t RelType) const {
|
uint32_t RelType) const {
|
||||||
uint64_t Addend = 0;
|
int64_t Addend = 0;
|
||||||
memcpy(&Addend, LocalAddress, NumBytes);
|
memcpy(&Addend, LocalAddress, NumBytes);
|
||||||
return Addend;
|
return Addend;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,8 +52,8 @@ protected:
|
||||||
RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {}
|
RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {}
|
||||||
|
|
||||||
/// Extract the addend encoded in the instruction.
|
/// Extract the addend encoded in the instruction.
|
||||||
uint64_t decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
|
int64_t decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
|
||||||
uint32_t RelType) const;
|
uint32_t RelType) const;
|
||||||
|
|
||||||
/// Construct a RelocationValueRef representing the relocation target.
|
/// Construct a RelocationValueRef representing the relocation target.
|
||||||
/// For Symbols in known sections, this will return a RelocationValueRef
|
/// For Symbols in known sections, this will return a RelocationValueRef
|
||||||
|
@ -138,7 +138,7 @@ protected:
|
||||||
uint8_t *LocalAddress = Section.Address + Offset;
|
uint8_t *LocalAddress = Section.Address + Offset;
|
||||||
unsigned NumBytes = 1 << Size;
|
unsigned NumBytes = 1 << Size;
|
||||||
uint32_t RelType = Obj.getAnyRelocationType(RelInfo);
|
uint32_t RelType = Obj.getAnyRelocationType(RelInfo);
|
||||||
uint64_t Addend = impl().decodeAddend(LocalAddress, NumBytes, RelType);
|
int64_t Addend = impl().decodeAddend(LocalAddress, NumBytes, RelType);
|
||||||
|
|
||||||
return RelocationEntry(SectionID, Offset, RelType, Addend, IsPCRel, Size);
|
return RelocationEntry(SectionID, Offset, RelType, Addend, IsPCRel, Size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue