[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <efc0e15e-fc93-fb59-068d-602f96ec7431@csgroup.eu>
Date: Fri, 26 Nov 2021 08:43:23 +0000
From: LEROY Christophe <christophe.leroy@...roup.eu>
To: Peter Zijlstra <peterz@...radead.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH] recordmcount: Support empty section from recent binutils
Le 24/11/2021 à 15:43, Christophe Leroy a écrit :
> Looks like recent binutils (2.36 and over ?) may empty some section,
> leading to failure like:
>
> Cannot find symbol for section 11: .text.unlikely.
> kernel/kexec_file.o: failed
> make[1]: *** [scripts/Makefile.build:287: kernel/kexec_file.o] Error 1
>
> In order to avoid that, ensure that the section has a content before
> returning it's name in has_rel_mcount().
This patch doesn't work, on PPC32 I get the following message with this
patch applied:
[ 0.000000] ftrace: No functions to be traced?
Without the patch I get:
[ 0.000000] ftrace: allocating 22381 entries in 66 pages
[ 0.000000] ftrace: allocated 66 pages with 2 groups
Christophe
>
> Suggested-by: Steven Rostedt <rostedt@...dmis.org>
> Link: https://github.com/linuxppc/issues/issues/388
> Link: https://lore.kernel.org/all/20210215162209.5e2a475b@gandalf.local.home/
> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
> ---
> scripts/recordmcount.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
> index 1e9baa5c4fc6..cc6600b729ae 100644
> --- a/scripts/recordmcount.h
> +++ b/scripts/recordmcount.h
> @@ -575,6 +575,8 @@ static char const *has_rel_mcount(Elf_Shdr const *const relhdr,
> char const *const shstrtab,
> char const *const fname)
> {
> + if (!shdr0->sh_size)
> + return NULL;
> if (w(relhdr->sh_type) != SHT_REL && w(relhdr->sh_type) != SHT_RELA)
> return NULL;
> return __has_rel_mcount(relhdr, shdr0, shstrtab, fname);
>
Powered by blists - more mailing lists