aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h
index f5cf9ac..196fa62 100644
--- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h
+++ b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h
@@ -183,8 +183,8 @@ public:
assert(isInt<33>(Addend) && "Invalid page reloc value.");
// Encode the addend into the instruction.
- uint32_t ImmLoValue = (uint32_t)(Addend << 17) & 0x60000000;
- uint32_t ImmHiValue = (uint32_t)(Addend >> 9) & 0x00FFFFE0;
+ uint32_t ImmLoValue = ((uint64_t)Addend << 17) & 0x60000000;
+ uint32_t ImmHiValue = ((uint64_t)Addend >> 9) & 0x00FFFFE0;
*p = (*p & 0x9F00001F) | ImmHiValue | ImmLoValue;
break;
}
@@ -243,10 +243,11 @@ public:
relocation_iterator
processRelocationRef(unsigned SectionID, relocation_iterator RelI,
- ObjectImage &ObjImg, ObjSectionToIDMap &ObjSectionToID,
- const SymbolTableMap &Symbols, StubMap &Stubs) override {
+ const ObjectFile &BaseObjT,
+ ObjSectionToIDMap &ObjSectionToID,
+ StubMap &Stubs) override {
const MachOObjectFile &Obj =
- static_cast<const MachOObjectFile &>(*ObjImg.getObjectFile());
+ static_cast<const MachOObjectFile &>(BaseObjT);
MachO::any_relocation_info RelInfo =
Obj.getRelocation(RelI->getRawDataRefImpl());
@@ -268,10 +269,10 @@ public:
RelInfo = Obj.getRelocation(RelI->getRawDataRefImpl());
}
- RelocationEntry RE(getRelocationEntry(SectionID, ObjImg, RelI));
+ RelocationEntry RE(getRelocationEntry(SectionID, Obj, RelI));
RE.Addend = decodeAddend(RE);
RelocationValueRef Value(
- getRelocationValueRef(ObjImg, RelI, RE, ObjSectionToID, Symbols));
+ getRelocationValueRef(Obj, RelI, RE, ObjSectionToID));
assert((ExplicitAddend == 0 || RE.Addend == 0) && "Relocation has "\
"ARM64_RELOC_ADDEND and embedded addend in the instruction.");
@@ -282,7 +283,7 @@ public:
bool IsExtern = Obj.getPlainRelocationExternal(RelInfo);
if (!IsExtern && RE.IsPCRel)
- makeValueAddendPCRel(Value, ObjImg, RelI, 1 << RE.Size);
+ makeValueAddendPCRel(Value, Obj, RelI, 1 << RE.Size);
RE.Addend = Value.Offset;
@@ -359,7 +360,7 @@ public:
}
}
- void finalizeSection(ObjectImage &ObjImg, unsigned SectionID,
+ void finalizeSection(const ObjectFile &Obj, unsigned SectionID,
const SectionRef &Section) {}
private: