From: Daniel Kiper via Grub-devel <grub-devel@gnu.org>
To: grub-devel@gnu.org
Cc: Daniel Kiper <daniel.kiper@oracle.com>,
ardb@kernel.org, development@efficientek.com, drummer@pobox.com,
phcoder@gmail.com
Subject: [PATCH] windows: Add _stack_chk_guard/_stack_chk_fail symbols for Windows 64-bit target
Date: Tue, 9 Apr 2024 19:56:02 +0200 [thread overview]
Message-ID: <20240409175602.25519-1-daniel.kiper@oracle.com> (raw)
Otherwise the GRUB cannot start when stack protector is enabled on EFI platforms.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
include/grub/stack_protector.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/grub/stack_protector.h b/include/grub/stack_protector.h
index c88dc00b5..13d2657d9 100644
--- a/include/grub/stack_protector.h
+++ b/include/grub/stack_protector.h
@@ -25,6 +25,10 @@
#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 */
--
2.11.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next reply other threads:[~2024-04-09 17:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 17:56 Daniel Kiper via Grub-devel [this message]
2024-04-09 18:02 ` [PATCH] windows: Add _stack_chk_guard/_stack_chk_fail symbols for Windows 64-bit target Vladimir 'phcoder' Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240409175602.25519-1-daniel.kiper@oracle.com \
--to=grub-devel@gnu.org \
--cc=ardb@kernel.org \
--cc=daniel.kiper@oracle.com \
--cc=development@efficientek.com \
--cc=drummer@pobox.com \
--cc=phcoder@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).