ELFIO icon indicating copy to clipboard operation
ELFIO copied to clipboard

how to remove sections and/or segments?

Open dsw opened this issue 11 months ago • 0 comments

I am modifying ELF files and as part of that process I want to delete existing segments / sections. There does not seem to be any method to do this. What do you recommend?

While both the sections and the segments seem to just vectors, I am never quite sure of how the data-structures might depend on one another, so I wasn't sure that just deleting from the vectors would do it cleanly. Further, these vectors are private within class elfio, so I would have to hack the class.

I suppose I could make a new ELF and copy the parts of the old one that I want. If I do so, is there a straightforward way to clone all of the relevant headers of various kinds without missing any?

It would make a great example to show cloning an ELF and then checking a predicate for each section and segment to know whether a given section/segment should be copied to the new ELF.

dsw avatar Jan 21 '25 03:01 dsw