-
Hello, can this library be used to create an application that would remove debug information of some specific symbols from existing elf binary? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The simple answer is 'NO'. DWARF is as compact as possible (depending on compiler-writer One thing is doable though. In strings in the .debug_str section zeroing Altering non-null ASCII bytes in any string anywhere in DWARF to be any non-null For strings in the .debug_info section ( or .debug_line or others) zeroing out any bytes have |
Beta Was this translation helpful? Give feedback.
-
I wrote "One thing is doable though. In strings in the .debug_str section zeroing "In strings in the .debug_str section zeroing Zeroing out portions of a utf8 codepoint is probably safe, though of course |
Beta Was this translation helpful? Give feedback.
The simple answer is 'NO'.
DWARF is as compact as possible (depending on compiler-writer
choices) and that makes changing content challenging: Essentially reading it all in to a set of graphs
removing parts, and writing a new object file. Just removing stuff, or just setting blobs of bytes to zeros
will destroy the DWARF involved. The library cannot store or rewrite such graphs ( such was never part of its design).
One thing is doable though. In strings in the .debug_str section zeroing
out bytes will not destroy the DWARF, it will still be readable.
Altering non-null ASCII bytes in any string anywhere in DWARF to be any non-null
ASCII character (possibly the dot (.)) will not destroy the…