From 397b5693c4b354349ade15eab09baa5dde744f1c Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 21 May 2025 17:22:32 +0200 Subject: [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. --- view/sharedcache/workflow/SharedCacheWorkflow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/sharedcache/workflow/SharedCacheWorkflow.cpp') 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 func, Ref 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(SegmentReadable | SegmentContainsData); + region->flags = static_cast(SegmentReadable | SegmentContainsData | SegmentDenyWrite); return controller.ApplyRegion(*view, *region); }; @@ -252,7 +252,7 @@ void AnalyzeStandardFunction(Ref func, Ref 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(SegmentReadable | SegmentContainsData); + region->flags = static_cast(SegmentReadable | SegmentContainsData | SegmentDenyWrite); return controller.ApplyRegion(*view, *region); }; -- cgit v1.3.1