Lines Matching refs:ref
118 const Reference &ref,
164 void applyFixupFinal(const Reference &ref, uint8_t *location,
168 void applyFixupRelocatable(const Reference &ref, uint8_t *location,
236 bool ArchHandler_x86::isCallSite(const Reference &ref) { in isCallSite() argument
237 return (ref.kindValue() == branch32); in isCallSite()
240 bool ArchHandler_x86::isPointer(const Reference &ref) { in isPointer() argument
241 return (ref.kindValue() == pointer32); in isPointer()
420 for (const Reference *ref : atom) { in generateAtomContent() local
421 uint32_t offset = ref->offsetInAtom(); in generateAtomContent()
422 const Atom *target = ref->target(); in generateAtomContent()
429 applyFixupRelocatable(*ref, &atomContentBuffer[offset], in generateAtomContent()
433 applyFixupFinal(*ref, &atomContentBuffer[offset], in generateAtomContent()
440 void ArchHandler_x86::applyFixupFinal(const Reference &ref, uint8_t *loc, in applyFixupFinal() argument
444 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupFinal()
446 assert(ref.kindArch() == Reference::KindArch::x86); in applyFixupFinal()
448 switch (static_cast<X86Kind>(ref.kindValue())) { in applyFixupFinal()
450 *loc32 = (targetAddress - (fixupAddress + 4)) + ref.addend(); in applyFixupFinal()
453 *loc32 = (targetAddress - (fixupAddress + 2)) + ref.addend(); in applyFixupFinal()
457 *loc32 = targetAddress + ref.addend(); in applyFixupFinal()
460 *loc32 = targetAddress - inAtomAddress + ref.addend(); in applyFixupFinal()
463 *loc32 = targetAddress - fixupAddress + ref.addend(); in applyFixupFinal()
466 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupFinal()
474 *loc32 = ref.addend(); in applyFixupFinal()
482 void ArchHandler_x86::applyFixupRelocatable(const Reference &ref, in applyFixupRelocatable() argument
487 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupRelocatable()
489 assert(ref.kindArch() == Reference::KindArch::x86); in applyFixupRelocatable()
490 bool useExternalReloc = useExternalRelocationTo(*ref.target()); in applyFixupRelocatable()
493 switch (static_cast<X86Kind>(ref.kindValue())) { in applyFixupRelocatable()
496 *loc32 = ref.addend() - (fixupAddress + 4); in applyFixupRelocatable()
498 *loc32 =(targetAddress - (fixupAddress+4)) + ref.addend(); in applyFixupRelocatable()
502 *loc16 = ref.addend() - (fixupAddress + 2); in applyFixupRelocatable()
504 *loc16 = (targetAddress - (fixupAddress+2)) + ref.addend(); in applyFixupRelocatable()
508 *loc32 = targetAddress + ref.addend(); in applyFixupRelocatable()
511 *loc32 = targetAddress - inAtomAddress + ref.addend(); // FIXME in applyFixupRelocatable()
514 *loc32 = targetAddress - fixupAddress + ref.addend(); in applyFixupRelocatable()
517 *loc32 = fixupAddress - targetAddress + ref.addend(); in applyFixupRelocatable()
555 const Reference &ref, in appendSectionRelocations() argument
560 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in appendSectionRelocations()
562 assert(ref.kindArch() == Reference::KindArch::x86); in appendSectionRelocations()
563 uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom(); in appendSectionRelocations()
564 bool useExternalReloc = useExternalRelocationTo(*ref.target()); in appendSectionRelocations()
565 switch (static_cast<X86Kind>(ref.kindValue())) { in appendSectionRelocations()
571 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
574 if (ref.addend() != 0) in appendSectionRelocations()
575 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
578 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
584 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
587 if (ref.addend() != 0) in appendSectionRelocations()
588 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
591 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
598 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
601 if (ref.addend() != 0) in appendSectionRelocations()
602 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
605 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
610 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
612 appendReloc(relocs, sectionOffset, 0, addressForAtom(atom) - ref.addend(), in appendSectionRelocations()
616 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
619 ref.offsetInAtom(), in appendSectionRelocations()
624 ref.offsetInAtom(), in appendSectionRelocations()
626 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()