Enum crate_metadata::SectionType
source · pub enum SectionType {
Text,
Rodata,
Data,
Bss,
TlsData,
TlsBss,
Cls,
GccExceptTable,
EhFrame,
}
Expand description
The possible types of sections that can be loaded from a crate object file.
Variants§
Text
A text
section contains executable code, i.e., functions.
Rodata
An rodata
section contains read-only data, i.e., constants.
Data
A data
section contains data that is both readable and writable, i.e., static variables.
Bss
A bss
section is just like a data section, but is automatically initialized to all zeroes at load time.
TlsData
A .tdata
section is a read-only section that holds the initial data “image”
for a thread-local storage (TLS) area.
TlsBss
A .tbss
section is a read-only section that holds all-zero data for a thread-local storage (TLS) area.
This is is effectively an empty placeholder: the all-zero data section doesn’t actually exist in memory.
Cls
A .cls
section is a read-only section that holds the initial data “image” for a CPU-local
(CLS) area.
GccExceptTable
A .gcc_except_table
section contains landing pads for exception handling,
comprising the LSDA (Language Specific Data Area),
which is effectively used to determine when we should stop the stack unwinding process
(e.g., “catching” an exception).
Blog post from author of gold linker: https://www.airs.com/blog/archives/464
Mailing list discussion here: https://gcc.gnu.org/ml/gcc-help/2010-09/msg00116.html
Here is a sample repository parsing this section: https://github.com/nest-leonlee/gcc_except_table
EhFrame
The .eh_frame
section contains information about stack unwinding and destructor functions
that should be called when traversing up the stack for cleanup.
Blog post from author of gold linker: https://www.airs.com/blog/archives/460 Some documentation here: https://gcc.gnu.org/wiki/Dwarf2EHNewbiesHowto
Implementations§
Trait Implementations§
source§impl Clone for SectionType
impl Clone for SectionType
source§fn clone(&self) -> SectionType
fn clone(&self) -> SectionType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SectionType
impl Debug for SectionType
source§impl<'de> Deserialize<'de> for SectionType
impl<'de> Deserialize<'de> for SectionType
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SectionType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<SectionType, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl PartialEq<SectionType> for SectionType
impl PartialEq<SectionType> for SectionType
source§fn eq(&self, other: &SectionType) -> bool
fn eq(&self, other: &SectionType) -> bool
self
and other
values to be equal, and is used
by ==
.