The xx.cold symbols are generated by compiler to optimize the
frequently/infrequently called routines, rather than real function
names. We'd better filter out those, because it will interfer the
sp = value_search(text, &offset) call.
For value_search(), normally we are expecting to get the offset of text
from an actual function. With xx.cold symbol exists, it might show we
are at offset 0 of xx.cold, so crash might regard this as the start of a
function, and make incorrect decisions.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
---
x86_64.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/x86_64.c b/x86_64.c
index 70bc1da..95abae6 100644
--- a/x86_64.c
+++ b/x86_64.c
@@ -2745,6 +2745,9 @@ x86_64_verify_symbol(const char *name, ulong value, char type)
if (XEN_HYPER_MODE() && STREQ(name, "__per_cpu_shift"))
return TRUE;
+ if (strlen(name) > 5 && STREQ(name + strlen(name) - 5, ".cold"))
+ return FALSE;
+
if (!(machdep->flags & KSYMS_START)) {
if (STREQ(name, "_text") || STREQ(name, "_stext")) {
machdep->flags |= KSYMS_START;
--
2.47.0