public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Nick Clifton <nickc@redhat.com>
Cc: binutils@sourceware.org
Subject: Re: RFC: Objcopy: Section alignment
Date: Tue, 2 Apr 2024 11:19:46 +0200	[thread overview]
Message-ID: <0f962555-2abe-4233-b448-b22f27320c28@suse.com> (raw)
In-Reply-To: <530c7e2e-ca49-4f11-99a7-25298b707a88@redhat.com>

On 02.04.2024 10:45, Nick Clifton wrote:
>>> Plus, as it turns out, I was
>>> assuming that calling bfd_set_section_alignment() was enough to set
>>> the alignment for a PE section.
>>
>> Which also shouldn't be necessary? Isn't section alignment relevant for
>> COFF objects only?
> 
> I am not sure.  But if it is not relevant for PE sections then shouldn't
> changing the SectionAlignment field in the PE header generate an error if
> any section's VMA does not match that alignment ?

Well, this I'm unsure about, largely because of not really knowing any good
spec for PE/COFF (which would cover such details).

>> And didn't Alan, not so long ago, remove its
>> propagation into PE binaries?
> 
> I must admit that I do not remember this, but it certainly could have happened.

Commit 6f8f6017a0c4 ("PR27567, Linking PE files adds alignment section flags
to executables"), to deal with PR 27567. But indeed ...

>> (This then also being a reason why the
>> alignment values weren't dumped for PE.)
> 
> I think that we should not hide the alignment values from the user, even if
> they are not going to be honoured.  We do not dictate the policy for the how
> PE binaries are going to be treated by the OS, and there could be good
> reasons for why a user needs to know them.

... I was mis-remembering that said change would also have removed the
dumping that you now add. In principle I'm okay with such dumping being
added; I merely would have been puzzled if it was re-added after having
been removed.

Jan

      reply	other threads:[~2024-04-02  9:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 14:55 Nick Clifton
2024-03-21 16:59 ` Jan Beulich
2024-03-26 12:44   ` Nick Clifton
2024-03-26 13:08     ` Jan Beulich
2024-03-28 13:08       ` Nick Clifton
2024-03-28 16:57         ` Jan Beulich
2024-04-02  8:45           ` Nick Clifton
2024-04-02  9:19             ` Jan Beulich [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=0f962555-2abe-4233-b448-b22f27320c28@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.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).