Skip to content

Commit 17de706

Browse files
committed
Add various constants from OpenBSD's sys/exec_elf.h.
This mirrors more of the constants that, for example, are available in linux/mod.rs.
1 parent 0644a87 commit 17de706

File tree

1 file changed

+24
-0
lines changed
  • src/unix/bsd/netbsdlike/openbsd

1 file changed

+24
-0
lines changed

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,30 @@ pub type Elf64_Sxword = i64;
3636
pub type Elf64_Word = u32;
3737
pub type Elf64_Xword = u64;
3838

39+
// sys/exec_elf.h - Legal values for p_type (segment type).
40+
pub const PT_NULL: u32 = 0;
41+
pub const PT_LOAD: u32 = 1;
42+
pub const PT_DYNAMIC: u32 = 2;
43+
pub const PT_INTERP: u32 = 3;
44+
pub const PT_NOTE: u32 = 4;
45+
pub const PT_SHLIB: u32 = 5;
46+
pub const PT_PHDR: u32 = 6;
47+
pub const PT_TLS: u32 = 7;
48+
pub const PT_LOOS: u32 = 0x60000000;
49+
pub const PT_HIOS: u32 = 0x6fffffff;
50+
pub const PT_LOPROC: u32 = 0x70000000;
51+
pub const PT_HIPROC: u32 = 0x7fffffff;
52+
53+
pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
54+
pub const PT_GNU_RELRO: u32 = 0x6474e552;
55+
56+
// sys/exec_elf.h - Legal values for p_flags (segment flags).
57+
pub const PF_X: u32 = 0x1;
58+
pub const PF_W: u32 = 0x2;
59+
pub const PF_R: u32 = 0x4;
60+
pub const PF_MASKOS: u32 = 0x0ff00000;
61+
pub const PF_MASKPROC: u32 = 0xf0000000;
62+
3963
// search.h
4064

4165
pub type ENTRY = entry;

0 commit comments

Comments
 (0)