hv: add code to fixup ELF relocation sections

For UEFI boot, currently EFI application loads hypervisor to the
hard coded COMNFIG_RAM_START, which may cause it fail to boot if
this address is not available in the target.

This patch series resolve this issue by allocating memory for hypervisor
at run time, and do relocation fixup if the allocated address is
different from the base address that the hypervisor is built.

The summary of the first patch [1/6] in this series:

In x86_64 ELF, .rela sections hold information of symbols which must be
relocated before being referenced.

This patch adds code to fixup .rela sections with the relocated offset,
also, it provides utilities to assist address fixup

Signed-off-by: Zheng Gen <gen.zheng@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Zide Chen
2018-06-22 08:15:12 -07:00
committed by lijinxia
parent b52be90a2f
commit ca728fb3c5
3 changed files with 156 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ OBJCOPY ?= objcopy
D_SRCS += $(wildcard debug/*.c)
C_SRCS += boot/acpi.c
C_SRCS += boot/dmar_parse.c
C_SRCS += boot/reloc.c
C_SRCS += arch/x86/ioapic.c
C_SRCS += arch/x86/lapic.c
S_SRCS += arch/x86/trampoline.S