patchelf icon indicating copy to clipboard operation
patchelf copied to clipboard

Implementing --clean-strtab

Open brenoguim opened this issue 2 years ago • 2 comments

Hi,

I started to implement a simple version of --clean-strtab as suggested in https://github.com/NixOS/patchelf/issues/449.

Some attention points:

  • I'm not sure I got all the points.
  • This is really clean-dynstr so might need work to expand to other sections. But seems to be a good start for later enhancement.
  • Unfortunately, for most cases --clean-strtab will actually introduce a few strings because it will undo sharing like vprintf with printf. However I still think it's valuable to have it and enhance it later on if necessary.

Maybe we should have a set of switches documented as beta due to their complexity? The name renaming and this one could be marked as experimental because it's hard to know I got all fields right. Then after a couple of releases they could be moved to stable.

brenoguim avatar Feb 19 '23 19:02 brenoguim

I see that this pull request also does what I've done in #472. However, I don't introduce new symbols due to the symbol sharing, I just leave the sharing as-is.

rohoog avatar Mar 02 '23 21:03 rohoog

I was planning to enhance it to do the sharing eventually, so it would be next to perfect. I didn't check the size of the file in my test, only the presence of a given string. I'll take a look at your PR @rohoog , maybe the approach of not undoing the sharing is the best.

brenoguim avatar Mar 03 '23 02:03 brenoguim