From f347aa8c3da299a25c49dbfa533958985cfa46be Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Mon, 19 Sep 2022 15:10:31 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Make gen-hyprel emit delimiters The start and end pointers of the hyp relocs section are currently specified in the vmlinux linker script. In order to ease re-using the same relocation procedure for hypervisor modules, emit the delimiters from the generated hyp-reloc.S file directly. Bug: 244543039 Bug: 244373730 Change-Id: I845af2d40e1dd13301069537c6325f6a6f381ce4 Signed-off-by: Quentin Perret --- arch/arm64/tools/gen-hyprel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm64/tools/gen-hyprel.c b/arch/arm64/tools/gen-hyprel.c index 6bc88a756cb7..fa719b6c6d54 100644 --- a/arch/arm64/tools/gen-hyprel.c +++ b/arch/arm64/tools/gen-hyprel.c @@ -296,8 +296,10 @@ static void init_elf(const char *path) /* Print the prologue of the output ASM file. */ static void emit_prologue(void) { - printf(".data\n" - ".pushsection " HYP_RELOC_SECTION ", \"a\"\n"); + printf("#include \n" + ".data\n" + ".pushsection " HYP_RELOC_SECTION ", \"a\"\n" + "SYM_ENTRY(__hyprel_start, SYM_L_GLOBAL, SYM_A_NONE)\n"); } /* Print ASM statements needed as a prologue to a processed hyp section. */ @@ -347,7 +349,8 @@ static void emit_rela_abs64(Elf64_Rela *rela, const char *sh_orig_name) /* Print the epilogue of the output ASM file. */ static void emit_epilogue(void) { - printf(".popsection\n"); + printf("SYM_ENTRY(__hyprel_end, SYM_L_GLOBAL, SYM_A_NONE)\n" + ".popsection\n"); } /*