eliben / pyelftools

Parsing ELF and DWARF in Python
Other
1.99k stars 507 forks source link

CIEv4 and FDE ahead of its CIE #563

Closed sevaa closed 1 month ago

sevaa commented 2 months ago

Addresses both issues in #562. As always, uncovered some unrelated stuff once the binary hit the test corpus.

The FDE ahead of CIE issue is not handled correctly neither by GNU readelf nor by llvm-dwarfdump nor by eu-readelf.

Along the way, I had to file two bugs against GNU readelf:

Also, the aranges section in the binary looks straight up malformed - there is no entry tuple alignment to the tuple size, as demanded by the standard. Readelf produces nonsensical output on that section, pyelftools conks out. Smells like a bug in IAR.

Over those issues, I had to exclude the new binary from some of the readelf tests. I'll try to patch readelf in the meantime.