Skip to content

Commit

Permalink
fix readonly segment override to avoid dropping read permission
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Dec 1, 2023
1 parent f1c911a commit ddea305
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/src/Data/Macaw/Memory/ElfLoader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,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.
Expand Down

0 comments on commit ddea305

Please sign in to comment.