Lines Matching refs:ref

43   bool isGOTAccess(const Reference &ref, bool &canBypassGOT) override {  in isGOTAccess()  argument
44 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isGOTAccess()
46 assert(ref.kindArch() == Reference::KindArch::AArch64); in isGOTAccess()
47 switch (ref.kindValue()) { in isGOTAccess()
63 void updateReferenceToGOT(const Reference *ref, bool targetNowGOT) override { in updateReferenceToGOT() argument
68 assert(ref->kindNamespace() == Reference::KindNamespace::mach_o); in updateReferenceToGOT()
69 assert(ref->kindArch() == Reference::KindArch::AArch64); in updateReferenceToGOT()
70 switch (ref->kindValue()) { in updateReferenceToGOT()
72 const_cast<Reference *>(ref)->setKindValue(page21); in updateReferenceToGOT()
75 const_cast<Reference *>(ref)->setKindValue(targetNowGOT ? in updateReferenceToGOT()
79 const_cast<Reference *>(ref)->setKindValue(delta32); in updateReferenceToGOT()
82 const_cast<Reference *>(ref)->setKindValue(imageOffset); in updateReferenceToGOT()
170 const Reference &ref,
219 void applyFixupFinal(const Reference &ref, uint8_t *location,
224 void applyFixupRelocatable(const Reference &ref, uint8_t *location,
315 bool ArchHandler_arm64::isCallSite(const Reference &ref) { in isCallSite() argument
316 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isCallSite()
318 assert(ref.kindArch() == Reference::KindArch::AArch64); in isCallSite()
319 return (ref.kindValue() == branch26); in isCallSite()
322 bool ArchHandler_arm64::isPointer(const Reference &ref) { in isPointer() argument
323 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isPointer()
325 assert(ref.kindArch() == Reference::KindArch::AArch64); in isPointer()
326 Reference::KindValue kind = ref.kindValue(); in isPointer()
563 for (const Reference *ref : atom) { in generateAtomContent() local
564 uint32_t offset = ref->offsetInAtom(); in generateAtomContent()
565 const Atom *target = ref->target(); in generateAtomContent()
573 applyFixupRelocatable(*ref, &atomContentBuffer[offset], fixupAddress, in generateAtomContent()
576 applyFixupFinal(*ref, &atomContentBuffer[offset], fixupAddress, in generateAtomContent()
583 void ArchHandler_arm64::applyFixupFinal(const Reference &ref, uint8_t *loc, in applyFixupFinal() argument
589 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupFinal()
591 assert(ref.kindArch() == Reference::KindArch::AArch64); in applyFixupFinal()
598 switch (static_cast<Arm64Kind>(ref.kindValue())) { in applyFixupFinal()
600 displacement = (targetAddress - fixupAddress) + ref.addend(); in applyFixupFinal()
607 ((targetAddress + ref.addend()) & (-4096)) - (fixupAddress & (-4096)); in applyFixupFinal()
613 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
617 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
623 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
629 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
635 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
644 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
651 *loc64 = targetAddress + ref.addend(); in applyFixupFinal()
655 *loc64 = (targetAddress - fixupAddress) + ref.addend(); in applyFixupFinal()
660 *loc32 = (targetAddress - fixupAddress) + ref.addend(); in applyFixupFinal()
663 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupFinal()
669 *loc32 = ref.addend(); in applyFixupFinal()
672 *loc32 = (targetAddress - imageBaseAddress) + ref.addend(); in applyFixupFinal()
678 value64 = targetAddress - findSectionAddress(*ref.target()) + ref.addend(); in applyFixupFinal()
689 void ArchHandler_arm64::applyFixupRelocatable(const Reference &ref, in applyFixupRelocatable() argument
695 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupRelocatable()
697 assert(ref.kindArch() == Reference::KindArch::AArch64); in applyFixupRelocatable()
700 switch (static_cast<Arm64Kind>(ref.kindValue())) { in applyFixupRelocatable()
720 *loc64 = targetAddress + ref.addend(); in applyFixupRelocatable()
722 *loc64 = ref.addend(); in applyFixupRelocatable()
725 *loc64 = ref.addend() + inAtomAddress - fixupAddress; in applyFixupRelocatable()
735 *loc32 = ref.addend() + inAtomAddress - fixupAddress; in applyFixupRelocatable()
742 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupRelocatable()
775 const DefinedAtom &atom, uint64_t atomSectionOffset, const Reference &ref, in appendSectionRelocations() argument
779 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in appendSectionRelocations()
781 assert(ref.kindArch() == Reference::KindArch::AArch64); in appendSectionRelocations()
782 uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom(); in appendSectionRelocations()
783 switch (static_cast<Arm64Kind>(ref.kindValue())) { in appendSectionRelocations()
785 if (ref.addend()) { in appendSectionRelocations()
786 appendReloc(relocs, sectionOffset, ref.addend(), 0, in appendSectionRelocations()
788 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
791 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
796 if (ref.addend()) { in appendSectionRelocations()
797 appendReloc(relocs, sectionOffset, ref.addend(), 0, in appendSectionRelocations()
799 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
802 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
811 if (ref.addend()) { in appendSectionRelocations()
812 appendReloc(relocs, sectionOffset, ref.addend(), 0, in appendSectionRelocations()
814 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
817 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
822 assert(ref.addend() == 0); in appendSectionRelocations()
823 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
827 assert(ref.addend() == 0); in appendSectionRelocations()
828 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
832 assert(ref.addend() == 0); in appendSectionRelocations()
833 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
837 assert(ref.addend() == 0); in appendSectionRelocations()
838 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
842 if (ref.target()->name().empty()) in appendSectionRelocations()
843 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
846 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
852 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
858 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
862 assert(ref.addend() == 0); in appendSectionRelocations()
863 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
867 assert(ref.addend() == 0); in appendSectionRelocations()
868 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()