]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
windows: Add _stack_chk_guard/_stack_chk_fail symbols for Windows 64-bit target
authorDaniel Kiper <daniel.kiper@oracle.com>
Tue, 9 Apr 2024 17:56:02 +0000 (19:56 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 11 Apr 2024 13:48:26 +0000 (15:48 +0200)
Otherwise the GRUB cannot start due to missing symbols when stack
protector is enabled on EFI platforms.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
include/grub/stack_protector.h

index c88dc00b5f970882c71f2e0436ab156d48c799d5..13d2657d98f50175e3ee268d802b546a909d93fc 100644 (file)
 #ifdef GRUB_STACK_PROTECTOR
 extern grub_addr_t EXPORT_VAR (__stack_chk_guard);
 extern void __attribute__ ((noreturn)) EXPORT_FUNC (__stack_chk_fail) (void);
+#if defined(_WIN64) && !defined(__CYGWIN__) /* MinGW, Windows 64-bit target. */
+static grub_addr_t __attribute__ ((weakref("__stack_chk_guard"))) EXPORT_VAR (_stack_chk_guard);
+static void __attribute__ ((noreturn, weakref("__stack_chk_fail"))) EXPORT_FUNC (_stack_chk_fail) (void);
+#endif
 #endif
 
 #endif /* GRUB_STACK_PROTECTOR_H */