diff options
| author | Mark Rowe <mark@vector35.com> | 2025-11-17 16:37:50 -0800 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2025-11-26 00:12:34 -0800 |
| commit | 2c759a5210d9331daab78d4b159610ba1adc680b (patch) | |
| tree | d86271059ee14b2439b191565c27aca9d8c8ecc3 /view/sharedcache/core/SharedCacheView.cpp | |
| parent | b33cd4b0a3dde42f04d1de8ada563cdde8a750a2 (diff) | |
[DSC] Place synthetic sections after the cache's address range
This ensures they do not overlap with any images that may later be loaded from the shared cache.
Diffstat (limited to 'view/sharedcache/core/SharedCacheView.cpp')
| -rw-r--r-- | view/sharedcache/core/SharedCacheView.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/view/sharedcache/core/SharedCacheView.cpp b/view/sharedcache/core/SharedCacheView.cpp index 7c7a2485..a1428eab 100644 --- a/view/sharedcache/core/SharedCacheView.cpp +++ b/view/sharedcache/core/SharedCacheView.cpp @@ -109,6 +109,14 @@ Ref<Settings> SharedCacheViewType::GetLoadSettingsForData(BinaryView* data) "description" : "Add function starts sourced from the Function Starts tables to the core for analysis." })"); + // Place the synthetic sections well after the shared cache to ensure they do + // not collide with any images that are later loaded from the shared cache. + // We do not have easy access to the size of the shared cache's mapping here + // so we use a large fixed offset. + // TODO: This will have to be updated if we add support for 32-bit shared caches. + const uint64_t syntheticSectionsOffset = 12ull * 1024 * 1024 * 1024; + settings->UpdateProperty("loader.syntheticSectionBase", "default", viewRef->GetStart() + syntheticSectionsOffset); + // Merge existing load settings if they exist. This allows for the selection of a specific object file from a Mach-O // Universal file. The 'Universal' BinaryViewType generates a schema with 'loader.universal.architectures'. This // schema contains an appropriate 'Mach-O' load schema for selecting a specific object file. The embedded schema |
