<div dir="ltr"><div dir="ltr">On Tue, Mar 29, 2022 at 2:05 PM lijiang <<a href="mailto:lijiang@redhat.com">lijiang@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Tue, Mar 29, 2022 at 1:22 PM Alexander Egorenkov <<a href="mailto:egorenar@linux.ibm.com" target="_blank">egorenar@linux.ibm.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Lianbo Jiang <<a href="mailto:lijiang@redhat.com" target="_blank">lijiang@redhat.com</a>> writes:<br>
<br>
> The commit <cd8954023bd4> broke crash-utility on s390x and got the<br>
> following error:<br>
><br>
>   crash: cannot resolve ".rodata"<br>
><br>
> The reason is that all symbols containing a "." may be filtered out<br>
> on s390x. To prevent the current failure, a simple way is to check<br>
> whether the symbol ".rodata" exists before calculating the value of<br>
> a symbol.<br>
><br>
> Fixes: cd8954023bd4 ("kernel: fix start-up time degradation caused by strings command")<br>
> Reported-by: Alexander Egorenkov <<a href="mailto:egorenar@linux.ibm.com" target="_blank">egorenar@linux.ibm.com</a>><br>
> Signed-off-by: Lianbo Jiang <<a href="mailto:lijiang@redhat.com" target="_blank">lijiang@redhat.com</a>><br>
> ---<br>
>  kernel.c | 3 +++<br>
>  1 file changed, 3 insertions(+)<br>
><br>
> diff --git a/kernel.c b/kernel.c<br>
> index 92434a3ffe2d..b504564846c7 100644<br>
> --- a/kernel.c<br>
> +++ b/kernel.c<br>
> @@ -11790,6 +11790,9 @@ int get_linux_banner_from_vmlinux(char *buf, size_t size)<br>
>       struct bfd_section *sect;<br>
>       long offset;<br>
>  <br>
> +     if (!symbol_exists(".rodata"))<br>
> +             return FALSE;<br>
> +<br>
>       sect = bfd_get_section_by_name(st->bfd, ".rodata");<br>
>       if (!sect)<br>
>               return FALSE;<br>
> -- <br>
> 2.20.1<br>
<br>
thanks! This works on s390x.<br></blockquote><div></div></div></div></blockquote><div><br></div><div><br></div><div>Sorry, my reply was truncated. How about the following changes?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> <br></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote">diff --git a/kernel.c b/kernel.c<br>index 92434a3ffe2d..b504564846c7 100644<br>--- a/kernel.c<br>+++ b/kernel.c<br>@@ -11790,6 +11790,9 @@ int get_linux_banner_from_vmlinux(char *buf, size_t size)<br>         struct bfd_section *sect;<br>    long offset;<br> <br>+     if (!symbol_exists(".rodata"))<br>+             return FALSE;<br>+<br>     sect = bfd_get_section_by_name(st->bfd, ".rodata");<br>     if (!sect)<br>           return FALSE;<br>diff --git a/s390.c b/s390.c<br>index 078b1a25724e..42f5cc63ae52 100644<br>--- a/s390.c<br>+++ b/s390.c<br>@@ -442,6 +442,9 @@ s390_verify_symbol(const char *name, ulong value, char type)<br>   if (strstr(name, "L2\002") == name)<br>              return FALSE;<br> <br>+    if (STREQ(name, ".rodata"))<br>+                return TRUE;<br>+<br>      /* throw away all symbols containing a '.' */<br>        for(i = 0; i < strlen(name);i++){<br>                 if(name[i] == '.')<br>diff --git a/s390x.c b/s390x.c<br>index c07d283d7f52..d7ee3755fc0b 100644<br>--- a/s390x.c<br>+++ b/s390x.c<br>@@ -1087,6 +1087,9 @@ s390x_verify_symbol(const char *name, ulong value, char type)<br>       if (strstr(name, "L2\002") == name)<br>              return FALSE;<br> <br>+    if (STREQ(name, ".rodata"))<br>+                return TRUE;<br>+<br>      /* throw away all symbols containing a '.' */<br>        for(i = 0; i < strlen(name);i++){<br>                 if(name[i] == '.') </div></div></blockquote></div></div>