m4b / goblin

An impish, cross-platform binary parsing crate, written in Rust
MIT License
1.2k stars 160 forks source link

Return an empty file range for SHT_NOBITS sections #253

Closed Tiwalun closed 3 years ago

Tiwalun commented 3 years ago

ELF sections with type SHT_NOBITS only exist in memory, and don't contain any data in the ELF file itself. The range returned by file_range() should be empty for such sections.

The previously returned range was wrong, and overlapped the file range of the next section.

Fixes #252.

m4b commented 3 years ago

thanks for this PR ! :)