public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] objcopy: check input flavor before setting PE/COFF section alignment
Date: Wed, 8 May 2024 11:26:37 +0100	[thread overview]
Message-ID: <ff67ac13-c32c-49f5-8f89-3261be50e248@redhat.com> (raw)
In-Reply-To: <0e96f101-0205-4644-98be-9e75528affe5@suse.com>

Hi Jan,

>>> Of course the value (first) being set on the input bfd is suspicious
>>> in the first place: When copying e.g. ELF to PE/COFF, the option ought
>>> to be similarly respected, yet clearly it can't be set like this then on
>>> the incoming object. The change here is merely to address the testsuite
>>> failures observed for Arm64 and RISC-V ("Check if efi app format is
>>> recognized") as well as the (latent) memory corruption.

> Well, before putting it in - any thoughts on the post-commit-message remark
> above?

Sorry.  Well in the first place converting from ELF to PE is always going to
be a difficult process.  So trying to combine it with adjustments to other
properties, such as alignment, is just asking for trouble.  My feeling therefore
is that we ought to be have a warning in the documentation telling users
to be careful and maybe take things one step at a time.

> Is it really meant to stay the way of the input bfd's data is being
> altered, rather than keeping that intact and fiddling only with the output?
> And thus - afaict - rendering the command line option (silently) useless
> when copying ELF to PE?

You are right.  For this particular case maybe we should add a test for
ELF->PE format changing and refuse to adjust the alignments.

Cheers
   Nick




      reply	other threads:[~2024-05-08 10:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  9:27 Jan Beulich
2024-04-19 10:37 ` Nick Clifton
2024-04-22  7:15   ` Jan Beulich
2024-05-08 10:26     ` Nick Clifton [this message]

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=ff67ac13-c32c-49f5-8f89-3261be50e248@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    /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).