pub struct LocalsFirst {
pub order: Vec<usize>,
pub old_to_new: Vec<usize>,
pub local_count: usize,
}Expand description
The locals-first symbol order, computed ONCE for every container that needs it (#656, #1180).
ELF requires every STB_LOCAL symbol to precede every non-local one in
.symtab, with the section’s sh_info = index of the first non-local.
Mach-O’s LC_DYSYMTAB requires the same partition (locals, then external
defined, then undefined). The ARM ELF32 builder (synth-backend,
ElfBuilder::build) and the aarch64 object plan (synth-backend-aarch64,
plan_object) both apply THIS permutation, so the rule is written once —
a second hand-written copy in a second writer is the mirror the North
Star forbids, and the way the two backends diverged in the first place.
The permutation is a STABLE sort on binding != Local: with zero locals
it is the identity, which is what keeps every pre-#656 / pre-#1180 object
byte-identical.
Fields§
§order: Vec<usize>order[new] = old: the symbol emitted at position new is the caller’s
symbol old.
old_to_new: Vec<usize>old_to_new[old] = new: where the caller’s symbol old landed. Every
relocation that names a symbol by index is rewritten through this.
local_count: usizeThe number of Local symbols — the length of the local prefix. ELF’s
sh_info is local_count + 1 (the null symbol at index 0 counts as
local); Mach-O’s nlocalsym is local_count.
Trait Implementations§
Source§impl Clone for LocalsFirst
impl Clone for LocalsFirst
Source§fn clone(&self) -> LocalsFirst
fn clone(&self) -> LocalsFirst
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LocalsFirst
impl Debug for LocalsFirst
impl Eq for LocalsFirst
Source§impl PartialEq for LocalsFirst
impl PartialEq for LocalsFirst
impl StructuralPartialEq for LocalsFirst
Auto Trait Implementations§
impl Freeze for LocalsFirst
impl RefUnwindSafe for LocalsFirst
impl Send for LocalsFirst
impl Sync for LocalsFirst
impl Unpin for LocalsFirst
impl UnsafeUnpin for LocalsFirst
impl UnwindSafe for LocalsFirst
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.