Skip to content

Commit 55369a2

Browse files
authored
Merge pull request #736 from workingjubilee/simplify-xcoff-find-text
cleanup: simplify scan for xcoff .text section
2 parents 7008740 + 962ac39 commit 55369a2

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/symbolize/gimli/xcoff.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,7 @@ pub fn parse_xcoff(data: &[u8]) -> Option<Image> {
6464
let header = Xcoff::parse(data, &mut offset).ok()?;
6565
let _ = header.aux_header(data, &mut offset).ok()?;
6666
let sections = header.sections(data, &mut offset).ok()?;
67-
if let Some(section) = sections.iter().find(|s| {
68-
if let Ok(name) = str::from_utf8(&s.s_name()[0..5]) {
69-
name == ".text"
70-
} else {
71-
false
72-
}
73-
}) {
67+
if let Some(section) = sections.iter().find(|s| s.s_name().get(0..5) == b".text") {
7468
Some(Image {
7569
offset: section.s_scnptr() as usize,
7670
base: section.s_paddr() as u64,

0 commit comments

Comments
 (0)