The CPU exception handler library code was rewritten at some point to populate the vector code templates with absolute references at runtime, given that the XCODE linker does not permit absolute references in executable code when creating PIE executables. This is rather unfortunate, as this prevents us from using strict permissions on the memory mappings, given that the .text section needs to be writable at runtime for this arrangement to work. So let's make this hack XCODE-only, by setting a preprocessor #define from the command line when using the XCODE toolchain, and only including the runtime fixup code when the macro is defined. While at it, rename the Xcode5ExceptionHandlerAsm.nasm source file and drop the Xcode5 prefix: this code is used by other toolchains too. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Ray Ni <ray.ni@intel.com>
67 lines
1.7 KiB
INI
67 lines
1.7 KiB
INI
## @file
|
|
# CPU Exception Handler library instance for DXE modules.
|
|
#
|
|
# Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
#
|
|
##
|
|
|
|
[Defines]
|
|
INF_VERSION = 0x00010005
|
|
BASE_NAME = DxeCpuExceptionHandlerLib
|
|
MODULE_UNI_FILE = DxeCpuExceptionHandlerLib.uni
|
|
FILE_GUID = B6E9835A-EDCF-4748-98A8-27D3C722E02D
|
|
MODULE_TYPE = DXE_DRIVER
|
|
VERSION_STRING = 1.1
|
|
LIBRARY_CLASS = CpuExceptionHandlerLib|DXE_CORE DXE_DRIVER UEFI_APPLICATION
|
|
|
|
#
|
|
# The following information is for reference only and not required by the build tools.
|
|
#
|
|
# VALID_ARCHITECTURES = IA32 X64
|
|
#
|
|
|
|
[Sources.Ia32]
|
|
Ia32/ExceptionHandlerAsm.nasm
|
|
Ia32/ExceptionTssEntryAsm.nasm
|
|
Ia32/ArchExceptionHandler.c
|
|
Ia32/ArchInterruptDefs.h
|
|
|
|
[Sources.X64]
|
|
X64/ExceptionHandlerAsm.nasm
|
|
X64/ArchExceptionHandler.c
|
|
X64/ArchInterruptDefs.h
|
|
|
|
[Sources.common]
|
|
CpuExceptionCommon.h
|
|
CpuExceptionCommon.c
|
|
PeiDxeSmmCpuException.c
|
|
DxeException.c
|
|
|
|
[Pcd]
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard
|
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList
|
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize
|
|
|
|
[FeaturePcd]
|
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard ## CONSUMES
|
|
|
|
[Packages]
|
|
MdePkg/MdePkg.dec
|
|
MdeModulePkg/MdeModulePkg.dec
|
|
UefiCpuPkg/UefiCpuPkg.dec
|
|
|
|
[LibraryClasses]
|
|
BaseLib
|
|
SerialPortLib
|
|
PrintLib
|
|
SynchronizationLib
|
|
LocalApicLib
|
|
PeCoffGetEntryPointLib
|
|
MemoryAllocationLib
|
|
DebugLib
|
|
CcExitLib
|
|
|
|
[BuildOptions]
|
|
XCODE:*_*_X64_NASM_FLAGS = -D NO_ABSOLUTE_RELOCS_IN_TEXT
|