summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/ArmVirtQemuKernel.dsc
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@arm.com>2020-06-08 13:07:54 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-06-12 22:17:46 +0000
commitb16fd231f6d8124fa05a0f086840934b8709faf9 (patch)
treeacd28e0fb051819aa22845af2b99360905c25c90 /ArmVirtPkg/ArmVirtQemuKernel.dsc
parentfd708fe0e1f813d6faf02d92ec5e8d73ce876ed1 (diff)
downloadedk2-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/ArmVirtQemuKernel.dsc')
-rw-r--r--ArmVirtPkg/ArmVirtQemuKernel.dsc10
1 files changed, 4 insertions, 6 deletions
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 2a6fd6bc06..9449a01d6e 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -83,14 +83,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
################################################################################
#