Skip to main content

Teb

Struct Teb 

Source
pub struct Teb {
    pub index: &'static str,
    pub array: &'static str,
    pub block: &'static str,
}
Expand description

The instructions a thread-local variable is reached with on Windows on AArch64.

The same walk as Indexed, from the TEB Windows keeps in x18 rather than in a segment, and the six instructions clang writes for it.

adrp x8, _tls_index
ldr  w8, [x8, :lo12:_tls_index]
ldr  x9, [x18, #88]
ldr  x8, [x9, x8, lsl #3]
add  x8, x8, :secrel_hi12:x, lsl #12
add  x0, x8, :secrel_lo12:x

Fields§

§index: &'static str

The first two, which read _tls_index, carrying it as its symbol.

§array: &'static str

The third, which reads the array out of the TEB.

§block: &'static str

The rest, which read this thread’s block out of the array with the index and add the variable’s offset in its section, carrying the variable as its symbol. It takes the array and the index as its two sources, in that order.

Trait Implementations§

Source§

impl Debug for Teb

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Teb

§

impl RefUnwindSafe for Teb

§

impl Send for Teb

§

impl Sync for Teb

§

impl Unpin for Teb

§

impl UnsafeUnpin for Teb

§

impl UnwindSafe for Teb

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.