From f0390f7bf14c1f5fe1205dc12185896150c70756 Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Sun, 27 Oct 2024 08:52:42 -0700 Subject: UefiCpuPkg: Make the ResetVector USER_DEFINED The x86 reset vector is the initial FW code to run on an AP. It should not link to any libraries and is implemented entirely in assembly. This module is currently labled as SEC, because it runs during the SEC phase, but by having it SEC, it will be linked to all NULL libraries linked globally. This causes issue with StackCheckLib (though any NULL library being applied globally has the same issue) because BaseTools will attempt to link the library and add an extern to _ModuleEntryPoint, which does not exist for this module. Moving this module to USER_DEFINED instructs BaseTools to not link any NULL libraries to it, which is the desired behavior, and leads to a much cleaner global NULL library implementation, in this case for StackCheckLib. This change was tested on OVMF IA32/X64 and proved to work as before. Signed-off-by: Oliver Smith-Denny --- UefiCpuPkg/ResetVector/FixupVtf/Vtf.inf | 2 +- UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/ResetVector/FixupVtf/Vtf.inf b/UefiCpuPkg/ResetVector/FixupVtf/Vtf.inf index 02645d8682..86de6f168c 100644 --- a/UefiCpuPkg/ResetVector/FixupVtf/Vtf.inf +++ b/UefiCpuPkg/ResetVector/FixupVtf/Vtf.inf @@ -13,7 +13,7 @@ INF_VERSION = 0x00010005 BASE_NAME = ResetVector FILE_GUID = 1BA0062E-C779-4582-8566-336AE8F78F09 - MODULE_TYPE = SEC + MODULE_TYPE = USER_DEFINED VERSION_STRING = 1.1 MODULE_UNI_FILE = ResetVector.uni diff --git a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf index 6b406163db..7d0b99f42a 100644 --- a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf +++ b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf @@ -28,7 +28,7 @@ INF_VERSION = 0x00010005 BASE_NAME = ResetVector FILE_GUID = 1BA0062E-C779-4582-8566-336AE8F78F09 - MODULE_TYPE = SEC + MODULE_TYPE = USER_DEFINED VERSION_STRING = 1.1 MODULE_UNI_FILE = ResetVector.uni -- cgit v1.2.3