pub struct Shape {
pub alloc: bool,
pub write: bool,
pub exec: bool,
pub thread: bool,
pub bits: bool,
pub array: Option<Array>,
}Expand description
What a section is, which on ELF is a handful of flag letters and a type.
Held as the separate facts rather than as one of a fixed list of kinds, because the list is not
fixed: a program may write .section .init.text,"ax",@progbits and mean a section this compiler
has no name for, and the letters are the whole of what it said about it. The writer underneath
takes a SectionKind, so Shape::kind is the one place that turns these back into one, and
the cases it cannot say are written as flags directly.
Fields§
§alloc: boola: the section takes space in the loaded image. A section without this is for a debugger
or a linker to read and is not in the program at run time.
write: boolw: the program may write to it.
exec: boolx: the processor may execute it.
thread: boolT: one copy per thread rather than one copy per program.
bits: boolWhether the file carries the bytes. False is @nobits, which is what .bss is.
array: Option<Array>Which kind of table of function addresses this is, for the three ELF has a type for.
Implementations§
Source§impl Shape
impl Shape
Sourcepub fn of(name: &str) -> Shape
pub fn of(name: &str) -> Shape
What a section of this name is when the source named it and said nothing else.
.text, .data and the rest are names an assembler already knows the flags of, which is
why a program may write .data on its own and why .section .data without letters is the
same section rather than an unallocated one. A name nothing here knows gets the flags of an
ordinary allocated writable section, which is what gas does with one.
Trait Implementations§
impl Copy for Shape
impl Eq for Shape
impl StructuralPartialEq for Shape
Auto Trait Implementations§
impl Freeze for Shape
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnsafeUnpin for Shape
impl UnwindSafe for Shape
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.