elfcompress: Don't rewrite file if no section data needs to be updated.
authorMark Wielaard <mark@klomp.org>
Sat, 21 Jul 2018 15:07:12 +0000 (17:07 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 24 Jul 2018 07:56:34 +0000 (09:56 +0200)
commited62996defc619d0def86a5ed223a48486b97a70
treed43df5ecb934d8bed99879604611408c0a62fc57
parentdf9053f67c637fd240771705bb926a6d0e3381cf
elfcompress: Don't rewrite file if no section data needs to be updated.

If the input and output file are the same and no section needs to
be updated we really don't need to rewrite the file.

Check whether any matching section is already compressed or decompressed.
Skip the section if it doesn't need to be changed. If no section data
needs updating end with success without rewriting/updating file.

With --force the file will still always be updated/rewritten even if
no section data needs to be (de)compressed.

Acked-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/elfcompress.c