From: Peter Jones <pjones@redhat.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: "Pali Rohár" <pali@kernel.org>,
"David Howells" <dhowells@redhat.com>,
linux-efi@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] include: pe.h: Fix PE definitions
Date: Wed, 21 May 2025 10:11:23 -0400 [thread overview]
Message-ID: <bc8307c5-cf59-4a9a-95e1-c49ac19efb43@uncooperative.org> (raw)
In-Reply-To: <CAMj1kXGE0fSRvR4=+qAWu54ehzJfdC9GSzHODr4pMTEbBwOhuA@mail.gmail.com>
On Wed, May 21, 2025 at 03:45:13PM +0200, Ard Biesheuvel wrote:
> (cc Peter)
>
> On Mon, 5 May 2025 at 19:33, Pali Rohár <pali@kernel.org> wrote:
> >
> > Hello Ard!
> >
> > On Monday 05 May 2025 13:25:45 Ard Biesheuvel wrote:
> > > Hello Pali,
> > >
> > > On Sun, 4 May 2025 at 20:23, Pali Rohár <pali@kernel.org> wrote:
> > > >
> > > > * Rename constants to their standard PE names:
> > > > - MZ_MAGIC -> IMAGE_DOS_SIGNATURE
> > > > - PE_MAGIC -> IMAGE_NT_SIGNATURE
> > > > - PE_OPT_MAGIC_PE32_ROM -> IMAGE_ROM_OPTIONAL_HDR_MAGIC
> > > > - PE_OPT_MAGIC_PE32 -> IMAGE_NT_OPTIONAL_HDR32_MAGIC
> > > > - PE_OPT_MAGIC_PE32PLUS -> IMAGE_NT_OPTIONAL_HDR64_MAGIC
> > > > - IMAGE_DLL_CHARACTERISTICS_NX_COMPAT -> IMAGE_DLLCHARACTERISTICS_NX_COMPAT
> > > >
> > >
> > > Where are these 'standard PE names' defined?
> >
> > Basically in any project which is doing something with PE, at least in
> > projects which I saw or used it. Those names are mostly coming from
> > Windows SDKs/WDKs as the Microsoft is inventor of them and are de-facto
> > standard names -- or at least people are following existing naming
> > convention for a good reasons. If you are are not familiar with
> > MS/Windows world, you can find them also in projects like binutils,
> > llvm/clang, wine or mingw-w64, which are hopefully well-known project
> > references.
> >
> > Some of IMAGE_DLLCHARACTERISTICS_* names (including the NX_COMPAT) are
> > defined also in the PE MS spec (win32/debug/pe-format). I hope that this
> > spec can be taken as a reference, even that it does not document
> > everything related to PE, and contains mistakes.
>
> I don't feel strongly either way with any of this - I don't think
> there's anything to fix here, but I'm not attached to the names so I
> don't mind changing them either.
>
> Peter: any thoughts?
I'm broadly for making the names look more like what the spec uses
whenever we can when it doesn't introduce naming collisions with other
stuff. But like you, it makes very little difference to me.
--
Peter
next prev parent reply other threads:[~2025-05-21 14:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-04 18:22 Pali Rohár
2025-05-05 11:25 ` Ard Biesheuvel
2025-05-05 17:32 ` Pali Rohár
2025-05-21 13:45 ` Ard Biesheuvel
2025-05-21 14:11 ` Peter Jones [this message]
2025-05-21 15:10 ` Ard Biesheuvel
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=bc8307c5-cf59-4a9a-95e1-c49ac19efb43@uncooperative.org \
--to=pjones@redhat.com \
--cc=ardb@kernel.org \
--cc=dhowells@redhat.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pali@kernel.org \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®