From cd227830a42f96dc5ca12079f3c3ee72b1f209c2 Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Sun, 5 Sep 2021 01:18:08 -0400 Subject: [PATCH] elf: Add PF_MASKOS and PF_MASKPROC (#281) 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 --- src/elf/program_header.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/elf/program_header.rs b/src/elf/program_header.rs index 1fd8a277..328847a9 100644 --- a/src/elf/program_header.rs +++ b/src/elf/program_header.rs @@ -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 {