[PATCH] RFC: strip with mixed allocated/non-allocated sections

Mark Wielaard mark@klomp.org
Thu Aug 30 09:51:00 GMT 2018


On Mon, 2018-07-30 at 00:35 +0200, Mark Wielaard wrote:
> Normally in non-ET_REL files all allocated sections come before
> all non-allocated sections. eu-strip relies on this when stripping
> a file and calculating the file offsets. But recently on Fedora
> there are non-allocated .gnu.build.attributes NOTE sections in
> the middle of the allocated sections, with a sh_offset field that
> is larger then the next section. This confuses eu-strip so much that
> it might corrupt the stripped file.
> 
> Work around this by calculating the sh_offset fields in two phases
> when detecting mixed allocated/non-allocated sections. First handle
> the allocated ones, then use the offset after the last allocated
> section to calculate the offsets of the non-allocated sections left
> in the stripped file.

This has been integrated in the fedora package for the last 4 weeks and
seems to work as intended. I have added a ChangeLog entry and pushed to
master.

Cheers,

Mark



More information about the Elfutils-devel mailing list