The commit <cd8954023bd4> broke crash-utility on s390x and got the
following error:

  crash: cannot resolve ".rodata"

The reason is that all symbols containing a "." may be filtered out
on s390x. To prevent the current failure, a simple way is to check
whether the symbol ".rodata" exists before calculating the value of
a symbol.

Fixes: cd8954023bd4 ("kernel: fix start-up time degradation caused by strings 
command")
Reported-by: Alexander Egorenkov <[email protected]>
Signed-off-by: Lianbo Jiang <[email protected]>
---
 kernel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel.c b/kernel.c
index 92434a3ffe2d..b504564846c7 100644
--- a/kernel.c
+++ b/kernel.c
@@ -11790,6 +11790,9 @@ int get_linux_banner_from_vmlinux(char *buf, size_t 
size)
        struct bfd_section *sect;
        long offset;
 
+       if (!symbol_exists(".rodata"))
+               return FALSE;
+
        sect = bfd_get_section_by_name(st->bfd, ".rodata");
        if (!sect)
                return FALSE;
-- 
2.20.1

--
Crash-utility mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to