(sections: &[SectionHeader], addr: u64)
| 147 | } |
| 148 | |
| 149 | fn section_index_for_addr(sections: &[SectionHeader], addr: u64) -> usize { |
| 150 | sections |
| 151 | .iter() |
| 152 | .enumerate() |
| 153 | .find(|(_, section)| { |
| 154 | if section.sh_size == 0 { |
| 155 | section.sh_addr == addr |
| 156 | } else { |
| 157 | addr >= section.sh_addr && addr < section.sh_addr + section.sh_size |
| 158 | } |
| 159 | }) |
| 160 | .map(|(index, _)| index) |
| 161 | .unwrap_or_else(|| panic!("no section contains address {addr:#x}")) |
| 162 | } |
| 163 | |
| 164 | fn find_local_label(assembled: &AssembledOutput) -> String { |
| 165 | assembled |
no outgoing calls
no test coverage detected