pub enum Holds {
Written,
ReadOnly,
Zero,
}Expand description
What a variable in a section the program named holds, which is the one thing about the section the name does not say.
The answers are the ones gcc gives, which a kernel’s linker script and readelf both see: a
section is writable unless the variable is constant and holds no address, and it carries no
bytes only when its name is one of the names that always mean zeros and the variable is zeros.
Variants§
Written
Bytes the program or the loader may write. "aw" on ELF.
ReadOnly
Bytes nothing writes, which a loader maps read only. "a" on ELF.
Zero
Zeros, in a section named for holding nothing else, so the file carries none of them.
"aw",@nobits on ELF.
Implementations§
Source§impl Holds
impl Holds
Sourcepub fn nobits(name: &str) -> bool
pub fn nobits(name: &str) -> bool
Whether a section of this name is one gcc makes carry no bytes, which is .bss and the
names under it, the small data one and the old COMDAT spellings of both, and .noinit,
which gas has made @nobits by its name since binutils 2.36. A kernel puts its page
aligned zeros in .bss..page_aligned and relies on this.
Trait Implementations§
impl Copy for Holds
impl Eq for Holds
impl StructuralPartialEq for Holds
Auto Trait Implementations§
impl Freeze for Holds
impl RefUnwindSafe for Holds
impl Send for Holds
impl Sync for Holds
impl Unpin for Holds
impl UnsafeUnpin for Holds
impl UnwindSafe for Holds
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.