Skip to content

Commit

Permalink
File::symbol_version_table -> Stop iterating the section headers once…
Browse files Browse the repository at this point in the history
… we've found our shdrs
  • Loading branch information
cole14 committed Oct 29, 2022
1 parent 8577748 commit 2162e6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,11 @@ impl<R: ReadBytesAt> File<R> {
} else if shdr.sh_type == gabi::SHT_GNU_VERDEF {
defs_opt = Some(shdr);
}

// If we've found all three sections, then we're done
if versym_opt.is_some() && needs_opt.is_some() && defs_opt.is_some() {
break;
}
}

// No VERSYM section means the object doesn't use symbol versioning, which is ok.
Expand Down

0 comments on commit 2162e6e

Please sign in to comment.