diff options
author | Ard Biesheuvel <ard.biesheuvel@arm.com> | 2020-06-08 13:07:54 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-06-12 22:17:46 +0000 |
commit | b16fd231f6d8124fa05a0f086840934b8709faf9 (patch) | |
tree | acd28e0fb051819aa22845af2b99360905c25c90 /ArmVirtPkg/ArmVirtXen.dsc | |
parent | fd708fe0e1f813d6faf02d92ec5e8d73ce876ed1 (diff) | |
download | edk2-b16fd231f6d8124fa05a0f086840934b8709faf9.tar.gz edk2-b16fd231f6d8124fa05a0f086840934b8709faf9.tar.bz2 edk2-b16fd231f6d8124fa05a0f086840934b8709faf9.zip |
ArmVirtPkg/PrePi: use standard PeCoff routines for self-relocation
Instead of having a GCC specific routine to perform self-relocation
based on ELF metadata, use the PE/COFF metadata and the existing
PeCoff library routines. This reduces the amount of bespoke assembler
code that is a burden to maintain, and is not portable across the set
of toolchains we support.
This does require some special care, as we have no control over how
the C code references global symbols, so we need to emit these
references from the calling assembler code. Otherwise, they may be
emitted as absolute references, in which case they need to be fixed
up themselves, leading to a circular dependency.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Sami Mujawar <Sami.Mujawar@arm.com>
Diffstat (limited to 'ArmVirtPkg/ArmVirtXen.dsc')
-rw-r--r-- | ArmVirtPkg/ArmVirtXen.dsc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index 8a489b2536..278f5d3828 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -52,14 +52,12 @@ [LibraryClasses.common.UEFI_DRIVER]
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
-[BuildOptions.common.EDKII.SEC, BuildOptions.common.EDKII.BASE]
+[BuildOptions]
#
- # CLANG38 with LTO support enabled uses the GNU GOLD linker, which insists
- # on emitting GOT based symbol references when running in shared mode, unless
- # we override visibility to 'hidden' in all modules that make up the PrePi
- # build.
+ # We need to avoid jump tables in SEC modules, so that the PE/COFF
+ # self-relocation code itself is guaranteed to be position independent.
#
- GCC:*_CLANG38_*_CC_FLAGS = -include $(WORKSPACE)/ArmVirtPkg/Include/Platform/Hidden.h
+ GCC:*_*_*_CC_FLAGS = -fno-jump-tables
################################################################################
#
|