Struct rustix::backend::vdso::Vdso

source ·
pub(super) struct Vdso {
    load_addr: *const Elf_Ehdr,
    load_end: *const c_void,
    pv_offset: usize,
    symtab: *const Elf_Sym,
    symstrings: *const u8,
    bucket: *const u32,
    chain: *const u32,
    nbucket: u32,
    versym: *const u16,
    verdef: *const Elf_Verdef,
}

Fields§

§load_addr: *const Elf_Ehdr§load_end: *const c_void§pv_offset: usize§symtab: *const Elf_Sym§symstrings: *const u8§bucket: *const u32§chain: *const u32§nbucket: u32§versym: *const u16§verdef: *const Elf_Verdef

Implementations§

source§

impl Vdso

source

pub(super) fn new() -> Option<Self>

Parse the vDSO.

Returns None if the vDSO can’t be located or if it doesn’t conform to our expectations.

source

unsafe fn match_version(&self, ver: u16, name: &CStr, hash: u32) -> bool

Check the version for a symbol.

§Safety

The raw pointers inside self must be valid.

source

pub(super) fn sym(&self, version: &CStr, name: &CStr) -> *mut c_void

Look up a symbol in the vDSO.

source

unsafe fn base_plus(&self, offset: usize) -> Option<*const c_void>

Add the given address to the vDSO base address.

source

unsafe fn addr_from_elf(&self, elf_addr: usize) -> Option<*const c_void>

Translate an ELF-address-space address into a usable virtual address.

Auto Trait Implementations§

§

impl Freeze for Vdso

§

impl RefUnwindSafe for Vdso

§

impl !Send for Vdso

§

impl !Sync for Vdso

§

impl Unpin for Vdso

§

impl UnwindSafe for Vdso

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.