Skip to content

Commit

Permalink
elf: Add PF_MASKOS and PF_MASKPROC (#281)
Browse files Browse the repository at this point in the history
These masks indicate program header flag bits that are reserved for OS
and processor specific usage. See the ELF specification for details.

Signed-off-by: Nathaniel McCallum <nathaniel@congru.us>
  • Loading branch information
npmccallum committed Sep 5, 2021
1 parent b43b93e commit cd22783
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/elf/program_header.rs
Expand Up @@ -51,6 +51,10 @@ pub const PF_X: u32 = 1;
pub const PF_W: u32 = 1 << 1;
/// Segment is readable
pub const PF_R: u32 = 1 << 2;
/// Bits reserved for OS-specific usage
pub const PF_MASKOS: u32 = 0x0ff0_0000;
/// Bits reserved for processor-specific usage
pub const PF_MASKPROC: u32 = 0xf000_0000;

pub fn pt_to_str(pt: u32) -> &'static str {
match pt {
Expand Down

0 comments on commit cd22783

Please sign in to comment.