Skip to content

Commit

Permalink
Merge pull request #239 from rust-lang/comment
Browse files Browse the repository at this point in the history
gimli: Touch up comments about symbol sorting
  • Loading branch information
alexcrichton authored Aug 9, 2019
2 parents ab1dda0 + 5eae8bf commit 61ba508
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/symbolize/gimli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,17 @@ cfg_if::cfg_if! {
.iter()
.map(|s| (s, false))
.chain(elf.dynsyms.iter().map(|s| (s, true)))
// Only look at function/object symbols. Not entirely sure
// why, but this is what libbacktrace does.
// Only look at function/object symbols. This mirrors what
// libbacktrace does and in general we're only symbolicating
// function addresses in theory. Object symbols correspond
// to data, and maybe someone's crazy enough to have a
// function go into static data?
.filter(|(s, _)| {
s.is_function() || s.st_type() == goblin::elf::sym::STT_OBJECT
})
// skip anything that's in an undefined section header,
// again not entirely sure why but this is what libbacktrace
// does.
// since it means it's an imported function and we're only
// symbolicating with locally defined functions.
.filter(|(s, _)| {
s.st_shndx != goblin::elf::section_header::SHN_UNDEF as usize
})
Expand Down

0 comments on commit 61ba508

Please sign in to comment.