Files
system76-edk2/StandaloneMmPkg/Core/StandaloneMmCore.inf
Ard Biesheuvel cdc686223a StandaloneMmPkg: generate position independent code for StMM core
The standalone MM core runs in a restricted environment that is set
up by a higher privilege level, and which may not allow memory regions
to be writable and executable at the same time.

This means that making the StMM core self-relocatable requires that
all the targets of the relocation fixups are outside of the executable
region of the image, given that we cannot remap the executable code
writable from the executable code itself without losing those execute
permissions.

So instead, use the existing toolchain support to ensure that position
independent code is used where possible, and that all the remaining
relocated quantities are emitted into the data section. (Note that
staticallly initialized const pointers will be emitted into the
.data.rel.ro section, which gets pulled into the .data section by
our linker script)

To ensure that we don't pick up any absolute references in executable
code inadvertently (e.g., in assembler code), add the '-z text' linker
option which will force the build to fail in this case.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2020-06-16 16:15:00 +00:00

82 lines
2.4 KiB
INI

## @file
# This module provide an SMM CIS compliant implementation of SMM Core.
#
# Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
INF_VERSION = 0x0001001A
BASE_NAME = StandaloneMmCore
FILE_GUID = 6E14B6FD-3600-4DD6-A17A-206B3B6DCE16
MODULE_TYPE = MM_CORE_STANDALONE
VERSION_STRING = 1.0
PI_SPECIFICATION_VERSION = 0x00010032
ENTRY_POINT = StandaloneMmMain
# VALID_ARCHITECTURES = IA32 X64 AARCH64
[Sources]
StandaloneMmCore.c
StandaloneMmCore.h
StandaloneMmCorePrivateData.h
Page.c
Pool.c
Handle.c
Locate.c
Notify.c
Dependency.c
Dispatcher.c
Mmi.c
InstallConfigurationTable.c
FwVol.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
StandaloneMmPkg/StandaloneMmPkg.dec
[LibraryClasses]
BaseLib
BaseMemoryLib
CacheMaintenanceLib
DebugLib
ExtractGuidedSectionLib
FvLib
HobLib
MemoryAllocationLib
MemLib
PeCoffLib
ReportStatusCodeLib
StandaloneMmCoreEntryPoint
[Protocols]
gEfiDxeMmReadyToLockProtocolGuid ## UNDEFINED # SmiHandlerRegister
gEfiMmReadyToLockProtocolGuid ## PRODUCES
gEfiMmEndOfDxeProtocolGuid ## PRODUCES
gEfiLoadedImageProtocolGuid ## PRODUCES
gEfiMmConfigurationProtocolGuid ## CONSUMES
[Guids]
gAprioriGuid ## SOMETIMES_CONSUMES ## File
gEfiEventDxeDispatchGuid ## PRODUCES ## GUID # SmiHandlerRegister
gEfiEndOfDxeEventGroupGuid ## PRODUCES ## GUID # SmiHandlerRegister
## SOMETIMES_CONSUMES ## GUID # Locate protocol
## SOMETIMES_PRODUCES ## GUID # SmiHandlerRegister
gEdkiiMemoryProfileGuid
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
gEfiHobListGuid
gEfiHobMemoryAllocModuleGuid
gMmCoreDataHobGuid
gMmFvDispatchGuid
gEfiEventLegacyBootGuid
gEfiEventExitBootServicesGuid
gEfiEventReadyToBootGuid
[BuildOptions]
GCC:*_*_*_CC_FLAGS = -fpie
GCC:*_*_*_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie