Skip to content

Commit

Permalink
read: include Mach-O segment flags in SegmentFlags (gimli-rs#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc authored Jan 9, 2022
1 parent 88e1789 commit f0cb285
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ pub enum SegmentFlags {
},
/// Mach-O segment flags.
MachO {
/// `flags` field in the segment header.
flags: u32,
/// `maxprot` field in the segment header.
maxprot: u32,
/// `initprot` field in the segment header.
Expand Down
7 changes: 6 additions & 1 deletion src/read/macho/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,14 @@ where

#[inline]
fn flags(&self) -> SegmentFlags {
let flags = self.internal.segment.flags(self.file.endian);
let maxprot = self.internal.segment.maxprot(self.file.endian);
let initprot = self.internal.segment.initprot(self.file.endian);
SegmentFlags::MachO { maxprot, initprot }
SegmentFlags::MachO {
flags,
maxprot,
initprot,
}
}
}

Expand Down

0 comments on commit f0cb285

Please sign in to comment.