Loading...
cache_builder/NewSharedCacheBuilder.cpp dyld-1245.1 dyld-1235.2
--- dyld/dyld-1245.1/cache_builder/NewSharedCacheBuilder.cpp
+++ dyld/dyld-1235.2/cache_builder/NewSharedCacheBuilder.cpp
@@ -3052,43 +3052,6 @@
                         break;
                     }
                     case cache_builder::Region::Kind::readOnly:
-                    case cache_builder::Region::Kind::linkedit:
-                    case cache_builder::Region::Kind::unmapped:
-                    case cache_builder::Region::Kind::dynamicConfig:
-                    case cache_builder::Region::Kind::codeSignature:
-                    case cache_builder::Region::Kind::numKinds:
-                        break;
-                }
-            }
-        }
-
-        // Also split the current file so that read-only are in their own files
-        {
-            // Create a new subCache
-            newSubCaches.push_back(SubCache::makeSubCache(options));
-            SubCache& newSubCache = newSubCaches.back();
-
-            // Move all data to the new subCache
-            for ( Region& oldRegion : subCache.regions ) {
-                if ( oldRegion.chunks.empty() )
-                    continue;
-
-                // Move all the data regions, leave the rest
-                switch ( oldRegion.kind ) {
-                    case cache_builder::Region::Kind::text:
-                    case cache_builder::Region::Kind::dataConst:
-                    case cache_builder::Region::Kind::tproConst:
-                    case cache_builder::Region::Kind::data:
-                    case cache_builder::Region::Kind::auth:
-                    case cache_builder::Region::Kind::authConst:
-                    case cache_builder::Region::Kind::tproAuthConst:
-                        // Nothing to do here
-                        break;
-                    case cache_builder::Region::Kind::readOnly:{
-                        Region& newRegion = newSubCache.regions[(uint32_t)oldRegion.kind];
-                        newRegion.chunks = std::move(oldRegion.chunks);
-                        break;
-                    }
                     case cache_builder::Region::Kind::linkedit:
                     case cache_builder::Region::Kind::unmapped:
                     case cache_builder::Region::Kind::dynamicConfig:
@@ -7867,6 +7830,11 @@
     // We must be a largeContiguous cache. Others were dealt with above in the x86_64 and/or sim cases
     assert(this->config.layout.contiguous.has_value());
 
+    // Some caches have a fixed max slide
+    if ( this->config.layout.cacheFixedSlide.has_value() ) {
+        return this->config.layout.cacheFixedSlide.value();
+    }
+
     // Start off making sure we can't slide past the end of the cache
     CacheVMAddress maxVMAddress(0ULL);
     for ( const Region& region : this->subCaches.back().regions ) {