Example #1
0
 LazyPointerAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo,
                 bool forLazyDylib, bool for64, bool weakImport)
     : ld::Atom( forLazyDylib ? _s_sectionLazy : _s_section,
                 ld::Atom::definitionRegular, ld::Atom::combineNever,
                 ld::Atom::scopeTranslationUnit,
                 forLazyDylib ? ld::Atom::typeLazyDylibPointer : ld::Atom::typeLazyPointer,
                 symbolTableNotIn, false, false, false, for64 ? ld::Atom::Alignment(3) : ld::Atom::Alignment(2)),
       _stubTo(stubTo),
       _fixup1(0, ld::Fixup::k1of1,
               for64 ? ld::Fixup::kindStoreTargetAddressBigEndian64 : ld::Fixup::kindStoreTargetAddressBigEndian32,
               forLazyDylib ? pass.internal()->lazyBindingHelper : pass.internal()->classicBindingHelper),
       _fixup2(0, ld::Fixup::k1of1, ld::Fixup::kindLazyTarget, &stubTo),
       _for64(for64)
 {
     _fixup2.weakImport = weakImport;
     pass.addAtom(*this);
 }
Example #2
0
											StubCloseAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo,
														bool stubToGlobalWeakDef, bool stubToResolver, bool weakImport)
				: ld::Atom(_s_section, ld::Atom::definitionRegular, ld::Atom::combineNever,
							ld::Atom::scopeLinkageUnit, ld::Atom::typeStub, 
							symbolTableNotIn, false, false, false, ld::Atom::Alignment(2)), 
				_stubTo(stubTo), 
				_lazyPointer(pass, stubTo, stubToGlobalWeakDef, stubToResolver, weakImport, true),
				_fixup(0, ld::Fixup::k1of1, ld::Fixup::kindStoreTargetAddressARMLoad12, &_lazyPointer) 
				{ pass.addAtom(*this); }
Example #3
0
											LazyPointerAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo,
															bool stubToGlobalWeakDef, bool stubToResolver, 
															bool weakImport, bool close)
				: ld::Atom(close ? _s_sectionClose : _s_section, ld::Atom::definitionRegular, 
							ld::Atom::combineNever, ld::Atom::scopeLinkageUnit, ld::Atom::typeLazyPointer, 
							symbolTableNotIn, false, false, false, ld::Atom::Alignment(2)), 
				_stubTo(stubTo),
				_helper(pass, stubTo, this),
				_resolverHelper(pass, stubTo, this),
				_fixup1(0, ld::Fixup::k1of1, ld::Fixup::kindStoreTargetAddressLittleEndian32, 
								stubToResolver ? &_resolverHelper : (stubToGlobalWeakDef ?  &stubTo : &_helper)),
				_fixup2(0, ld::Fixup::k1of1, ld::Fixup::kindLazyTarget, &stubTo) { 
						_fixup2.weakImport = weakImport; pass.addAtom(*this); 
						if ( stubToResolver )
							pass.addAtom(_resolverHelper);
						else if ( !stubToGlobalWeakDef ) 
							pass.addAtom(_helper); 
					}
Example #4
0
											StubPICAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo,
														bool stubToGlobalWeakDef, bool stubToResolver, bool weakImport)
				: ld::Atom(_s_section, ld::Atom::definitionRegular, ld::Atom::combineNever,
							ld::Atom::scopeLinkageUnit, ld::Atom::typeStub, 
							symbolTableNotIn, false, false, false, ld::Atom::Alignment(2)), 
				_stubTo(stubTo), 
				_lazyPointer(pass, stubTo, stubToGlobalWeakDef, stubToResolver, weakImport, false),
				_fixup1(12, ld::Fixup::k1of4, ld::Fixup::kindSetTargetAddress, &_lazyPointer),
				_fixup2(12, ld::Fixup::k2of4, ld::Fixup::kindSubtractTargetAddress, this),
				_fixup3(12, ld::Fixup::k3of4, ld::Fixup::kindSubtractAddend, 12),
				_fixup4(12, ld::Fixup::k4of4, ld::Fixup::kindStoreLittleEndian32) 
				{ pass.addAtom(*this); }
Example #5
0
											StubHelperHelperAtom(ld::passes::stubs::Pass& pass)
				: ld::Atom(_s_section, ld::Atom::definitionRegular, ld::Atom::combineNever,
							ld::Atom::scopeLinkageUnit, ld::Atom::typeStubHelper, 
							ld::Atom::symbolTableIn, false, false, false, ld::Atom::Alignment(2)), 
				_fixup1(28, ld::Fixup::k1of4, ld::Fixup::kindSetTargetAddress, compressedImageCache(pass)),
				_fixup2(28, ld::Fixup::k2of4, ld::Fixup::kindSubtractTargetAddress, this),
				_fixup3(28, ld::Fixup::k3of4, ld::Fixup::kindSubtractAddend, 16),
				_fixup4(28, ld::Fixup::k4of4, ld::Fixup::kindStoreLittleEndian32),
				_fixup5(32, ld::Fixup::k1of4, ld::Fixup::kindSetTargetAddress, compressedFastBinder(pass)),
				_fixup6(32, ld::Fixup::k2of4, ld::Fixup::kindSubtractTargetAddress, this),
				_fixup7(32, ld::Fixup::k3of4, ld::Fixup::kindSubtractAddend, 28),
				_fixup8(32, ld::Fixup::k4of4, ld::Fixup::kindStoreLittleEndian32) 
					{ pass.addAtom(*this); }
Example #6
0
 StubNoPICAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo,
               bool forLazyDylib, bool for64, bool weakImport)
     : ld::Atom(_s_section, ld::Atom::definitionRegular, ld::Atom::combineNever,
                ld::Atom::scopeLinkageUnit, ld::Atom::typeStub,
                symbolTableNotIn, false, false, false, ld::Atom::Alignment(2)),
       _stubTo(stubTo),
       _lazyPointer(pass, stubTo, forLazyDylib, for64, weakImport),
       _fixup1(0, ld::Fixup::k1of2, ld::Fixup::kindSetTargetAddress, &_lazyPointer),
       _fixup2(0, ld::Fixup::k2of2, ld::Fixup::kindStorePPCAbsHigh16AddLow),
       _fixup3(4, ld::Fixup::k1of2, ld::Fixup::kindSetTargetAddress, &_lazyPointer),
       _fixup4(4, ld::Fixup::k2of2, for64 ? ld::Fixup::kindStorePPCAbsLow14 : ld::Fixup::kindStorePPCAbsLow16),
       _for64(for64)
 {
     pass.addAtom(*this);
 }
Example #7
0
											ImageCachePointerAtom(ld::passes::stubs::Pass& pass)
				: ld::Atom(_s_section, ld::Atom::definitionRegular, ld::Atom::combineNever,
							ld::Atom::scopeLinkageUnit, ld::Atom::typeNonLazyPointer, 
							symbolTableNotIn, false, false, false, ld::Atom::Alignment(2)) { pass.addAtom(*this); }
Example #8
0
											FastBindingPointerAtom(ld::passes::stubs::Pass& pass)
				: ld::Atom(_s_section, ld::Atom::definitionRegular, ld::Atom::combineNever,
							ld::Atom::scopeLinkageUnit, ld::Atom::typeNonLazyPointer, 
							symbolTableNotIn, false, false, false, ld::Atom::Alignment(2)), 
				_fixup(0, ld::Fixup::k1of1, ld::Fixup::kindStoreTargetAddressLittleEndian32, pass.internal()->compressedFastBinderProxy)
					{ pass.addAtom(*this); }