From: Lennart Poettering Date: Mon, 11 Oct 2021 11:29:57 +0000 (+0200) Subject: stub: also move magic string in stub into .sdmagic PE section X-Git-Tag: v250-rc1~533^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ccd598635063abae2128540e6c29ce2f7b990ab;p=thirdparty%2Fsystemd.git stub: also move magic string in stub into .sdmagic PE section We already did that for sd-boot, hence do it for sd-stub the same way. Also, move the __attribute__ stuff to the beginning of the statement, rather than the middle. Mostly just because we usually put it first for implementations for identifiers (for prototypes we put it last). --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index d82d679a47d..eb07bf6898d 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -25,7 +25,7 @@ #define TEXT_ATTR_SWAP(c) EFI_TEXT_ATTR(((c) & 0b11110000) >> 4, (c) & 0b1111) /* magic string to find in the binary image */ -static const char _used_ _section_(".sdmagic") magic[] = "#### LoaderInfo: systemd-boot " GIT_VERSION " ####"; +_used_ _section_(".sdmagic") static const char magic[] = "#### LoaderInfo: systemd-boot " GIT_VERSION " ####"; enum loader_type { LOADER_UNDEFINED, diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index dad0f613353..4662a1495dd 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -14,7 +14,7 @@ #include "util.h" /* magic string to find in the binary image */ -static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-stub " GIT_VERSION " ####"; +_used_ _section_(".sdmagic") static const char magic[] = "#### LoaderInfo: systemd-stub " GIT_VERSION " ####"; static EFI_STATUS combine_initrd( EFI_PHYSICAL_ADDRESS initrd_base, UINTN initrd_size,