]> git.saurik.com Git - apple/ld64.git/blobdiff - src/ld/passes/stubs/stubs.cpp
ld64-274.2.tar.gz
[apple/ld64.git] / src / ld / passes / stubs / stubs.cpp
index bee5f2f67c4f3f2432c4c4a8b8eb91a7525818e3..fb5b9f3b6d2d6ea51cdf60fb2f78f02e45b936dc 100644 (file)
@@ -135,8 +135,12 @@ const ld::Atom* Pass::stubableFixup(const ld::Fixup* fixup, ld::Internal& state)
                                        if ( (target->definition() == ld::Atom::definitionRegular) 
                                                && (target->combine() == ld::Atom::combineByName) 
                                                && ((target->symbolTableInclusion() == ld::Atom::symbolTableIn) 
-                                                || (target->symbolTableInclusion() == ld::Atom::symbolTableInAndNeverStrip)) )
+                                                || (target->symbolTableInclusion() == ld::Atom::symbolTableInAndNeverStrip)) ) {
+                                               // don't make stubs for auto-hide symbols
+                                               if ( target->autoHide() && (!_options.hasExportMaskList() || !_options.shouldExport(target->name())) )
+                                                       return NULL;
                                                return target;
+                                       }
                                        // create stub if target is interposable
                                        if ( _options.interposable(target->name()) ) 
                                                return target;
@@ -174,8 +178,10 @@ ld::Atom* Pass::makeStub(const ld::Atom& target, bool weakImport)
        if ( (dylib != NULL) && dylib->willBeLazyLoadedDylib() ) 
                forLazyDylib = true;
        bool stubToResolver = (target.contentType() == ld::Atom::typeResolver);
+#if SUPPORT_ARCH_arm_any || SUPPORT_ARCH_arm64
        bool usingDataConst =  _options.useDataConstSegment();
-       
+#endif
+
        if ( usingCompressedLINKEDIT() && !forLazyDylib ) {
                if ( _internal->compressedFastBinderProxy == NULL )
                        throwf("symbol dyld_stub_binder not found (normally in libSystem.dylib).  Needed to perform lazy binding to function %s", target.name());
@@ -207,7 +213,7 @@ ld::Atom* Pass::makeStub(const ld::Atom& target, bool weakImport)
                                return new ld::passes::stubs::arm::StubPICKextAtom(*this, target);
                        }
                        else if ( usingCompressedLINKEDIT() && !forLazyDylib ) {
-                               if ( (_stubCount < 900) && !_mightBeInSharedRegion && !_largeText )
+                               if ( (_stubCount < 900) && !_mightBeInSharedRegion && !_largeText && !_options.makeEncryptable() )
                                        return new ld::passes::stubs::arm::StubCloseAtom(*this, target, stubToGlobalWeakDef, stubToResolver, weakImport);
                                else if ( _pic )
                                        return new ld::passes::stubs::arm::StubPICAtom(*this, target, stubToGlobalWeakDef, stubToResolver, weakImport, usingDataConst);