Closed rossburton closed 1 month ago
@eliben I don't know, an optional argument that will save the OP a one line check...
@rossburton can you elaborate a bit more on the boilerplate saved?
It is pretty minimal, but I've a lot of code that does this:
dynamic = elf.get_section_by_name('.dynamic')
if not dynamic or dynamic["sh_type"] != "SHT_DYNAMIC":
return
I can have a convenience wrapper in my code if you prefer.
Understood, thanks. I'd like to keep it minimal for now; will be on the lookout for similar requests
When a library with debug symbols is split into code and debug info, the debug info has all of the original segments but without any content. This means that if you do
get_section_by_name(".dynamic")
you'll get a stubSection
instance.For code which wants to poke around an ELF, I wonder if it would be useful to have an optional arguments to save boilerplate. Maybe:
Or: