Struct lief::macho::commands::FunctionVariants
pub struct FunctionVariants<'a> { /* private fields */ }
Expand description
Class representing the LC_FUNCTION_VARIANTS
load command.
Introduced publicly in dyld-1284.13
(April 2025), this command supports
function multiversioning, the ability to associate multiple implementations
of the same function, each optimized for a specific platform, architecture,
or runtime context.
At runtime, the system dispatches the most appropriate variant based on hardware capabilities or execution environment.
For example:
FUNCTION_VARIANT_TABLE(my_function,
{ (void*)my_function$Rosetta, "rosetta" }, // Rosetta translation
{ (void*)my_function$Haswell, "haswell" }, // Haswell-optimized
{ (void*)my_function$Base, "default" } // Default fallback
);
Implementations§
§impl FunctionVariants<'_>
impl FunctionVariants<'_>
pub fn data_offset(&self) -> u32
pub fn data_offset(&self) -> u32
Offset in the __LINKEDIT
segment where the payload is located
pub fn runtime_table(&self) -> RuntimeTables<'_> ⓘ
pub fn runtime_table(&self) -> RuntimeTables<'_> ⓘ
Iterator over the different RuntimeTable
entries located in the content
of this __LINKEDIT
command
Trait Implementations§
§impl Command for FunctionVariants<'_>
impl Command for FunctionVariants<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FunctionVariants<'a>
impl<'a> !Send for FunctionVariants<'a>
impl<'a> !Sync for FunctionVariants<'a>
impl<'a> Unpin for FunctionVariants<'a>
impl<'a> !UnwindSafe for FunctionVariants<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more