Skip to content

Commit

Permalink
Merge pull request #204 from MathiasKoch/main
Browse files Browse the repository at this point in the history
Skip empty symbol names while attempting to parse json
  • Loading branch information
japaric committed Oct 21, 2020
2 parents 8f3942a + 13786e9 commit 91f33fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions elf2table/src/lib.rs
Expand Up @@ -66,9 +66,11 @@ pub fn parse(elf: &[u8]) -> Result<Option<Table>, anyhow::Error> {
// second pass to demangle symbols
let mut map = BTreeMap::new();
for (_, entry) in elf.symbols() {
// Skipping symbols with empty string names, as they may be added by
// `objcopy`, and breaks JSON demangling
let name = match entry.name() {
Some(name) => name,
None => continue,
Some(name) if !name.is_empty() => name,
_ => continue,
};

if entry.section_index() == Some(defmt_shndx) {
Expand Down

0 comments on commit 91f33fc

Please sign in to comment.