]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
stub: also move magic string in stub into .sdmagic PE section
authorLennart Poettering <lennart@poettering.net>
Mon, 11 Oct 2021 11:29:57 +0000 (13:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 11 Oct 2021 12:09:28 +0000 (14:09 +0200)
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).

src/boot/efi/boot.c
src/boot/efi/stub.c

index d82d679a47d798d732b9b43093a627585089918b..eb07bf6898d16b6f33ab4c10ef512005ed0c19e5 100644 (file)
@@ -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,
index dad0f6133538063ab1119b8504451b6a9cdde12c..4662a1495dd9d8c00bdf27c2dfd3479d3463b59d 100644 (file)
@@ -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,