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 Nov 11, 2023
1 parent b7f10fc commit a191289
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 @@ -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.
Expand Down

0 comments on commit a191289

Please sign in to comment.