diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-10-30 15:30:53 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-10-31 14:58:12 +0100 |
commit | d97b8d9d7b615066aa99aa5f08c7ca4876d9502d (patch) | |
tree | 0db019dcef3688bf3ea99245365d85185dacf594 /src/fundamental | |
parent | test-sbat: separate the two sbat sections (diff) | |
download | systemd-d97b8d9d7b615066aa99aa5f08c7ca4876d9502d.tar.xz systemd-d97b8d9d7b615066aa99aa5f08c7ca4876d9502d.zip |
boot: stop appending NUL to .sdmagic and .sbat sections
Those text sections had a trailing NUL byte. It's debatable whether this is a
good idea or not. Correctly written consumers will look at the section size so
they wouldn't need this. Shim doesn't use a trailing NUL, so let's follow suit.
Fixes https://github.com/systemd/systemd/issues/33731.
898e9edc469f87fdb6018128bac29eef0a5fe698 reworked this code, but didn't actually
change the logic. We have always been appending the trailing zero by using a
NUL-terminated string as the section contents. (I checked this with v253.18
from before the elf2efi rework.)
.sdmagic contains a string like "#### LoaderInfo: systemd-boot 257~devel ####",
which changes with each version, so previous versions would compare unequal
anyway, so we don't need to worry about backwards compatibility.
Diffstat (limited to 'src/fundamental')
-rw-r--r-- | src/fundamental/macro-fundamental.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 7e604b8283..35758b5b18 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -542,7 +542,6 @@ static inline uint64_t ALIGN_OFFSET_U64(uint64_t l, uint64_t ali) { #define DECLARE_NOALLOC_SECTION(name, text) \ asm(".pushsection " name ",\"S\"\n\t" \ ".ascii " STRINGIFY(text) "\n\t" \ - ".zero 1\n\t" \ ".popsection\n") #ifdef SBAT_DISTRO |