From c5f816e16ae59b4832d7c35041fcc9338997b6af Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Thu, 10 Oct 2024 18:28:18 +0800 Subject: [PATCH] libc/machine: Fix the error caused by tag kasan Use address addition and subtraction, no longer as the return value of the address. Tags must be removed before calculation Signed-off-by: wangmingrong1 --- libs/libc/machine/arm64/arch_elf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/libc/machine/arm64/arch_elf.c b/libs/libc/machine/arm64/arch_elf.c index 41d8032762..8dd4a0b3f9 100644 --- a/libs/libc/machine/arm64/arch_elf.c +++ b/libs/libc/machine/arm64/arch_elf.c @@ -33,6 +33,7 @@ #include #include #include +#include /**************************************************************************** * Pre-processor Definitions @@ -181,6 +182,9 @@ aarch64_insn_encode_immediate(enum insn_imm_type_e type, static uint64_t do_reloc(enum reloc_op_e op, uintptr_t place, uint64_t val) { + val = (uint64_t)kasan_reset_tag((FAR const void *)val); + place = (uint64_t)kasan_reset_tag((FAR const void *)place); + switch (op) { case RELOC_OP_ABS: