mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
HV: build: make relocation-related code configurable
The relocation feature relies on the ld option "-z noreloc-overflow" which is only available for binutils >= 2.27, while on Ubuntu 16.04 or older the default version of binutils is 2.26. This patch wraps the relocation code with a configurable macro and make it undefined by default to avoid default build failures. NOTE: This is just a hotfix. The code dropped with undefined CONFIG_RELOC needs to be reviewed by the original author of this feature. Checks to the binutils version will also follow up. Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
@@ -68,6 +68,7 @@ static uint64_t trampoline_relo_addr(void *addr)
|
||||
return (uint64_t)addr - get_hv_image_delta();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RELOC
|
||||
void _relocate(void)
|
||||
{
|
||||
struct Elf64_Dyn *dyn;
|
||||
@@ -136,6 +137,11 @@ void _relocate(void)
|
||||
start = (struct Elf64_Rel *)((char *)start + size);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void _relocate(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
uint64_t read_trampoline_sym(void *sym)
|
||||
{
|
||||
|
Reference in New Issue
Block a user