audk/StandaloneMmPkg/Core
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
..
Dependency.c StandaloneMmPkg: Fix few typos 2020-02-10 22:30:07 +00:00
Dispatcher.c StandaloneMmPkg/Core: fix bogus FV pointer in DEBUG string 2020-06-16 16:15:00 +00:00
FwVol.c StandaloneMmPkg: Fix few typos 2020-02-10 22:30:07 +00:00
Handle.c StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
InstallConfigurationTable.c StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
Locate.c StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
Mmi.c StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
Notify.c StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
Page.c StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
Pool.c StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00
StandaloneMmCore.c StandaloneMmPkg: Fix few typos 2020-02-10 22:30:07 +00:00
StandaloneMmCore.h StandaloneMmPkg: switch to MM communicate 2 protocol 2020-05-12 19:23:44 +00:00
StandaloneMmCore.inf StandaloneMmPkg: generate position independent code for StMM core 2020-06-16 16:15:00 +00:00
StandaloneMmCorePrivateData.h StandaloneMmPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:27 -07:00