Closed dedmen closed 2 years ago
Thanks for the PR. Indeed there was a bug, actually it's quite funny that this didn't show up until now. Anyway I'll review it in a moment.
Finished, just one small remark to consider.
I'm merging it with my remark now.
Released in 2.13.2
.
https://man7.org/linux/man-pages/man5/elf.5.html
Search for SHT_NOBITS
The old code tried to happily read a section from file, that simply isn't present in the file, which causes this to return bogus data. I'm not sure if this is the correct approach to fix this, but the section isn't present in the file thus you cannot really return its contents.
If you need a repro,
objcopy --only-keep-debug sourceBinary sourceBinary.debug
turns .eh_frame into NoBits