Lines Matching defs:pReloc

66 X86_32GOTEntry& helper_GOT_init(Relocation& pReloc,
71 ResolveInfo* rsym = pReloc.symInfo();
105 Relocator::Address helper_get_GOT_address(Relocation& pReloc,
108 X86_32GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
114 PLTEntryBase& helper_PLT_init(Relocation& pReloc, X86_32Relocator& pParent)
117 ResolveInfo* rsym = pReloc.symInfo();
152 typedef Relocator::Result (*X86_32ApplyFunctionType)(Relocation& pReloc,
180 void X86Relocator::scanRelocation(Relocation& pReloc,
189 ResolveInfo* rsym = pReloc.symInfo();
200 scanLocalReloc(pReloc, pLinker, pModule, pSection);
202 scanGlobalReloc(pReloc, pLinker, pModule, pSection);
207 issueUndefRef(pReloc, pSection, pInput);
327 X86_32Relocator::mayHaveFunctionPointerAccess(const Relocation& pReloc) const
329 switch (pReloc.type()) {
343 void X86_32Relocator::scanLocalReloc(Relocation& pReloc,
349 ResolveInfo* rsym = pReloc.symInfo();
351 switch(pReloc.type()){
363 *pReloc.targetRef().frag(),
364 pReloc.targetRef().offset(),
377 helper_DynRel_init(rsym, *pReloc.targetRef().frag(),
378 pReloc.targetRef().offset(), pReloc.type(), *this);
406 helper_GOT_init(pReloc, true, *this);
414 helper_GOT_init(pReloc, false, *this);
481 helper_DynRel_init(rsym, *pReloc.targetRef().frag(),
482 pReloc.targetRef().offset(),
489 convertTLSIEtoLE(pReloc, pSection);
531 *pReloc.targetRef().frag(),
532 pReloc.targetRef().offset(),
545 fatal(diag::unsupported_relocation) << (int)pReloc.type()
551 void X86_32Relocator::scanGlobalReloc(Relocation& pReloc,
557 ResolveInfo* rsym = pReloc.symInfo();
559 switch(pReloc.type()) {
571 helper_PLT_init(pReloc, *this);
580 if (getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
588 if (llvm::ELF::R_386_32 == pReloc.type() &&
591 *pReloc.targetRef().frag(),
592 pReloc.targetRef().offset(),
597 *pReloc.targetRef().frag(),
598 pReloc.targetRef().offset(),
599 pReloc.type(),
631 helper_PLT_init(pReloc, *this);
646 helper_GOT_init(pReloc, true, *this);
648 helper_GOT_init(pReloc, false, *this);
665 helper_PLT_init(pReloc, *this);
673 if (getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
682 if (llvm::ELF::R_386_32 == pReloc.type() &&
685 *pReloc.targetRef().frag(),
686 pReloc.targetRef().offset(),
691 *pReloc.targetRef().frag(),
692 pReloc.targetRef().offset(),
693 pReloc.type(),
734 helper_DynRel_init(rsym, *pReloc.targetRef().frag(),
735 pReloc.targetRef().offset(),
742 convertTLSIEtoLE(pReloc, pSection);
781 *pReloc.targetRef().frag(),
782 pReloc.targetRef().offset(),
792 fatal(diag::unsupported_relocation) << (int)pReloc.type()
816 void X86_32Relocator::convertTLSIEtoLE(Relocation& pReloc,
819 assert(pReloc.type() == llvm::ELF::R_386_TLS_IE);
820 assert(NULL != pReloc.targetRef().frag());
825 *FragmentRef::Create(*pReloc.targetRef().frag(),
826 pReloc.targetRef().offset() - 1),
829 reloc->setSymInfo(pReloc.symInfo());
838 *FragmentRef::Create(*pReloc.targetRef().frag(),
839 pReloc.targetRef().offset() - 2),
841 reloc->setSymInfo(pReloc.symInfo());
863 RelocData::iterator(pReloc), reloc);
866 pReloc.setType(llvm::ELF::R_386_TLS_LE);
874 Relocator::Result none(Relocation& pReloc, X86_32Relocator& pParent)
882 Relocator::Result abs(Relocation& pReloc, X86_32Relocator& pParent)
884 ResolveInfo* rsym = pReloc.symInfo();
885 Relocator::DWord A = pReloc.target() + pReloc.addend();
886 Relocator::DWord S = pReloc.symValue();
893 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
897 pReloc.target() = S + A;
910 if (llvm::ELF::R_386_32 != pReloc.type() ||
916 pReloc.target() = S + A;
923 Relocator::Result rel(Relocation& pReloc, X86_32Relocator& pParent)
925 ResolveInfo* rsym = pReloc.symInfo();
926 Relocator::DWord A = pReloc.target() + pReloc.addend();
927 Relocator::DWord S = pReloc.symValue();
928 Relocator::DWord P = pReloc.place();
934 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
938 pReloc.target() = S + A - P;
946 pReloc.target() = S + A - P;
954 pReloc.target() = S + A - P;
959 Relocator::Result gotoff32(Relocation& pReloc, X86_32Relocator& pParent)
961 Relocator::DWord A = pReloc.target() + pReloc.addend();
963 Relocator::Address S = pReloc.symValue();
965 pReloc.target() = S + A - GOT_ORG;
970 Relocator::Result gotpc32(Relocation& pReloc, X86_32Relocator& pParent)
972 Relocator::DWord A = pReloc.target() + pReloc.addend();
975 pReloc.target() = GOT_ORG + A - pReloc.place();
980 Relocator::Result got32(Relocation& pReloc, X86_32Relocator& pParent)
982 ResolveInfo* rsym = pReloc.symInfo();
988 X86_32GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
991 got_entry->setValue(pReloc.symValue());
993 Relocator::Address GOT_S = helper_get_GOT_address(pReloc, pParent);
994 Relocator::DWord A = pReloc.target() + pReloc.addend();
997 pReloc.target() = GOT_S + A - GOT_ORG;
1002 Relocator::Result plt32(Relocation& pReloc, X86_32Relocator& pParent)
1006 if ((pReloc.symInfo()->reserved() & X86Relocator::ReservePLT))
1007 PLT_S = helper_get_PLT_address(*pReloc.symInfo(), pParent);
1009 PLT_S = pReloc.symValue();
1010 Relocator::DWord A = pReloc.target() + pReloc.addend();
1011 Relocator::Address P = pReloc.place();
1012 pReloc.target() = PLT_S + A - P;
1017 Relocator::Result tls_gd(Relocation& pReloc, X86_32Relocator& pParent)
1020 ResolveInfo* rsym = pReloc.symInfo();
1034 pParent.getSymGOTMap().lookUpSecondEntry(*rsym)->setValue(pReloc.symValue());
1037 Relocator::DWord A = pReloc.target() + pReloc.addend();
1044 pReloc.target() = GOT_OFF + A;
1049 Relocator::Result tls_ldm(Relocation& pReloc, X86_32Relocator& pParent)
1058 Relocator::DWord A = pReloc.target() + pReloc.addend();
1059 pReloc.target() = GOT_S + A;
1065 Relocator::Result tls_ldo_32(Relocation& pReloc, X86_32Relocator& pParent)
1068 Relocator::DWord A = pReloc.target() + pReloc.addend();
1069 Relocator::Address S = pReloc.symValue();
1070 pReloc.target() = S + A;
1075 Relocator::Result tls_ie(Relocation& pReloc, X86_32Relocator& pParent)
1077 ResolveInfo* rsym = pReloc.symInfo();
1089 Relocator::DWord A = pReloc.target() + pReloc.addend();
1090 pReloc.target() = GOT_S + A;
1096 Relocator::Result tls_gotie(Relocation& pReloc, X86_32Relocator& pParent)
1098 ResolveInfo* rsym = pReloc.symInfo();
1110 Relocator::DWord A = pReloc.target() + pReloc.addend();
1111 pReloc.target() = GOT_S + A;
1117 Relocator::Result tls_le(Relocation& pReloc, X86_32Relocator& pParent)
1119 if (pReloc.symInfo()->reserved() & X86Relocator::ReserveRel)
1129 Relocator::DWord A = pReloc.target() + pReloc.addend();
1130 Relocator::Address S = pReloc.symValue();
1131 pReloc.target() = S + A - (*tls_seg)->memsz();
1135 Relocator::Result unsupport(Relocation& pReloc, X86_32Relocator& pParent)
1180 X86_64GOTEntry& helper_GOT_init(Relocation& pReloc,
1185 ResolveInfo* rsym = pReloc.symInfo();
1203 pParent.getRelRelMap().record(pReloc, rel_entry);
1221 Relocator::Address helper_get_GOT_address(Relocation& pReloc,
1224 X86_64GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
1239 PLTEntryBase& helper_PLT_init(Relocation& pReloc, X86_64Relocator& pParent)
1242 ResolveInfo* rsym = pReloc.symInfo();
1269 typedef Relocator::Result (*X86_64ApplyFunctionType)(Relocation& pReloc,
1318 X86_64Relocator::mayHaveFunctionPointerAccess(const Relocation& pReloc) const
1321 switch (pReloc.type()) {
1341 if (pReloc.symInfo()->isGlobal()) {
1343 ((pReloc.symInfo()->visibility() != ResolveInfo::Default) ||
1351 void X86_64Relocator::scanLocalReloc(Relocation& pReloc,
1357 ResolveInfo* rsym = pReloc.symInfo();
1359 switch(pReloc.type()){
1366 *pReloc.targetRef().frag(),
1367 pReloc.targetRef().offset(),
1370 getRelRelMap().record(pReloc, reloc);
1386 *pReloc.targetRef().frag(),
1387 pReloc.targetRef().offset(),
1388 pReloc.type(),
1390 getRelRelMap().record(pReloc, reloc);
1413 helper_GOT_init(pReloc, true, *this);
1415 helper_GOT_init(pReloc, false, *this);
1420 fatal(diag::unsupported_relocation) << (int)pReloc.type()
1426 void X86_64Relocator::scanGlobalReloc(Relocation& pReloc,
1432 ResolveInfo* rsym = pReloc.symInfo();
1434 switch(pReloc.type()) {
1448 helper_PLT_init(pReloc, *this);
1457 if (getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
1465 if (llvm::ELF::R_386_32 == pReloc.type() &&
1468 *pReloc.targetRef().frag(),
1469 pReloc.targetRef().offset(),
1472 getRelRelMap().record(pReloc, reloc);
1476 *pReloc.targetRef().frag(),
1477 pReloc.targetRef().offset(),
1478 pReloc.type(),
1480 getRelRelMap().record(pReloc, reloc);
1498 helper_GOT_init(pReloc, true, *this);
1500 helper_GOT_init(pReloc, false, *this);
1526 helper_PLT_init(pReloc, *this);
1541 helper_PLT_init(pReloc, *this);
1556 getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
1563 fatal(diag::unsupported_relocation) << (int)pReloc.type()
1573 Relocator::Result none(Relocation& pReloc, X86_64Relocator& pParent)
1582 Relocator::Result abs(Relocation& pReloc, X86_64Relocator& pParent)
1584 ResolveInfo* rsym = pReloc.symInfo();
1585 Relocator::DWord A = pReloc.target() + pReloc.addend();
1586 Relocator::DWord S = pReloc.symValue();
1587 Relocation* dyn_rel = pParent.getRelRelMap().lookUp(pReloc);
1590 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
1594 pReloc.target() = S + A;
1613 if (llvm::ELF::R_X86_64_64 == pReloc.type() &&
1625 pReloc.target() = S + A;
1630 Relocator::Result signed32(Relocation& pReloc, X86_64Relocator& pParent)
1632 ResolveInfo* rsym = pReloc.symInfo();
1633 Relocator::DWord A = pReloc.target() + pReloc.addend();
1634 Relocator::DWord S = pReloc.symValue();
1637 if (NULL != pParent.getRelRelMap().lookUp(pReloc))
1640 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
1656 pReloc.target() = S + A;
1661 Relocator::Result gotpcrel(Relocation& pReloc, X86_64Relocator& pParent)
1663 if (!(pReloc.symInfo()->reserved() & X86Relocator::ReserveGOT)) {
1668 X86_64GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
1670 got_entry->setValue(pReloc.symValue());
1673 Relocation* dyn_rel = pParent.getRelRelMap().lookUp(pReloc);
1675 dyn_rel->setAddend(pReloc.symValue());
1678 Relocator::Address GOT_S = helper_get_GOT_address(pReloc, pParent);
1679 Relocator::DWord A = pReloc.target() + pReloc.addend();
1682 pReloc.target() = GOT_S + GOT_ORG + A - pReloc.place();
1687 Relocator::Result plt32(Relocation& pReloc, X86_64Relocator& pParent)
1691 if ((pReloc.symInfo()->reserved() & X86Relocator::ReservePLT))
1692 PLT_S = helper_get_PLT_address(*pReloc.symInfo(), pParent);
1694 PLT_S = pReloc.symValue();
1695 Relocator::DWord A = pReloc.target() + pReloc.addend();
1696 Relocator::Address P = pReloc.place();
1697 pReloc.target() = PLT_S + A - P;
1704 Relocator::Result rel(Relocation& pReloc, X86_64Relocator& pParent)
1706 ResolveInfo* rsym = pReloc.symInfo();
1707 Relocator::DWord A = pReloc.target() + pReloc.addend();
1708 Relocator::DWord S = pReloc.symValue();
1709 Relocator::DWord P = pReloc.place();
1711 LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
1715 pReloc.target() = S + A - P;
1720 Relocation* dyn_rel = pParent.getRelRelMap().lookUp(pReloc);
1739 pReloc.target() = S + A - P;
1743 Relocator::Result unsupport(Relocation& pReloc, X86_64Relocator& pParent)