comparison lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 60c9769439b8
children 7d135dc70f03
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
21 : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOAArch64> { 21 : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOAArch64> {
22 public: 22 public:
23 23
24 typedef uint64_t TargetPtrT; 24 typedef uint64_t TargetPtrT;
25 25
26 RuntimeDyldMachOAArch64(RTDyldMemoryManager *MM) 26 RuntimeDyldMachOAArch64(RuntimeDyld::MemoryManager &MM,
27 : RuntimeDyldMachOCRTPBase(MM) {} 27 RuntimeDyld::SymbolResolver &Resolver)
28 : RuntimeDyldMachOCRTPBase(MM, Resolver) {}
28 29
29 unsigned getMaxStubSize() override { return 8; } 30 unsigned getMaxStubSize() override { return 8; }
30 31
31 unsigned getStubAlignment() override { return 8; } 32 unsigned getStubAlignment() override { return 8; }
32 33
269 RelInfo = Obj.getRelocation(RelI->getRawDataRefImpl()); 270 RelInfo = Obj.getRelocation(RelI->getRawDataRefImpl());
270 } 271 }
271 272
272 RelocationEntry RE(getRelocationEntry(SectionID, Obj, RelI)); 273 RelocationEntry RE(getRelocationEntry(SectionID, Obj, RelI));
273 RE.Addend = decodeAddend(RE); 274 RE.Addend = decodeAddend(RE);
275
276 assert((ExplicitAddend == 0 || RE.Addend == 0) && "Relocation has "\
277 "ARM64_RELOC_ADDEND and embedded addend in the instruction.");
278 if (ExplicitAddend)
279 RE.Addend = ExplicitAddend;
280
274 RelocationValueRef Value( 281 RelocationValueRef Value(
275 getRelocationValueRef(Obj, RelI, RE, ObjSectionToID)); 282 getRelocationValueRef(Obj, RelI, RE, ObjSectionToID));
276 283
277 assert((ExplicitAddend == 0 || RE.Addend == 0) && "Relocation has "\
278 "ARM64_RELOC_ADDEND and embedded addend in the instruction.");
279 if (ExplicitAddend) {
280 RE.Addend = ExplicitAddend;
281 Value.Offset = ExplicitAddend;
282 }
283
284 bool IsExtern = Obj.getPlainRelocationExternal(RelInfo); 284 bool IsExtern = Obj.getPlainRelocationExternal(RelInfo);
285 if (!IsExtern && RE.IsPCRel) 285 if (!IsExtern && RE.IsPCRel)
286 makeValueAddendPCRel(Value, Obj, RelI, 1 << RE.Size); 286 makeValueAddendPCRel(Value, RelI, 1 << RE.Size);
287 287
288 RE.Addend = Value.Offset; 288 RE.Addend = Value.Offset;
289 289
290 if (RE.RelType == MachO::ARM64_RELOC_GOT_LOAD_PAGE21 || 290 if (RE.RelType == MachO::ARM64_RELOC_GOT_LOAD_PAGE21 ||
291 RE.RelType == MachO::ARM64_RELOC_GOT_LOAD_PAGEOFF12) 291 RE.RelType == MachO::ARM64_RELOC_GOT_LOAD_PAGEOFF12)