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

Function ordered_sections

crates/asm-to-binary/src/object_linker.rs:340–353  ·  view source on GitHub ↗

Return the module's sections in ELF load order: non-BSS first, BSS last.

(module: &AssembledOutput)

Source from the content-addressed store, hash-verified

338 return pos as u32;
339 }
340 file_table.push(String::new());
341 (file_table.len() - 1) as u32
342}
343
344// Collect all distinct section kinds present across all modules, in canonical
345// ELF load order: Text, RoData, Data, Custom(k), Bss.
346fn collect_ordered_kinds(modules: &[(&str, &AssembledOutput)]) -> Vec<SectionKind> {
347 let mut seen = std::collections::HashSet::new();
348 let mut out = Vec::new();
349
350 let preferred = [SectionKind::Text, SectionKind::RoData, SectionKind::Data];
351
352 for kind in &preferred {
353 for (_name, module) in modules {
354 for sec in &module.sections {
355 if sec.kind.as_ref() == Some(kind) && seen.insert(kind.clone()) {
356 out.push(kind.clone());

Callers 2

linkMethod · 0.85
build_module_section_mapFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected