#[repr(C)]pub struct Phdr {
pub type_: PType,
pub p_flags: PFlags,
pub p_offset: u64,
pub p_vaddr: u64,
pub p_paddr: u64,
pub p_filesz: u64,
pub p_memsz: u64,
pub p_align: u64,
}Expand description
ELF program header for 64-bit binaries.
Each Phdr entry describes a segment or other information needed for
execution.
Fields§
§type_: PTypeSegment type.
p_flags: PFlagsSegment permissions.
p_offset: u64Offset in the file where the segment starts.
p_vaddr: u64Virtual address where the segment should be mapped in memory.
p_paddr: u64Physical address (not commonly used in modern OSes).
p_filesz: u64Size of the segment in the file.
p_memsz: u64Size of the segment in memory.
p_align: u64Alignment of the segment (must be a power of two).
Implementations§
Source§impl Phdr
impl Phdr
Sourcepub fn permission(&self) -> Permission
pub fn permission(&self) -> Permission
Get a ELF segment permissions (PFlags) of this Phdr in forms of
memory permissions (Permission).
This function translates the permission flags of phdr into the corresponding memory protection flags used by the system and return it. The conversion ensures that the memory is properly set up according to the ELF segment’s requirements.
§Returns
- A
Permissionvalue representing the phdr’s memory permissions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Phdr
impl RefUnwindSafe for Phdr
impl Send for Phdr
impl Sync for Phdr
impl Unpin for Phdr
impl UnwindSafe for Phdr
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)