From b16fd231f6d8124fa05a0f086840934b8709faf9 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Mon, 8 Jun 2020 13:07:54 +0200 Subject: 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 Acked-by: Jiewen Yao Acked-by: Laszlo Ersek Acked-by: Sami Mujawar --- ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf') diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf index 9e58e56fce..7edf501808 100755 --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf @@ -46,6 +46,7 @@ SerialPortLib ExtractGuidedSectionLib LzmaDecompressLib + PeCoffLib PrePiLib MemoryAllocationLib HobLib @@ -95,6 +96,3 @@ gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gArmTokenSpaceGuid.PcdFdBaseAddress gArmTokenSpaceGuid.PcdFvBaseAddress - -[BuildOptions] - GCC:*_*_*_DLINK_FLAGS = -Wl,-Bsymbolic,-pie,-T,$(MODULE_DIR)/Scripts/PrePi-PIE.lds -- cgit v1.2.3