Lines Matching refs:ref
117 const Reference &ref,
163 void applyFixupFinal(const Reference &ref, uint8_t *location,
167 void applyFixupRelocatable(const Reference &ref, uint8_t *location,
235 bool ArchHandler_x86::isCallSite(const Reference &ref) { in isCallSite() argument
236 return (ref.kindValue() == branch32); in isCallSite()
239 bool ArchHandler_x86::isPointer(const Reference &ref) { in isPointer() argument
240 return (ref.kindValue() == pointer32); in isPointer()
419 for (const Reference *ref : atom) { in generateAtomContent() local
420 uint32_t offset = ref->offsetInAtom(); in generateAtomContent()
421 const Atom *target = ref->target(); in generateAtomContent()
428 applyFixupRelocatable(*ref, &atomContentBuffer[offset], in generateAtomContent()
432 applyFixupFinal(*ref, &atomContentBuffer[offset], in generateAtomContent()
439 void ArchHandler_x86::applyFixupFinal(const Reference &ref, uint8_t *loc, in applyFixupFinal() argument
443 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupFinal()
445 assert(ref.kindArch() == Reference::KindArch::x86); in applyFixupFinal()
447 switch (static_cast<X86Kind>(ref.kindValue())) { in applyFixupFinal()
449 *loc32 = (targetAddress - (fixupAddress + 4)) + ref.addend(); in applyFixupFinal()
452 *loc32 = (targetAddress - (fixupAddress + 2)) + ref.addend(); in applyFixupFinal()
456 *loc32 = targetAddress + ref.addend(); in applyFixupFinal()
459 *loc32 = targetAddress - inAtomAddress + ref.addend(); in applyFixupFinal()
462 *loc32 = targetAddress - fixupAddress + ref.addend(); in applyFixupFinal()
465 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupFinal()
473 *loc32 = ref.addend(); in applyFixupFinal()
481 void ArchHandler_x86::applyFixupRelocatable(const Reference &ref, in applyFixupRelocatable() argument
486 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupRelocatable()
488 assert(ref.kindArch() == Reference::KindArch::x86); in applyFixupRelocatable()
489 bool useExternalReloc = useExternalRelocationTo(*ref.target()); in applyFixupRelocatable()
492 switch (static_cast<X86Kind>(ref.kindValue())) { in applyFixupRelocatable()
495 *loc32 = ref.addend() - (fixupAddress + 4); in applyFixupRelocatable()
497 *loc32 =(targetAddress - (fixupAddress+4)) + ref.addend(); in applyFixupRelocatable()
501 *loc16 = ref.addend() - (fixupAddress + 2); in applyFixupRelocatable()
503 *loc16 = (targetAddress - (fixupAddress+2)) + ref.addend(); in applyFixupRelocatable()
507 *loc32 = targetAddress + ref.addend(); in applyFixupRelocatable()
510 *loc32 = targetAddress - inAtomAddress + ref.addend(); // FIXME in applyFixupRelocatable()
513 *loc32 = targetAddress - fixupAddress + ref.addend(); in applyFixupRelocatable()
516 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupRelocatable()
554 const Reference &ref, in appendSectionRelocations() argument
559 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in appendSectionRelocations()
561 assert(ref.kindArch() == Reference::KindArch::x86); in appendSectionRelocations()
562 uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom(); in appendSectionRelocations()
563 bool useExternalReloc = useExternalRelocationTo(*ref.target()); in appendSectionRelocations()
564 switch (static_cast<X86Kind>(ref.kindValue())) { in appendSectionRelocations()
570 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
573 if (ref.addend() != 0) in appendSectionRelocations()
574 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
577 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
583 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
586 if (ref.addend() != 0) in appendSectionRelocations()
587 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
590 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
597 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
600 if (ref.addend() != 0) in appendSectionRelocations()
601 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
604 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
609 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
611 appendReloc(relocs, sectionOffset, 0, addressForAtom(atom) - ref.addend(), in appendSectionRelocations()
615 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
618 ref.offsetInAtom(), in appendSectionRelocations()
623 ref.offsetInAtom(), in appendSectionRelocations()
625 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()