MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / sections_iter

Method sections_iter

crates/asm-to-binary/src/assembler/output.rs:81–98  ·  view source on GitHub ↗

Iterate sections in ELF load order: non-BSS first, BSS last.

(&self)

Source from the content-addressed store, hash-verified

79 pub fn data_bytes(&self) -> &[u8] {
80 self.section_bytes(&SectionKind::Data)
81 }
82
83 pub fn rodata_bytes(&self) -> &[u8] {
84 self.section_bytes(&SectionKind::RoData)
85 }
86
87 pub fn bss_bytes(&self) -> &[u8] {
88 self.section_bytes(&SectionKind::Bss)
89 }
90
91 /// Total encoded size across all sections.
92 pub fn total_bytes(&self) -> usize {
93 self.sections.iter().map(|s| s.bytes.len()).sum()
94 }
95
96 /// Returns `true` if at least one section was emitted.
97 pub fn has_sections(&self) -> bool {
98 !self.sections.is_empty()
99 }
100
101 /// Iterate sections in ELF load order: non-BSS first, BSS last.

Callers 4

collect_sectionsFunction · 0.80
word_at_linked_addressFunction · 0.80
linkFunction · 0.80

Calls 1

nameMethod · 0.45

Tested by 2

word_at_linked_addressFunction · 0.64