]> git.saurik.com Git - apple/ld64.git/blobdiff - src/ld/passes/stubs/stub_x86_64.hpp
ld64-409.12.tar.gz
[apple/ld64.git] / src / ld / passes / stubs / stub_x86_64.hpp
index 5031dbc61f1abf3dc4ce0bbb6c935575998c7c94..5c7de1052f2f1ab1cce327a4bbcfc09d433beaa4 100644 (file)
@@ -351,12 +351,14 @@ ld::Section StubAtom::_s_section("__TEXT", "__stubs", ld::Section::typeStub);
 
 class NonLazyPointerAtom : public ld::Atom {
 public:
-                                                                                       NonLazyPointerAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo)
+       NonLazyPointerAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo,
+                                          bool weakImport)
                                : ld::Atom(_s_section, ld::Atom::definitionRegular, 
                                                        ld::Atom::combineNever, ld::Atom::scopeLinkageUnit, ld::Atom::typeNonLazyPointer, 
                                                        symbolTableNotIn, false, false, false, ld::Atom::Alignment(3)), 
                                _stubTo(stubTo),
                                _fixup1(0, ld::Fixup::k1of1, ld::Fixup::kindStoreTargetAddressLittleEndian64, &stubTo) {
+                                       _fixup1.weakImport = weakImport;
                                        pass.addAtom(*this);
                                }
 
@@ -380,14 +382,15 @@ ld::Section NonLazyPointerAtom::_s_section("__DATA", "__got", ld::Section::typeN
 
 
 
-class KextStubAtom : public ld::Atom {
+class NonLazyStubAtom : public ld::Atom {
 public:
-                                                                                       KextStubAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo)
+       NonLazyStubAtom(ld::passes::stubs::Pass& pass, const ld::Atom& stubTo,
+                                       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(1)), 
                                _stubTo(stubTo), 
-                               _nonLazyPointer(pass, stubTo),
+                               _nonLazyPointer(pass, stubTo, weakImport),
                                _fixup(2, ld::Fixup::k1of1, ld::Fixup::kindStoreTargetAddressX86PCRel32, &_nonLazyPointer) { pass.addAtom(*this); }
 
        virtual const ld::File*                                 file() const                                    { return _stubTo.file(); }
@@ -414,7 +417,7 @@ private:
        static ld::Section                                              _s_section;
 };
 
-ld::Section KextStubAtom::_s_section("__TEXT", "__stubs", ld::Section::typeStub);
+ld::Section NonLazyStubAtom::_s_section("__TEXT", "__stubs", ld::Section::typeStub);
 
 
 } // namespace x86_64