Lines Matching refs:RE
34 Expected<int64_t> decodeAddend(const RelocationEntry &RE) const { in decodeAddend() argument
35 const SectionEntry &Section = Sections[RE.SectionID]; in decodeAddend()
36 uint8_t *LocalAddress = Section.getAddressWithOffset(RE.Offset); in decodeAddend()
37 unsigned NumBytes = 1 << RE.Size; in decodeAddend()
40 switch (RE.RelType) { in decodeAddend()
46 << getRelocName(RE.RelType); in decodeAddend()
58 << getRelocName(RE.RelType); in decodeAddend()
76 switch (RE.RelType) { in decodeAddend()
305 RelocationEntry RE(getRelocationEntry(SectionID, Obj, RelI)); in processRelocationRef()
307 if (RE.RelType == MachO::ARM64_RELOC_POINTER_TO_GOT) { in processRelocationRef()
309 (RE.Size == 2 && RE.IsPCRel) || (RE.Size == 3 && !RE.IsPCRel); in processRelocationRef()
316 if (auto Addend = decodeAddend(RE)) in processRelocationRef()
317 RE.Addend = *Addend; in processRelocationRef()
321 assert((ExplicitAddend == 0 || RE.Addend == 0) && "Relocation has "\ in processRelocationRef()
324 RE.Addend = ExplicitAddend; in processRelocationRef()
327 if (auto ValueOrErr = getRelocationValueRef(Obj, RelI, RE, ObjSectionToID)) in processRelocationRef()
333 if (RE.RelType == MachO::ARM64_RELOC_POINTER_TO_GOT) { in processRelocationRef()
336 } else if (!IsExtern && RE.IsPCRel) in processRelocationRef()
337 makeValueAddendPCRel(Value, RelI, 1 << RE.Size); in processRelocationRef()
339 RE.Addend = Value.Offset; in processRelocationRef()
341 if (RE.RelType == MachO::ARM64_RELOC_GOT_LOAD_PAGE21 || in processRelocationRef()
342 RE.RelType == MachO::ARM64_RELOC_GOT_LOAD_PAGEOFF12 || in processRelocationRef()
343 RE.RelType == MachO::ARM64_RELOC_POINTER_TO_GOT) in processRelocationRef()
344 processGOTRelocation(RE, Value, Stubs); in processRelocationRef()
347 addRelocationForSymbol(RE, Value.SymbolName); in processRelocationRef()
349 addRelocationForSection(RE, Value.SectionID); in processRelocationRef()
355 void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override { in resolveRelocation() argument
356 LLVM_DEBUG(dumpRelocationToResolve(RE, Value)); in resolveRelocation()
358 const SectionEntry &Section = Sections[RE.SectionID]; in resolveRelocation()
359 uint8_t *LocalAddress = Section.getAddressWithOffset(RE.Offset); in resolveRelocation()
361 static_cast<MachO::RelocationInfoType>(RE.RelType); in resolveRelocation()
367 assert(!RE.IsPCRel && "PCRel and ARM64_RELOC_UNSIGNED not supported"); in resolveRelocation()
370 if (RE.Size < 2) in resolveRelocation()
373 encodeAddend(LocalAddress, 1 << RE.Size, RelType, Value + RE.Addend); in resolveRelocation()
378 assert(((RE.Size == 2 && RE.IsPCRel) || (RE.Size == 3 && !RE.IsPCRel)) && in resolveRelocation()
384 RE.IsPCRel ? (RE.Addend - RE.Offset) : (Value + RE.Addend); in resolveRelocation()
385 encodeAddend(LocalAddress, 1 << RE.Size, RelType, Result); in resolveRelocation()
390 assert(RE.IsPCRel && "not PCRel and ARM64_RELOC_BRANCH26 not supported"); in resolveRelocation()
392 uint64_t FinalAddress = Section.getLoadAddressWithOffset(RE.Offset); in resolveRelocation()
393 int64_t PCRelVal = Value - FinalAddress + RE.Addend; in resolveRelocation()
399 assert(RE.IsPCRel && "not PCRel and ARM64_RELOC_PAGE21 not supported"); in resolveRelocation()
401 uint64_t FinalAddress = Section.getLoadAddressWithOffset(RE.Offset); in resolveRelocation()
403 ((Value + RE.Addend) & (-4096)) - (FinalAddress & (-4096)); in resolveRelocation()
409 assert(!RE.IsPCRel && "PCRel and ARM64_RELOC_PAGEOFF21 not supported"); in resolveRelocation()
411 Value += RE.Addend; in resolveRelocation()
418 uint64_t SectionABase = Sections[RE.Sections.SectionA].getLoadAddress(); in resolveRelocation()
419 uint64_t SectionBBase = Sections[RE.Sections.SectionB].getLoadAddress(); in resolveRelocation()
422 Value = SectionABase - SectionBBase + RE.Addend; in resolveRelocation()
423 writeBytesUnaligned(Value, LocalAddress, 1 << RE.Size); in resolveRelocation()
442 void processGOTRelocation(const RelocationEntry &RE, in processGOTRelocation() argument
444 assert((RE.RelType == MachO::ARM64_RELOC_POINTER_TO_GOT && in processGOTRelocation()
445 (RE.Size == 2 || RE.Size == 3)) || in processGOTRelocation()
446 RE.Size == 2); in processGOTRelocation()
447 SectionEntry &Section = Sections[RE.SectionID]; in processGOTRelocation()
464 RelocationEntry GOTRE(RE.SectionID, StubOffset, in processGOTRelocation()
474 RelocationEntry TargetRE(RE.SectionID, RE.Offset, RE.RelType, Offset, in processGOTRelocation()
475 RE.IsPCRel, RE.Size); in processGOTRelocation()
476 addRelocationForSection(TargetRE, RE.SectionID); in processGOTRelocation()
485 MachO::any_relocation_info RE = in processSubtractRelocation() local
488 unsigned Size = Obj.getAnyRelocationLength(RE); in processSubtractRelocation()