Lines Matching defs:pReloc

79 void MipsRelocator::scanRelocation(Relocation& pReloc,
85 ResolveInfo* rsym = pReloc.symInfo();
90 if (pReloc.symInfo() == getTarget().getGpDispSymbol()->resolveInfo())
94 pReloc.updateAddend();
105 scanLocalReloc(pReloc, pBuilder, pSection);
107 scanGlobalReloc(pReloc, pBuilder, pSection);
139 void MipsRelocator::scanLocalReloc(Relocation& pReloc,
143 ResolveInfo* rsym = pReloc.symInfo();
145 switch (pReloc.type()){
223 fatal(diag::unknown_relocation) << (int)pReloc.type()
224 << pReloc.symInfo()->name();
228 void MipsRelocator::scanGlobalReloc(Relocation& pReloc,
232 ResolveInfo* rsym = pReloc.symInfo();
234 switch (pReloc.type()){
279 fatal(diag::invalid_global_relocation) << (int)pReloc.type()
280 << pReloc.symInfo()->name();
312 fatal(diag::dynamic_relocation) << (int)pReloc.type();
315 fatal(diag::unknown_relocation) << (int)pReloc.type()
316 << pReloc.symInfo()->name();
325 // Find next R_MIPS_LO16 relocation paired to pReloc.
327 Relocation* helper_FindLo16Reloc(Relocation& pReloc)
329 Relocation* reloc = static_cast<Relocation*>(pReloc.getNextNode());
333 reloc->symInfo() == pReloc.symInfo())
343 bool helper_isGpDisp(const Relocation& pReloc)
345 const ResolveInfo* rsym = pReloc.symInfo();
357 Relocation& pReloc,
370 MipsGOTEntry& helper_GetGOTEntry(Relocation& pReloc, MipsRelocator& pParent)
373 ResolveInfo* rsym = pReloc.symInfo();
382 helper_SetupRelDynForGOTEntry(*got_entry, pReloc, NULL, pParent);
403 got_entry->setValue(pReloc.symValue());
407 helper_SetupRelDynForGOTEntry(*got_entry, pReloc,
414 Relocator::Address helper_GetGOTOffset(Relocation& pReloc,
419 MipsGOTEntry& got_entry = helper_GetGOTEntry(pReloc, pParent);
442 void helper_DynRel(Relocation& pReloc, MipsRelocator& pParent)
444 ResolveInfo* rsym = pReloc.symInfo();
451 rel_entry.targetRef() = pReloc.targetRef();
453 Relocator::DWord A = pReloc.target() + pReloc.addend();
454 Relocator::DWord S = pReloc.symValue();
458 pReloc.target() = A + S;
463 pReloc.target() = A;
473 MipsRelocator::Result none(Relocation& pReloc, MipsRelocator& pParent)
480 MipsRelocator::Result abs32(Relocation& pReloc, MipsRelocator& pParent)
482 ResolveInfo* rsym = pReloc.symInfo();
484 Relocator::DWord A = pReloc.target() + pReloc.addend();
485 Relocator::DWord S = pReloc.symValue();
487 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
491 pReloc.target() = S + A;
496 helper_DynRel(pReloc, pParent);
501 pReloc.target() = (S + A);
510 MipsRelocator::Result hi16(Relocation& pReloc, MipsRelocator& pParent)
512 Relocation* lo_reloc = helper_FindLo16Reloc(pReloc);
515 int32_t AHL = helper_CalcAHL(pReloc, *lo_reloc);
520 if (helper_isGpDisp(pReloc)) {
521 int32_t P = pReloc.place();
526 int32_t S = pReloc.symValue();
530 pReloc.target() &= 0xFFFF0000;
531 pReloc.target() |= (res & 0xFFFF);
540 MipsRelocator::Result lo16(Relocation& pReloc, MipsRelocator& pParent)
544 if (helper_isGpDisp(pReloc)) {
545 int32_t P = pReloc.place();
551 int32_t S = pReloc.symValue();
555 int32_t ALO = (pReloc.target() & 0xFFFF) + pReloc.addend();
559 pReloc.target() &= 0xFFFF0000;
560 pReloc.target() |= (res & 0xFFFF);
569 MipsRelocator::Result got16(Relocation& pReloc, MipsRelocator& pParent)
573 ResolveInfo* rsym = pReloc.symInfo();
577 Relocation* lo_reloc = helper_FindLo16Reloc(pReloc);
580 int32_t AHL = helper_CalcAHL(pReloc, *lo_reloc);
581 int32_t S = pReloc.symValue();
586 MipsGOTEntry& got_entry = helper_GetGOTEntry(pReloc, pParent);
592 G = helper_GetGOTOffset(pReloc, pParent);
595 pReloc.target() &= 0xFFFF0000;
596 pReloc.target() |= (G & 0xFFFF);
604 MipsRelocator::Result gothi16(Relocation& pReloc, MipsRelocator& pParent)
608 Relocator::Address G = helper_GetGOTOffset(pReloc, pParent);
609 int32_t A = pReloc.target() + pReloc.addend();
613 pReloc.target() &= 0xFFFF0000;
614 pReloc.target() |= (res & 0xFFFF);
622 MipsRelocator::Result gotlo16(Relocation& pReloc, MipsRelocator& pParent)
624 Relocator::Address G = helper_GetGOTOffset(pReloc, pParent);
626 pReloc.target() &= 0xFFFF0000;
627 pReloc.target() |= (G & 0xFFFF);
634 MipsRelocator::Result call16(Relocation& pReloc, MipsRelocator& pParent)
636 Relocator::Address G = helper_GetGOTOffset(pReloc, pParent);
638 pReloc.target() &= 0xFFFF0000;
639 pReloc.target() |= (G & 0xFFFF);
646 MipsRelocator::Result gprel32(Relocation& pReloc, MipsRelocator& pParent)
649 int32_t A = pReloc.target() + pReloc.addend();
650 int32_t S = pReloc.symValue();
655 pReloc.target() = (A + S - GP) & 0xFFFFFFFF;