From ac43bbacdef18a6fea6d978e096326ec0805885d Mon Sep 17 00:00:00 2001 From: Taylor Beebe Date: Tue, 27 Aug 2024 14:31:48 -0700 Subject: MdePkg: Create Stack Check Null Libs Add Null libs for Stack Check and Stack Check Failure Hook Lib that allow a platform to opt out of stack checks and the stack check failure hook lib. StackCheckLib allows implementation (or in this case null implementation) of stack checks on binaries. There is a Host Application specific version of this null lib because MSVC host applications must not be linked against our lib (so the file here is a no-op but that doesn't cause the build system to fail the build for not building a file for MSVC) as it links against the MSVC C runtime lib that provides the stack cookie definitions. GCC host applications do not link against such a C runtime lib and must be linked against our version. StackCheckFailureHookLib lets a platform do custom functionality when a stack check failure occurs (such as log it to a platform defined mechanism). The null lib simply returns. Signed-off-by: Oliver Smith-Denny --- .../StackCheckLibNull/StackCheckLibHostApplicationMsvc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 MdePkg/Library/StackCheckLibNull/StackCheckLibHostApplicationMsvc.c (limited to 'MdePkg/Library/StackCheckLibNull/StackCheckLibHostApplicationMsvc.c') diff --git a/MdePkg/Library/StackCheckLibNull/StackCheckLibHostApplicationMsvc.c b/MdePkg/Library/StackCheckLibNull/StackCheckLibHostApplicationMsvc.c new file mode 100644 index 0000000000..6af9891c39 --- /dev/null +++ b/MdePkg/Library/StackCheckLibNull/StackCheckLibHostApplicationMsvc.c @@ -0,0 +1,13 @@ +/** @file + This file is empty to allow host applications + to use the MSVC C runtime lib that provides + stack cookie definitions without breaking the + build. + + Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +extern VOID *__security_cookie; -- cgit v1.2.3