summaryrefslogtreecommitdiff
path: root/view/sharedcache/workflow/SharedCacheWorkflow.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-21 17:22:32 +0200
committerMason Reed <mason@vector35.com>2025-05-21 17:22:32 +0200
commit397b5693c4b354349ade15eab09baa5dde744f1c (patch)
tree8444eefeb8c2d606e7dfea5255348e95e556198c /view/sharedcache/workflow/SharedCacheWorkflow.cpp
parentf441eb7762fc6aeba3334e3c9d41a6812ab3ad67 (diff)
[SharedCache] Fix .dylddata sections failing to propagate constants
This occurred because prior to the change made in build `7484` we short-circuited when the pointer pointed to a read only segment, now that we consult the section the sections semantics were incorrect and failed, this fixes the dyld data sections to have correct semantics.
Diffstat (limited to 'view/sharedcache/workflow/SharedCacheWorkflow.cpp')
-rw-r--r--view/sharedcache/workflow/SharedCacheWorkflow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/view/sharedcache/workflow/SharedCacheWorkflow.cpp b/view/sharedcache/workflow/SharedCacheWorkflow.cpp
index 71160e44..cde8310c 100644
--- a/view/sharedcache/workflow/SharedCacheWorkflow.cpp
+++ b/view/sharedcache/workflow/SharedCacheWorkflow.cpp
@@ -128,7 +128,7 @@ void AnalyzeStubFunction(Ref<Function> func, Ref<MediumLevelILFunction> mlil, Sh
// Adjust the new region semantics to read only, this helps analysis pickup constant loads in our stub functions.
// NOTE: We do NOT do this for stub island as that contains CODE!
if (region->type != SharedCacheRegionTypeStubIsland)
- region->flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentContainsData);
+ region->flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentContainsData | SegmentDenyWrite);
return controller.ApplyRegion(*view, *region);
};
@@ -252,7 +252,7 @@ void AnalyzeStandardFunction(Ref<Function> func, Ref<MediumLevelILFunction> mlil
// Adjust the new region semantics to read only, this helps analysis pickup constant loads in our stub functions.
// NOTE: We do NOT do this for stub island as that contains CODE!
if (region->type != SharedCacheRegionTypeStubIsland)
- region->flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentContainsData);
+ region->flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentContainsData | SegmentDenyWrite);
return controller.ApplyRegion(*view, *region);
};