hv: further fix to configurable relocatoin

commit ia23549aa915e7dc2c ("build: make relocation-related code
configurable") adds CONFIG_RELOC to make relocation configurable

This patch corrects the behavior when CONFIG_RELOC is disabled
- Don't use "CFLAGS += -fpie" and put back "LDFLAGS += -static"
- __emalloc(): forced to allocate exactly the asked address, which is
  CONFIG_RAM_START
This commit is contained in:
Zide Chen
2018-07-11 11:18:29 -07:00
committed by lijinxia
parent 944776f238
commit 621425da20
3 changed files with 14 additions and 7 deletions

View File

@@ -68,9 +68,9 @@ static uint64_t trampoline_relo_addr(void *addr)
return (uint64_t)addr - get_hv_image_delta();
}
#ifdef CONFIG_RELOC
void _relocate(void)
{
#ifdef CONFIG_RELOC
struct Elf64_Dyn *dyn;
struct Elf64_Rel *start = NULL, *end = NULL;
uint64_t delta, size = 0;
@@ -136,12 +136,8 @@ void _relocate(void)
}
start = (struct Elf64_Rel *)((char *)start + size);
}
}
#else
void _relocate(void)
{
}
#endif
}
uint64_t read_trampoline_sym(void *sym)
{