Lines Matching defs:pReloc

34 typedef Relocator::Result (*ApplyFunctionType)(Relocation& pReloc,
156 AArch64Relocator::scanLocalReloc(Relocation& pReloc, const LDSection& pSection)
159 ResolveInfo* rsym = pReloc.symInfo();
160 switch(pReloc.type()) {
171 *pReloc.targetRef().frag(),
172 pReloc.targetRef().offset(),
175 getRelRelMap().record(pReloc, reloc);
187 *pReloc.targetRef().frag(),
188 pReloc.targetRef().offset(), pReloc.type(), *this);
189 getRelRelMap().record(pReloc, reloc);
205 helper_GOT_init(pReloc, true, *this);
207 helper_GOT_init(pReloc, false, *this);
218 void AArch64Relocator::scanGlobalReloc(Relocation& pReloc,
223 ResolveInfo* rsym = pReloc.symInfo();
224 switch(pReloc.type()) {
236 helper_PLT_init(pReloc, *this);
245 if (getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
253 if (llvm::ELF::R_AARCH64_ABS64 == pReloc.type() &&
256 *pReloc.targetRef().frag(),
257 pReloc.targetRef().offset(),
260 getRelRelMap().record(pReloc, reloc);
264 *pReloc.targetRef().frag(),
265 pReloc.targetRef().offset(),
266 pReloc.type(),
268 getRelRelMap().record(pReloc, reloc);
284 helper_PLT_init(pReloc, *this);
299 getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
326 helper_PLT_init(pReloc, *this);
337 if (getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
348 helper_PLT_init(pReloc, *this);
364 helper_GOT_init(pReloc, true, *this);
366 helper_GOT_init(pReloc, false, *this);
377 void AArch64Relocator::scanRelocation(Relocation& pReloc,
383 ResolveInfo* rsym = pReloc.symInfo();
397 scanLocalReloc(pReloc, pSection);
400 scanGlobalReloc(pReloc, pBuilder, pSection);
405 issueUndefRef(pReloc, pSection, pInput);
413 Relocator::Result none(Relocation& pReloc, AArch64Relocator& pParent)
418 Relocator::Result unsupport(Relocation& pReloc, AArch64Relocator& pParent)
426 Relocator::Result abs(Relocation& pReloc, AArch64Relocator& pParent)
428 ResolveInfo* rsym = pReloc.symInfo();
429 Relocator::DWord A = pReloc.target() + pReloc.addend();
430 Relocator::DWord S = pReloc.symValue();
431 Relocation* dyn_rel = pParent.getRelRelMap().lookUp(pReloc);
434 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
438 pReloc.target() = S + A;
455 if (llvm::ELF::R_AARCH64_ABS64 == pReloc.type() &&
467 pReloc.target() = S + A;
474 Relocator::Result rel(Relocation& pReloc, AArch64Relocator& pParent)
476 ResolveInfo* rsym = pReloc.symInfo();
477 Relocator::Address S = pReloc.symValue();
478 Relocator::DWord A = pReloc.addend();
479 Relocator::DWord P = pReloc.place();
481 if (llvm::ELF::R_AARCH64_PREL64 != pReloc.type())
482 A += pReloc.target() & get_mask(pParent.getSize(pReloc.type()));
484 A += pReloc.target();
486 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
499 pReloc.target() = X;
501 if (llvm::ELF::R_AARCH64_PREL64 != pReloc.type() &&
502 helper_check_signed_overflow(X, pParent.getSize(pReloc.type())))
508 Relocator::Result add_abs_lo12(Relocation& pReloc, AArch64Relocator& pParent)
511 Relocator::Address S = pReloc.symValue();
512 Relocator::DWord A = pReloc.addend();
515 pReloc.target() = helper_reencode_add_imm(pReloc.target(), value);
523 adr_prel_pg_hi21(Relocation& pReloc, AArch64Relocator& pParent)
525 ResolveInfo* rsym = pReloc.symInfo();
526 Relocator::Address S = pReloc.symValue();
531 Relocator::DWord A = pReloc.addend();
532 Relocator::DWord P = pReloc.place() ;
536 pReloc.target() = helper_reencode_adr_imm(pReloc.target(), (X >> 12));
543 Relocator::Result call(Relocation& pReloc, AArch64Relocator& pParent)
548 if (pReloc.symInfo()->isWeak() &&
549 pReloc.symInfo()->isUndef() &&
550 !pReloc.symInfo()->isDyn() &&
551 !(pReloc.symInfo()->reserved() & AArch64Relocator::ReservePLT)) {
553 pReloc.target() = 0xd503201f;
557 Relocator::Address S = pReloc.symValue();
558 Relocator::DWord A = pReloc.addend();
559 Relocator::Address P = pReloc.place();
562 if (pReloc.symInfo()->reserved() & AArch64Relocator::ReservePLT)
563 S = helper_get_PLT_address(*pReloc.symInfo(), pParent);
568 pReloc.target() = helper_reencode_branch_offset_26(pReloc.target(), X >> 2);
574 Relocator::Result condbr(Relocation& pReloc, AArch64Relocator& pParent)
579 if (pReloc.symInfo()->isWeak() &&
580 pReloc.symInfo()->isUndef() &&
581 !pReloc.symInfo()->isDyn() &&
582 !(pReloc.symInfo()->reserved() & AArch64Relocator::ReservePLT)) {
584 pReloc.target() = 0xd503201f;
588 Relocator::Address S = pReloc.symValue();
589 Relocator::DWord A = pReloc.addend();
590 Relocator::Address P = pReloc.place();
593 if (pReloc.symInfo()->reserved() & AArch64Relocator::ReservePLT)
594 S = helper_get_PLT_address(*pReloc.symInfo(), pParent);
599 pReloc.target() = helper_reencode_cond_branch_ofs_19(pReloc.target(), X >> 2);
605 Relocator::Result adr_got_page(Relocation& pReloc, AArch64Relocator& pParent)
607 if (!(pReloc.symInfo()->reserved() & AArch64Relocator::ReserveGOT)) {
611 Relocator::Address GOT_S = helper_get_GOT_address(*pReloc.symInfo(), pParent);
612 Relocator::DWord A = pReloc.addend();
613 Relocator::Address P = pReloc.place();
617 pReloc.target() = helper_reencode_adr_imm(pReloc.target(), (X >> 12));
620 AArch64GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
622 got_entry->setValue(pReloc.symValue());
624 Relocation* dyn_rela = pParent.getRelRelMap().lookUp(pReloc);
626 dyn_rela->setAddend(pReloc.symValue());
632 Relocator::Result ld64_got_lo12(Relocation& pReloc, AArch64Relocator& pParent)
634 if (!(pReloc.symInfo()->reserved() & AArch64Relocator::ReserveGOT)) {
638 Relocator::Address GOT_S = helper_get_GOT_address(*pReloc.symInfo(), pParent);
639 Relocator::DWord A = pReloc.addend();
642 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(), (X >> 3));
645 AArch64GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
647 got_entry->setValue(pReloc.symValue());
650 Relocation* dyn_rela = pParent.getRelRelMap().lookUp(pReloc);
652 dyn_rela->setAddend(pReloc.symValue());
663 Relocator::Result ldst_abs_lo12(Relocation& pReloc, AArch64Relocator& pParent)
665 Relocator::Address S = pReloc.symValue();
666 Relocator::DWord A = pReloc.addend();
669 switch(pReloc.type()) {
671 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(), X);
674 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(),
678 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(),
682 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(),
686 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(),