Lines Matching refs:ref

44   bool isGOTAccess(const Reference &ref, bool &canBypassGOT) override {  in isGOTAccess()  argument
45 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isGOTAccess()
47 assert(ref.kindArch() == Reference::KindArch::AArch64); in isGOTAccess()
48 switch (ref.kindValue()) { in isGOTAccess()
64 void updateReferenceToGOT(const Reference *ref, bool targetNowGOT) override { in updateReferenceToGOT() argument
69 assert(ref->kindNamespace() == Reference::KindNamespace::mach_o); in updateReferenceToGOT()
70 assert(ref->kindArch() == Reference::KindArch::AArch64); in updateReferenceToGOT()
71 switch (ref->kindValue()) { in updateReferenceToGOT()
73 const_cast<Reference *>(ref)->setKindValue(page21); in updateReferenceToGOT()
76 const_cast<Reference *>(ref)->setKindValue(targetNowGOT ? in updateReferenceToGOT()
80 const_cast<Reference *>(ref)->setKindValue(delta32); in updateReferenceToGOT()
83 const_cast<Reference *>(ref)->setKindValue(imageOffset); in updateReferenceToGOT()
171 const Reference &ref,
220 void applyFixupFinal(const Reference &ref, uint8_t *location,
225 void applyFixupRelocatable(const Reference &ref, uint8_t *location,
316 bool ArchHandler_arm64::isCallSite(const Reference &ref) { in isCallSite() argument
317 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isCallSite()
319 assert(ref.kindArch() == Reference::KindArch::AArch64); in isCallSite()
320 return (ref.kindValue() == branch26); in isCallSite()
323 bool ArchHandler_arm64::isPointer(const Reference &ref) { in isPointer() argument
324 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isPointer()
326 assert(ref.kindArch() == Reference::KindArch::AArch64); in isPointer()
327 Reference::KindValue kind = ref.kindValue(); in isPointer()
564 for (const Reference *ref : atom) { in generateAtomContent() local
565 uint32_t offset = ref->offsetInAtom(); in generateAtomContent()
566 const Atom *target = ref->target(); in generateAtomContent()
574 applyFixupRelocatable(*ref, &atomContentBuffer[offset], fixupAddress, in generateAtomContent()
577 applyFixupFinal(*ref, &atomContentBuffer[offset], fixupAddress, in generateAtomContent()
584 void ArchHandler_arm64::applyFixupFinal(const Reference &ref, uint8_t *loc, in applyFixupFinal() argument
590 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupFinal()
592 assert(ref.kindArch() == Reference::KindArch::AArch64); in applyFixupFinal()
599 switch (static_cast<Arm64Kind>(ref.kindValue())) { in applyFixupFinal()
601 displacement = (targetAddress - fixupAddress) + ref.addend(); in applyFixupFinal()
608 ((targetAddress + ref.addend()) & (-4096)) - (fixupAddress & (-4096)); in applyFixupFinal()
614 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
618 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
624 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
630 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
636 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
645 displacement = (targetAddress + ref.addend()) & 0x00000FFF; in applyFixupFinal()
652 *loc64 = targetAddress + ref.addend(); in applyFixupFinal()
656 *loc64 = (targetAddress - fixupAddress) + ref.addend(); in applyFixupFinal()
661 *loc32 = (targetAddress - fixupAddress) + ref.addend(); in applyFixupFinal()
664 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupFinal()
670 *loc32 = ref.addend(); in applyFixupFinal()
673 *loc32 = (targetAddress - imageBaseAddress) + ref.addend(); in applyFixupFinal()
679 value64 = targetAddress - findSectionAddress(*ref.target()) + ref.addend(); in applyFixupFinal()
690 void ArchHandler_arm64::applyFixupRelocatable(const Reference &ref, in applyFixupRelocatable() argument
696 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupRelocatable()
698 assert(ref.kindArch() == Reference::KindArch::AArch64); in applyFixupRelocatable()
701 switch (static_cast<Arm64Kind>(ref.kindValue())) { in applyFixupRelocatable()
721 *loc64 = targetAddress + ref.addend(); in applyFixupRelocatable()
723 *loc64 = ref.addend(); in applyFixupRelocatable()
726 *loc64 = ref.addend() + inAtomAddress - fixupAddress; in applyFixupRelocatable()
736 *loc32 = ref.addend() + inAtomAddress - fixupAddress; in applyFixupRelocatable()
743 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupRelocatable()
776 const DefinedAtom &atom, uint64_t atomSectionOffset, const Reference &ref, in appendSectionRelocations() argument
780 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in appendSectionRelocations()
782 assert(ref.kindArch() == Reference::KindArch::AArch64); in appendSectionRelocations()
783 uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom(); in appendSectionRelocations()
784 switch (static_cast<Arm64Kind>(ref.kindValue())) { in appendSectionRelocations()
786 if (ref.addend()) { in appendSectionRelocations()
787 appendReloc(relocs, sectionOffset, ref.addend(), 0, in appendSectionRelocations()
789 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
792 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
797 if (ref.addend()) { in appendSectionRelocations()
798 appendReloc(relocs, sectionOffset, ref.addend(), 0, in appendSectionRelocations()
800 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
803 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
812 if (ref.addend()) { in appendSectionRelocations()
813 appendReloc(relocs, sectionOffset, ref.addend(), 0, in appendSectionRelocations()
815 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
818 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
823 assert(ref.addend() == 0); in appendSectionRelocations()
824 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
828 assert(ref.addend() == 0); in appendSectionRelocations()
829 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
833 assert(ref.addend() == 0); in appendSectionRelocations()
834 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
838 assert(ref.addend() == 0); in appendSectionRelocations()
839 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
843 if (ref.target()->name().empty()) in appendSectionRelocations()
844 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
847 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
853 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
859 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
863 assert(ref.addend() == 0); in appendSectionRelocations()
864 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
868 assert(ref.addend() == 0); in appendSectionRelocations()
869 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()