From a19128992bf1151705fd77b3d13b6bc30395d546 Mon Sep 17 00:00:00 2001 From: Daniel Matichuk Date: Fri, 10 Nov 2023 17:06:44 -0800 Subject: [PATCH] fix readonly segment override to avoid dropping read permission --- base/src/Data/Macaw/Memory/ElfLoader.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/src/Data/Macaw/Memory/ElfLoader.hs b/base/src/Data/Macaw/Memory/ElfLoader.hs index 93b76f4b..9b13dc55 100644 --- a/base/src/Data/Macaw/Memory/ElfLoader.hs +++ b/base/src/Data/Macaw/Memory/ElfLoader.hs @@ -1229,7 +1229,7 @@ memoryForElfSegments'' opts regIndex addrOff elf = do ] forM_ (zip [0..] (toList phdrs)) $ \(i, p) -> do when (Elf.phdrSegmentType p == Elf.PT_LOAD && (not $ elem i ignored_segs)) $ do - let dropFlags = if elem i readonly_segs then Perm.write else Perm.none + let dropFlags = if elem i readonly_segs then Perm.write else zeroBits insertElfSegment regIndex addrOff intervals contents relocMap dropFlags p -- | Load an elf file into memory by parsing segments.