]> git.ipfire.org Git - thirdparty/systemd.git/commit
docs/package-notes: extend description to support PE/COFF files
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 19 Dec 2024 11:15:59 +0000 (12:15 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 19 Dec 2024 14:38:07 +0000 (15:38 +0100)
commitbafe34ddbe0c90e8addc00a6c3cee4dba5c9426e
tree2c150b3c1a39ad83588558118117c4e7c658ba76
parent0ab04876f2e82a350d6aa5be5ebb2f4be57c3ef4
docs/package-notes: extend description to support PE/COFF files

The package notes are nice standard mechanism to figure out the exact name and
version of a program or a library stored in a file, without running the code.
In the beginning this was designed for the purpose of analyzing core dumps, but
we've since started to use it more generically to identify files. The same need
to identify PE/COFF files occurs, for example for systemd-boot and other files
intended for UEFI. It has also been requested by people working on bootupd
(https://github.com/coreos/bootupd).

The text is changed to say "Executable" or "ELF or PE/COFF" wherever "ELF" was
used previously.

The description for PE/COFF files is very brief. AFAIK, we don't have the same
"note" mechanism there [1], so just a normal section is used. The alignment
rules for PE/UEFI are different and change over time, so no specific alignment
is specified.

Other requirements for the PE/COFF section are based on what ukify currently
does for the .osrel section:
  5 .osrel        00000056  000000010132f000  000000010132f000  0002b600  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

The name ".pkgnote" is used as suggested by Daan De Meyer. This corresponds to
the ".note.package" name used for ELF. ".package" was also suggested, but I
think that is too generic and carries more risk of a conflict with a different
use.

[1] https://learn.microsoft.com/en-us/windows/win32/debug/pe-format

Also zero/0 is replaced by NUL to clarify that a single 0 byte is meant.
docs/PACKAGE_METADATA_FOR_EXECUTABLE_FILES.md