Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid ELF section header offset/size/alignment" panic #170

Closed
slonopotamus opened this issue May 18, 2020 · 2 comments · Fixed by #184
Closed

"Invalid ELF section header offset/size/alignment" panic #170

slonopotamus opened this issue May 18, 2020 · 2 comments · Fixed by #184

Comments

@slonopotamus
Copy link

  1. Download zip archive with problematic elf file: 1.elf.zip
  2. Unpack it somewhere
  3. Using addr2line master branch, run cargo run --example=addr2line -- -e /path/to/1.elf 0x80

Expected output (as produced by addr2line from GNU binutils):
Z:\/1.c:1
I'm not sure why there are two slashes, but path and line number are correct.

Actual output:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("Invalid ELF section header offset/size/alignment")', examples\addr2line.rs:156:17

@philipc
Copy link
Contributor

philipc commented May 19, 2020

Thanks for the report. This is an issue with the object crate though.

Looking at the file, the section headers are incorrectly aligned (4 bytes instead of 8 bytes), but maybe this is common enough that we have to handle it anyway. Which linker was used to create this file?

@slonopotamus
Copy link
Author

This binary was created with PS4 toolchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants