Lines Matching refs:pReloc

34 typedef Relocator::Result (*ApplyFunctionType)(Relocation& pReloc,
151 void AArch64Relocator::scanLocalReloc(Relocation& pReloc,
154 ResolveInfo* rsym = pReloc.symInfo();
155 switch (pReloc.type()) {
166 *pReloc.targetRef().frag(),
167 pReloc.targetRef().offset(),
170 getRelRelMap().record(pReloc, reloc);
182 *pReloc.targetRef().frag(),
183 pReloc.targetRef().offset(),
184 pReloc.type(),
186 getRelRelMap().record(pReloc, reloc);
202 helper_GOT_init(pReloc, true, *this);
204 helper_GOT_init(pReloc, false, *this);
215 void AArch64Relocator::scanGlobalReloc(Relocation& pReloc,
219 ResolveInfo* rsym = pReloc.symInfo();
220 switch (pReloc.type()) {
232 helper_PLT_init(pReloc, *this);
242 if (getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
249 if (llvm::ELF::R_AARCH64_ABS64 == pReloc.type() &&
253 *pReloc.targetRef().frag(),
254 pReloc.targetRef().offset(),
257 getRelRelMap().record(pReloc, reloc);
260 *pReloc.targetRef().frag(),
261 pReloc.targetRef().offset(),
262 pReloc.type(),
264 getRelRelMap().record(pReloc, reloc);
280 helper_PLT_init(pReloc, *this);
295 getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
322 helper_PLT_init(pReloc, *this);
334 if (getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
345 helper_PLT_init(pReloc, *this);
361 helper_GOT_init(pReloc, true, *this);
363 helper_GOT_init(pReloc, false, *this);
374 void AArch64Relocator::scanRelocation(Relocation& pReloc,
379 ResolveInfo* rsym = pReloc.symInfo();
393 scanLocalReloc(pReloc, pSection);
396 scanGlobalReloc(pReloc, pBuilder, pSection);
401 issueUndefRef(pReloc, pSection, pInput);
405 AArch64Relocator::mayHaveFunctionPointerAccess(const Relocation& pReloc) const {
406 switch (pReloc.type()) {
415 if (pReloc.symInfo()->isLocal()) {
422 (pReloc.symInfo()->visibility() != ResolveInfo::Default));
429 uint32_t AArch64Relocator::getDebugStringOffset(Relocation& pReloc) const {
430 if (pReloc.type() != llvm::ELF::R_AARCH64_ABS32)
432 << getName(pReloc.type()) << "mclinker@googlegroups.com";
434 if (pReloc.symInfo()->type() == ResolveInfo::Section)
435 return pReloc.target() + pReloc.addend();
437 return pReloc.symInfo()->outSymbol()->fragRef()->offset() +
438 pReloc.target() + pReloc.addend();
441 void AArch64Relocator::applyDebugStringOffset(Relocation& pReloc,
443 pReloc.target() = pOffset;
451 Relocator::Result none(Relocation& pReloc, AArch64Relocator& pParent) {
455 Relocator::Result unsupported(Relocation& pReloc, AArch64Relocator& pParent) {
462 Relocator::Result abs(Relocation& pReloc, AArch64Relocator& pParent) {
463 ResolveInfo* rsym = pReloc.symInfo();
464 Relocator::DWord A = pReloc.target() + pReloc.addend();
465 Relocator::DWord S = pReloc.symValue();
466 Relocation* dyn_rel = pParent.getRelRelMap().lookUp(pReloc);
469 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
473 pReloc.target() = S + A;
490 if (llvm::ELF::R_AARCH64_ABS64 == pReloc.type() &&
501 pReloc.target() = S + A;
508 Relocator::Result rel(Relocation& pReloc, AArch64Relocator& pParent) {
509 ResolveInfo* rsym = pReloc.symInfo();
510 Relocator::Address S = pReloc.symValue();
511 Relocator::DWord A = pReloc.addend();
512 Relocator::DWord P = pReloc.place();
514 if (llvm::ELF::R_AARCH64_PREL64 != pReloc.type())
515 A += pReloc.target() & get_mask(pParent.getSize(pReloc.type()));
517 A += pReloc.target();
519 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
532 pReloc.target() = X;
534 if (llvm::ELF::R_AARCH64_PREL64 != pReloc.type() &&
535 helper_check_signed_overflow(X, pParent.getSize(pReloc.type())))
541 Relocator::Result add_abs_lo12(Relocation& pReloc, AArch64Relocator& pParent) {
543 Relocator::Address S = pReloc.symValue();
544 Relocator::DWord A = pReloc.addend();
547 pReloc.target() = helper_reencode_add_imm(pReloc.target(), value);
553 Relocator::Result adr_prel_lo21(Relocation& pReloc, AArch64Relocator& pParent) {
554 ResolveInfo* rsym = pReloc.symInfo();
555 Relocator::Address S = pReloc.symValue();
560 Relocator::DWord A = pReloc.addend();
561 Relocator::DWord P = pReloc.place();
564 pReloc.target() = helper_reencode_adr_imm(pReloc.target(), X);
571 Relocator::Result adr_prel_pg_hi21(Relocation& pReloc,
573 ResolveInfo* rsym = pReloc.symInfo();
574 Relocator::Address S = pReloc.symValue();
579 Relocator::DWord A = pReloc.addend();
580 Relocator::DWord P = pReloc.place();
584 pReloc.target() = helper_reencode_adr_imm(pReloc.target(), (X >> 12));
591 Relocator::Result call(Relocation& pReloc, AArch64Relocator& pParent) {
595 if (pReloc.symInfo()->isWeak() && pReloc.symInfo()->isUndef() &&
596 !pReloc.symInfo()->isDyn() &&
597 !(pReloc.symInfo()->reserved() & AArch64Relocator::ReservePLT)) {
599 pReloc.target() = 0xd503201f;
603 Relocator::Address S = pReloc.symValue();
604 Relocator::DWord A = pReloc.addend();
605 Relocator::Address P = pReloc.place();
608 if (pReloc.symInfo()->reserved() & AArch64Relocator::ReservePLT)
609 S = helper_get_PLT_address(*pReloc.symInfo(), pParent);
614 pReloc.target() = helper_reencode_branch_offset_26(pReloc.target(), X >> 2);
620 Relocator::Result condbr(Relocation& pReloc, AArch64Relocator& pParent) {
624 if (pReloc.symInfo()->isWeak() && pReloc.symInfo()->isUndef() &&
625 !pReloc.symInfo()->isDyn() &&
626 !(pReloc.symInfo()->reserved() & AArch64Relocator::ReservePLT)) {
628 pReloc.target() = 0xd503201f;
632 Relocator::Address S = pReloc.symValue();
633 Relocator::DWord A = pReloc.addend();
634 Relocator::Address P = pReloc.place();
637 if (pReloc.symInfo()->reserved() & AArch64Relocator::ReservePLT)
638 S = helper_get_PLT_address(*pReloc.symInfo(), pParent);
643 pReloc.target() = helper_reencode_cond_branch_ofs_19(pReloc.target(), X >> 2);
649 Relocator::Result adr_got_page(Relocation& pReloc, AArch64Relocator& pParent) {
650 if (!(pReloc.symInfo()->reserved() & AArch64Relocator::ReserveGOT)) {
654 Relocator::Address GOT_S = helper_get_GOT_address(*pReloc.symInfo(), pParent);
655 Relocator::DWord A = pReloc.addend();
656 Relocator::Address P = pReloc.place();
660 pReloc.target() = helper_reencode_adr_imm(pReloc.target(), (X >> 12));
663 AArch64GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
665 got_entry->setValue(pReloc.symValue());
667 Relocation* dyn_rela = pParent.getRelRelMap().lookUp(pReloc);
669 dyn_rela->setAddend(pReloc.symValue());
675 Relocator::Result ld64_got_lo12(Relocation& pReloc, AArch64Relocator& pParent) {
676 if (!(pReloc.symInfo()->reserved() & AArch64Relocator::ReserveGOT)) {
680 Relocator::Address GOT_S = helper_get_GOT_address(*pReloc.symInfo(), pParent);
681 Relocator::DWord A = pReloc.addend();
684 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(), (X >> 3));
687 AArch64GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
689 got_entry->setValue(pReloc.symValue());
692 Relocation* dyn_rela = pParent.getRelRelMap().lookUp(pReloc);
694 dyn_rela->setAddend(pReloc.symValue());
705 Relocator::Result ldst_abs_lo12(Relocation& pReloc, AArch64Relocator& pParent) {
706 Relocator::Address S = pReloc.symValue();
707 Relocator::DWord A = pReloc.addend();
710 switch (pReloc.type()) {
712 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(), X);
715 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(), (X >> 1));
718 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(), (X >> 2));
721 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(), (X >> 3));
724 pReloc.target() = helper_reencode_ldst_pos_imm(pReloc.target(), (X >> 4));