Return the module's sections in ELF load order: non-BSS first, BSS last.
(module: &AssembledOutput)
| 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. |
| 346 | fn 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()); |
no test coverage detected