public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH] elfcompress: Don't rewrite file if no section data needs to be updated.
Date: Sun, 22 Jul 2018 20:39:00 -0000	[thread overview]
Message-ID: <20180722203936.GI2363@wildebeest.org> (raw)
In-Reply-To: <CAFMg4WC7X3SHi3jgPfidTDpXJjSfFkTvEe8zOK3FxC19_X_haQ@mail.gmail.com>

Hi Igor,

On Sun, Jul 22, 2018 at 10:06:47PM +0200, Igor Gnatenko wrote:
> On Sun, Jul 22, 2018 at 5:20 PM Mark Wielaard <mark@klomp.org> wrote:
> > > However, if nothing needs
> > > compression/decompression - why to rewrite file?
> >
> > Indeed. That is why I wrote this patch. Because it might still change
> > the file. It might remove some padding between sections, correct
> > alignment of some data in the file, change permission/ownership, etc.
> >
> > In general you wouldn't want that if not necessary for (de)compression
> > of some ELF section data.
> 
> But we want this in RPM, right?

Sorry, I don't understand what 'this' refers to.
What do you want in RPM?
I think you would never want to use --force for RPM.

> > Again that is arguably useless, so only really used for testing purposes
> > to see that elfcompress works correctly.
> >
> > > Probably we should create
> > > new option --force-on-noop or -f -f or something like that?
> >
> > If possible I would like only one option for "do something useless even
> > if not necessary".
> 
> Can we just make it to not rewrite file if it won't be changed at all?

I believe that is what this patch does. But I might misunderstand your
question.

Before this patch elfcompress would always rewrite/update the file even
if nothing needed to be (de)compressed. With this patch it will not
change the file if it detects nothing needs to be done.

Unless you use --force to say you really want the file to be updated
anyway even if it was already complete (de)compressed.

The idea behind the patch is that you might want to run eu-elfcompress
on everything to make sure that everything has compressed (debug) ELF
sections (or run eu-elfcompress -t none to make sure no file has). But 
if a file is already fully (de)compressed then eu-elfcompress can stop
early without needing to do any unnecessary updates.

Cheers,

Mark

  parent reply	other threads:[~2018-07-22 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-21 15:15 Mark Wielaard
     [not found] ` <CAFMg4WC6-Py1WqTbASzY5KYkJRdssjOA1oqMFfzOrSegoPJUwg@mail.gmail.com>
2018-07-22 15:20   ` Mark Wielaard
     [not found]     ` <CAFMg4WC7X3SHi3jgPfidTDpXJjSfFkTvEe8zOK3FxC19_X_haQ@mail.gmail.com>
2018-07-22 20:39       ` Mark Wielaard [this message]
     [not found]         ` <CAFMg4WAAhRqCVDRRCSwLHK=_4mBk=FMQ03nGw9NEZJZ8ru4Ljw@mail.gmail.com>
2018-07-24  7:57           ` Mark Wielaard
2018-07-24  8:23             ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180722203936.GI2363@wildebeest.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=ignatenkobrain@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).