]> git.proxmox.com Git - mirror_edk2.git/commit
ArmVirtPkg/PrePi: use standard PeCoff routines for self-relocation
authorArd Biesheuvel <ard.biesheuvel@arm.com>
Mon, 8 Jun 2020 11:07:54 +0000 (13:07 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 12 Jun 2020 22:17:46 +0000 (22:17 +0000)
commitb16fd231f6d8124fa05a0f086840934b8709faf9
treeacd28e0fb051819aa22845af2b99360905c25c90
parentfd708fe0e1f813d6faf02d92ec5e8d73ce876ed1
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>
ArmVirtPkg/ArmVirtQemuKernel.dsc
ArmVirtPkg/ArmVirtXen.dsc
ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
ArmVirtPkg/PrePi/PrePi.c