Lines Matching refs:ref

42   bool isGOTAccess(const Reference &ref, bool &canBypassGOT) override {  in isGOTAccess()  argument
43 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isGOTAccess()
45 assert(ref.kindArch() == Reference::KindArch::x86_64); in isGOTAccess()
46 switch (ref.kindValue()) { in isGOTAccess()
61 bool isTLVAccess(const Reference &ref) const override { in isTLVAccess()
62 assert(ref.kindNamespace() == Reference::KindNamespace::mach_o); in isTLVAccess()
63 assert(ref.kindArch() == Reference::KindArch::x86_64); in isTLVAccess()
64 return ref.kindValue() == ripRel32Tlv; in isTLVAccess()
67 void updateReferenceToTLV(const Reference *ref) override { in updateReferenceToTLV() argument
68 assert(ref->kindNamespace() == Reference::KindNamespace::mach_o); in updateReferenceToTLV()
69 assert(ref->kindArch() == Reference::KindArch::x86_64); in updateReferenceToTLV()
70 assert(ref->kindValue() == ripRel32Tlv); in updateReferenceToTLV()
71 const_cast<Reference*>(ref)->setKindValue(ripRel32); in updateReferenceToTLV()
75 void updateReferenceToGOT(const Reference *ref, bool targetNowGOT) override { in updateReferenceToGOT() argument
76 assert(ref->kindNamespace() == Reference::KindNamespace::mach_o); in updateReferenceToGOT()
77 assert(ref->kindArch() == Reference::KindArch::x86_64); in updateReferenceToGOT()
79 switch (ref->kindValue()) { in updateReferenceToGOT()
84 const_cast<Reference *>(ref) in updateReferenceToGOT()
88 const_cast<Reference *>(ref)->setKindValue(imageOffset); in updateReferenceToGOT()
178 const Reference &ref,
250 void applyFixupFinal(const Reference &ref, uint8_t *location,
255 void applyFixupRelocatable(const Reference &ref, uint8_t *location,
340 bool ArchHandler_x86_64::isCallSite(const Reference &ref) { in isCallSite() argument
341 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isCallSite()
343 assert(ref.kindArch() == Reference::KindArch::x86_64); in isCallSite()
344 return (ref.kindValue() == branch32); in isCallSite()
347 bool ArchHandler_x86_64::isPointer(const Reference &ref) { in isPointer() argument
348 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in isPointer()
350 assert(ref.kindArch() == Reference::KindArch::x86_64); in isPointer()
351 Reference::KindValue kind = ref.kindValue(); in isPointer()
553 for (const Reference *ref : atom) { in generateAtomContent() local
554 uint32_t offset = ref->offsetInAtom(); in generateAtomContent()
555 const Atom *target = ref->target(); in generateAtomContent()
562 applyFixupRelocatable(*ref, &atomContentBuffer[offset], in generateAtomContent()
566 applyFixupFinal(*ref, &atomContentBuffer[offset], in generateAtomContent()
574 const Reference &ref, uint8_t *loc, uint64_t fixupAddress, in applyFixupFinal() argument
577 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupFinal()
579 assert(ref.kindArch() == Reference::KindArch::x86_64); in applyFixupFinal()
582 switch (static_cast<X86_64Kind>(ref.kindValue())) { in applyFixupFinal()
589 *loc32 = targetAddress - (fixupAddress + 4) + ref.addend(); in applyFixupFinal()
593 *loc64 = targetAddress + ref.addend(); in applyFixupFinal()
596 *loc64 = targetAddress - findSectionAddress(*ref.target()) + ref.addend(); in applyFixupFinal()
600 *loc32 = targetAddress - (fixupAddress + 5) + ref.addend(); in applyFixupFinal()
604 *loc32 = targetAddress - (fixupAddress + 6) + ref.addend(); in applyFixupFinal()
608 *loc32 = targetAddress - (fixupAddress + 8) + ref.addend(); in applyFixupFinal()
612 *loc32 = targetAddress - fixupAddress + ref.addend(); in applyFixupFinal()
617 *loc64 = targetAddress - fixupAddress + ref.addend(); in applyFixupFinal()
623 *loc32 = targetAddress - (fixupAddress + 4) + ref.addend(); in applyFixupFinal()
626 *loc64 = fixupAddress - targetAddress + ref.addend(); in applyFixupFinal()
629 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupFinal()
637 *loc32 = ref.addend(); in applyFixupFinal()
641 *loc32 = (targetAddress - imageBaseAddress) + ref.addend(); in applyFixupFinal()
644 uint64_t val = targetAddress - findSectionAddress(*ref.target()) + ref.addend(); in applyFixupFinal()
656 void ArchHandler_x86_64::applyFixupRelocatable(const Reference &ref, in applyFixupRelocatable() argument
661 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupRelocatable()
663 assert(ref.kindArch() == Reference::KindArch::x86_64); in applyFixupRelocatable()
666 switch (static_cast<X86_64Kind>(ref.kindValue())) { in applyFixupRelocatable()
672 *loc32 = ref.addend(); in applyFixupRelocatable()
675 *loc32 = (targetAddress - (fixupAddress + 4)) + ref.addend(); in applyFixupRelocatable()
679 *loc64 = ref.addend(); in applyFixupRelocatable()
682 *loc64 = targetAddress + ref.addend(); in applyFixupRelocatable()
685 *loc32 = ref.addend() - 1; in applyFixupRelocatable()
688 *loc32 = (targetAddress - (fixupAddress + 5)) + ref.addend(); in applyFixupRelocatable()
691 *loc32 = ref.addend() - 2; in applyFixupRelocatable()
694 *loc32 = (targetAddress - (fixupAddress + 6)) + ref.addend(); in applyFixupRelocatable()
697 *loc32 = ref.addend() - 4; in applyFixupRelocatable()
700 *loc32 = (targetAddress - (fixupAddress + 8)) + ref.addend(); in applyFixupRelocatable()
703 *loc32 = ref.addend() + inAtomAddress - fixupAddress; in applyFixupRelocatable()
716 *loc32 = (targetAddress + ref.addend()) - (fixupAddress - inAtomAddress); in applyFixupRelocatable()
719 *loc64 = ref.addend() + inAtomAddress - fixupAddress; in applyFixupRelocatable()
732 *loc64 = (targetAddress + ref.addend()) - (fixupAddress - inAtomAddress); in applyFixupRelocatable()
735 *loc64 = ref.addend() + fixupAddress - inAtomAddress; in applyFixupRelocatable()
738 *loc32 = ref.addend() + fixupAddress - inAtomAddress; in applyFixupRelocatable()
767 const Reference &ref, in appendSectionRelocations() argument
772 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in appendSectionRelocations()
774 assert(ref.kindArch() == Reference::KindArch::x86_64); in appendSectionRelocations()
775 uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom(); in appendSectionRelocations()
776 switch (static_cast<X86_64Kind>(ref.kindValue())) { in appendSectionRelocations()
781 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
785 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
789 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
793 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
797 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
801 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
806 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
810 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
814 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
818 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
822 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
826 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
830 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
834 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
840 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
846 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
852 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
858 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
865 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
871 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()