crash/0059-RISCV64-Add-the-implementation-of-symbol-verify.patch
Lianbo Jiang b6407a85f0 Release: crash-7.3.2-5
Update to the latest upstream commit 47216437e79a ("Fix "net" command on
kernel configured with CONFIG_IPV6=m")

Resolves: rhbz#2166880
Resolves: rhbz#2161133
Resolves: rhbz#2158721
Resolves: rhbz#2156904
Resolves: rhbz#2156898
Resolves: rhbz#2156892
Resolves: rhbz#2156889
Resolves: rhbz#2156885
Resolves: rhbz#2152619

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
2023-05-08 17:08:25 +08:00

46 lines
1.2 KiB
Diff

From ba2d96e12463157fe2ed9c134ad9cf42481427e8 Mon Sep 17 00:00:00 2001
From: Xianting Tian <xianting.tian@linux.alibaba.com>
Date: Thu, 20 Oct 2022 09:50:14 +0800
Subject: [PATCH 59/89] RISCV64: Add the implementation of symbol verify
Verify the symbol to accept or reject a symbol from the kernel namelist.
Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
---
riscv64.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/riscv64.c b/riscv64.c
index ff77e41b9407..6b9a68840d4c 100644
--- a/riscv64.c
+++ b/riscv64.c
@@ -165,10 +165,23 @@ riscv64_cmd_mach(void)
riscv64_display_machine_stats();
}
+/*
+ * Accept or reject a symbol from the kernel namelist.
+ */
static int
riscv64_verify_symbol(const char *name, ulong value, char type)
{
- /* TODO: */
+ if (CRASHDEBUG(8) && name && strlen(name))
+ fprintf(fp, "%08lx %s\n", value, name);
+
+ if (!(machdep->flags & KSYMS_START)) {
+ if (STREQ(name, "_text") || STREQ(name, "_stext"))
+ machdep->flags |= KSYMS_START;
+
+ return (name && strlen(name) && !STRNEQ(name, "__func__.") &&
+ !STRNEQ(name, "__crc_"));
+ }
+
return TRUE;
}
--
2.37.1