Lines Matching refs:ref
111 const Reference &ref,
200 void applyFixupFinal(const Reference &ref, uint8_t *location,
205 void applyFixupRelocatable(const Reference &ref, uint8_t *location,
300 bool ArchHandler_arm::isCallSite(const Reference &ref) { in isCallSite() argument
301 switch (ref.kindValue()) { in isCallSite()
312 bool ArchHandler_arm::isPointer(const Reference &ref) { in isPointer() argument
313 return (ref.kindValue() == pointer32); in isPointer()
316 bool ArchHandler_arm::isNonCallBranch(const Reference &ref) { in isNonCallBranch() argument
317 switch (ref.kindValue()) { in isNonCallBranch()
341 for (const Reference *ref : stubAtom) { in stubName() local
342 if (const DefinedAtom* lp = dyn_cast<DefinedAtom>(ref->target())) { in stubName()
904 void ArchHandler_arm::applyFixupFinal(const Reference &ref, uint8_t *loc, in applyFixupFinal() argument
909 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupFinal()
911 assert(ref.kindArch() == Reference::KindArch::ARM); in applyFixupFinal()
916 switch (static_cast<ArmKind>(ref.kindValue())) { in applyFixupFinal()
928 displacement = (targetAddress - (fixupAddress + 4)) + ref.addend(); in applyFixupFinal()
935 value16 = (targetAddress + ref.addend()) & 0xFFFF; in applyFixupFinal()
942 value16 = (targetAddress + ref.addend()) >> 16; in applyFixupFinal()
947 value16 = (targetAddress - inAtomAddress + ref.addend()) & 0xFFFF; in applyFixupFinal()
954 value16 = (targetAddress - inAtomAddress + ref.addend()) >> 16; in applyFixupFinal()
960 displacement = (targetAddress - (fixupAddress + 8)) + ref.addend(); in applyFixupFinal()
966 value16 = (targetAddress + ref.addend()) & 0xFFFF; in applyFixupFinal()
973 value16 = (targetAddress + ref.addend()) >> 16; in applyFixupFinal()
978 value16 = (targetAddress - inAtomAddress + ref.addend()) & 0xFFFF; in applyFixupFinal()
985 value16 = (targetAddress - inAtomAddress + ref.addend()) >> 16; in applyFixupFinal()
990 *loc32 = targetAddress + ref.addend() + 1; in applyFixupFinal()
992 *loc32 = targetAddress + ref.addend(); in applyFixupFinal()
996 *loc32 = targetAddress - fixupAddress + ref.addend() + 1; in applyFixupFinal()
998 *loc32 = targetAddress - fixupAddress + ref.addend(); in applyFixupFinal()
1004 *loc32 = ref.addend(); in applyFixupFinal()
1023 for (const Reference *ref : atom) { in generateAtomContent() local
1024 uint32_t offset = ref->offsetInAtom(); in generateAtomContent()
1025 const Atom *target = ref->target(); in generateAtomContent()
1035 applyFixupRelocatable(*ref, &atomContentBuffer[offset], fixupAddress, in generateAtomContent()
1039 applyFixupFinal(*ref, &atomContentBuffer[offset], fixupAddress, in generateAtomContent()
1066 void ArchHandler_arm::applyFixupRelocatable(const Reference &ref, uint8_t *loc, in applyFixupRelocatable() argument
1072 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in applyFixupRelocatable()
1074 assert(ref.kindArch() == Reference::KindArch::ARM); in applyFixupRelocatable()
1075 bool useExternalReloc = useExternalRelocationTo(*ref.target()); in applyFixupRelocatable()
1080 bool targetIsUndef = isa<UndefinedAtom>(ref.target()); in applyFixupRelocatable()
1081 switch (static_cast<ArmKind>(ref.kindValue())) { in applyFixupRelocatable()
1094 displacement = (ref.addend() - (fixupAddress + 4)); in applyFixupRelocatable()
1096 displacement = (targetAddress - (fixupAddress + 4)) + ref.addend(); in applyFixupRelocatable()
1105 value16 = ref.addend() & 0xFFFF; in applyFixupRelocatable()
1107 value16 = (targetAddress + ref.addend()) & 0xFFFF; in applyFixupRelocatable()
1113 value16 = ref.addend() >> 16; in applyFixupRelocatable()
1115 value16 = (targetAddress + ref.addend()) >> 16; in applyFixupRelocatable()
1120 value16 = (targetAddress - inAtomAddress + ref.addend()) & 0xFFFF; in applyFixupRelocatable()
1125 value16 = (targetAddress - inAtomAddress + ref.addend()) >> 16; in applyFixupRelocatable()
1132 displacement = (ref.addend() - (fixupAddress + 8)); in applyFixupRelocatable()
1134 displacement = (targetAddress - (fixupAddress + 8)) + ref.addend(); in applyFixupRelocatable()
1142 value16 = ref.addend() & 0xFFFF; in applyFixupRelocatable()
1144 value16 = (targetAddress + ref.addend()) & 0xFFFF; in applyFixupRelocatable()
1150 value16 = ref.addend() >> 16; in applyFixupRelocatable()
1152 value16 = (targetAddress + ref.addend()) >> 16; in applyFixupRelocatable()
1157 value16 = (targetAddress - inAtomAddress + ref.addend()) & 0xFFFF; in applyFixupRelocatable()
1162 value16 = (targetAddress - inAtomAddress + ref.addend()) >> 16; in applyFixupRelocatable()
1166 *loc32 = targetAddress + ref.addend(); in applyFixupRelocatable()
1169 *loc32 = targetAddress - fixupAddress + ref.addend(); in applyFixupRelocatable()
1184 const Reference &ref, in appendSectionRelocations() argument
1189 if (ref.kindNamespace() != Reference::KindNamespace::mach_o) in appendSectionRelocations()
1191 assert(ref.kindArch() == Reference::KindArch::ARM); in appendSectionRelocations()
1192 uint32_t sectionOffset = atomSectionOffset + ref.offsetInAtom(); in appendSectionRelocations()
1193 bool useExternalReloc = useExternalRelocationTo(*ref.target()); in appendSectionRelocations()
1197 switch (static_cast<ArmKind>(ref.kindValue())) { in appendSectionRelocations()
1206 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
1209 if (ref.addend() != 0) in appendSectionRelocations()
1210 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
1213 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
1219 other16 = ref.addend() >> 16; in appendSectionRelocations()
1220 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
1225 targetAtomAddress = addressForAtom(*ref.target()); in appendSectionRelocations()
1226 if (ref.addend() != 0) { in appendSectionRelocations()
1227 other16 = (targetAtomAddress + ref.addend()) >> 16; in appendSectionRelocations()
1233 other16 = (targetAtomAddress + ref.addend()) >> 16; in appendSectionRelocations()
1234 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
1243 other16 = ref.addend() & 0xFFFF; in appendSectionRelocations()
1244 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
1249 targetAtomAddress = addressForAtom(*ref.target()); in appendSectionRelocations()
1250 if (ref.addend() != 0) { in appendSectionRelocations()
1251 other16 = (targetAtomAddress + ref.addend()) & 0xFFFF; in appendSectionRelocations()
1257 other16 = (targetAtomAddress + ref.addend()) & 0xFFFF; in appendSectionRelocations()
1258 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
1267 targetAtomAddress = addressForAtom(*ref.target()); in appendSectionRelocations()
1268 other16 = (targetAtomAddress - fromAtomAddress + ref.addend()) >> 16; in appendSectionRelocations()
1276 targetAtomAddress = addressForAtom(*ref.target()); in appendSectionRelocations()
1277 other16 = (targetAtomAddress - fromAtomAddress + ref.addend()) & 0xFFFF; in appendSectionRelocations()
1286 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
1289 if (ref.addend() != 0) in appendSectionRelocations()
1290 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
1293 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
1299 other16 = ref.addend() >> 16; in appendSectionRelocations()
1300 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
1305 targetAtomAddress = addressForAtom(*ref.target()); in appendSectionRelocations()
1306 if (ref.addend() != 0) { in appendSectionRelocations()
1307 other16 = (targetAtomAddress + ref.addend()) >> 16; in appendSectionRelocations()
1313 other16 = (targetAtomAddress + ref.addend()) >> 16; in appendSectionRelocations()
1314 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
1323 other16 = ref.addend() & 0xFFFF; in appendSectionRelocations()
1324 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
1329 targetAtomAddress = addressForAtom(*ref.target()); in appendSectionRelocations()
1330 if (ref.addend() != 0) { in appendSectionRelocations()
1331 other16 = (targetAtomAddress + ref.addend()) & 0xFFFF; in appendSectionRelocations()
1337 other16 = (targetAtomAddress + ref.addend()) & 0xFFFF; in appendSectionRelocations()
1338 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
1347 targetAtomAddress = addressForAtom(*ref.target()); in appendSectionRelocations()
1348 other16 = (targetAtomAddress - fromAtomAddress + ref.addend()) >> 16; in appendSectionRelocations()
1356 targetAtomAddress = addressForAtom(*ref.target()); in appendSectionRelocations()
1357 other16 = (targetAtomAddress - fromAtomAddress + ref.addend()) & 0xFFFF; in appendSectionRelocations()
1365 appendReloc(relocs, sectionOffset, symbolIndexForAtom(*ref.target()), 0, in appendSectionRelocations()
1369 if (ref.addend() != 0) in appendSectionRelocations()
1370 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
1373 appendReloc(relocs, sectionOffset, sectionIndexForAtom(*ref.target()),0, in appendSectionRelocations()
1378 appendReloc(relocs, sectionOffset, 0, addressForAtom(*ref.target()), in appendSectionRelocations()
1381 ref.offsetInAtom(), in appendSectionRelocations()
1402 for (const Reference *ref : atom) { in isThumbFunction() local
1403 if (ref->offsetInAtom() != 0) in isThumbFunction()
1405 if (ref->kindNamespace() != Reference::KindNamespace::mach_o) in isThumbFunction()
1407 assert(ref->kindArch() == Reference::KindArch::ARM); in isThumbFunction()
1408 if (ref->kindValue() == modeThumbCode) in isThumbFunction()