pub struct ThreadLocalVariables<'a> { /* private fields */ }
Expand description

This class represents a MachO section whose type is crate::macho::section::Type::THREAD_LOCAL_VARIABLES.

It contains an array of thread-local variable descriptors (Thunk) used by dyld to lazily initialize thread-local storage on first access.

Implementations§

§

impl ThreadLocalVariables<'_>

pub fn nb_thunks(&self) -> u64

Number of Thunk descriptors in this section

pub fn thunks(&self) -> Thunks<'_>

Iterator over the Thunk descriptors stored in this section

pub fn get(&self, idx: u64) -> Option<Thunk<'_>>

Return the Thunk at the given index, or None if out of range.

pub fn set(&mut self, idx: u64, thunk: &Thunk<'_>)

Change the Thunk at the given index.

Trait Implementations§

§

impl Debug for ThreadLocalVariables<'_>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl MachOSection for ThreadLocalVariables<'_>

§

fn segment_name(&self) -> String

Name of the segment that owns this section
§

fn address(&self) -> u64

Virtual base address of this section
§

fn alignment(&self) -> u32

Section alignment as a power of 2
§

fn relocation_offset(&self) -> u32

Offset of the relocation table. This value should be 0 for executable and libraries as the relocations are managed by crate::macho::Relocation::Dyld or crate::macho::Relocation::Fixup Read more
§

fn numberof_relocations(&self) -> u32

Number of relocations associated with this section
§

fn raw_flags(&self) -> u32

§

fn flags(&self) -> Flags

Section’s flags masked with SECTION_FLAGS_MASK
§

fn section_type(&self) -> Type

Type of the section. This value can help to determine the purpose of the section
§

fn reserved1(&self) -> u32

According to the official loader.h file, this value is reserved for offset or index
§

fn reserved2(&self) -> u32

According to the official loader.h file, this value is reserved for count or sizeof
§

fn reserved3(&self) -> u32

This value is only present for 64 bits Mach-O files. In that case, the value is reserved.
§

fn segment(&self) -> Option<Segment<'_>>

Segment bound to this section
§

fn relocations(&self) -> Relocations<'_>

Iterator over the crate::macho::Relocation associated with this section
§

impl Section for ThreadLocalVariables<'_>

§

fn name(&self) -> String

Name of the section
§

fn size(&self) -> u64

Size of the section in the file
§

fn offset(&self) -> u64

Offset of the section in the file
§

fn virtual_address(&self) -> u64

Address of the section in memory
§

fn content(&self) -> &[u8]

Content of the section
§

fn set_name(&mut self, name: &str)

Change the section’s name
§

fn set_content(&mut self, data: &[u8])

Change section content
§

fn set_size(&mut self, size: u64)

Change section size

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.