public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: lto: add _mcount to list of used symbols
@ 2021-02-25 14:34 Arnd Bergmann
  2021-02-25 20:00 ` Masahiro Yamada
  2021-02-25 20:14 ` Kees Cook
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-02-25 14:34 UTC (permalink / raw)
  To: Kees Cook, Sami Tolvanen; +Cc: Arnd Bergmann, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Some randconfig builds fail with undefined references to _mcount
when CONFIG_TRIM_UNUSED_KSYMS is set:

ERROR: modpost: "_mcount" [drivers/tee/optee/optee.ko] undefined!
ERROR: modpost: "_mcount" [drivers/fsi/fsi-occ.ko] undefined!
ERROR: modpost: "_mcount" [drivers/fpga/dfl-pci.ko] undefined!

Since there is already a list of symbols that get generated at link
time, add this one as well.

Fixes: fbe078d397b4 ("kbuild: lto: add a default list of used symbols")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 scripts/lto-used-symbollist.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/lto-used-symbollist.txt b/scripts/lto-used-symbollist.txt
index 38e7bb9ebaae..406ada65e926 100644
--- a/scripts/lto-used-symbollist.txt
+++ b/scripts/lto-used-symbollist.txt
@@ -1,5 +1,6 @@
 memcpy
 memmove
 memset
+_mcount
 __stack_chk_fail
 __stack_chk_guard
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kbuild: lto: add _mcount to list of used symbols
  2021-02-25 14:34 [PATCH] kbuild: lto: add _mcount to list of used symbols Arnd Bergmann
@ 2021-02-25 20:00 ` Masahiro Yamada
  2021-02-25 20:14 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2021-02-25 20:00 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kees Cook, Sami Tolvanen, Arnd Bergmann,
	Linux Kernel Mailing List

On Thu, Feb 25, 2021 at 11:35 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> Some randconfig builds fail with undefined references to _mcount
> when CONFIG_TRIM_UNUSED_KSYMS is set:
>
> ERROR: modpost: "_mcount" [drivers/tee/optee/optee.ko] undefined!
> ERROR: modpost: "_mcount" [drivers/fsi/fsi-occ.ko] undefined!
> ERROR: modpost: "_mcount" [drivers/fpga/dfl-pci.ko] undefined!
>
> Since there is already a list of symbols that get generated at link
> time, add this one as well.
>
> Fixes: fbe078d397b4 ("kbuild: lto: add a default list of used symbols")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  scripts/lto-used-symbollist.txt | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/scripts/lto-used-symbollist.txt b/scripts/lto-used-symbollist.txt
> index 38e7bb9ebaae..406ada65e926 100644
> --- a/scripts/lto-used-symbollist.txt
> +++ b/scripts/lto-used-symbollist.txt
> @@ -1,5 +1,6 @@
>  memcpy
>  memmove
>  memset
> +_mcount
>  __stack_chk_fail
>  __stack_chk_guard
> --
> 2.29.2
>


Applied to linux-kbuild/fixes. Thanks.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kbuild: lto: add _mcount to list of used symbols
  2021-02-25 14:34 [PATCH] kbuild: lto: add _mcount to list of used symbols Arnd Bergmann
  2021-02-25 20:00 ` Masahiro Yamada
@ 2021-02-25 20:14 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2021-02-25 20:14 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Sami Tolvanen, Arnd Bergmann, linux-kernel

On Thu, Feb 25, 2021 at 03:34:49PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Some randconfig builds fail with undefined references to _mcount
> when CONFIG_TRIM_UNUSED_KSYMS is set:
> 
> ERROR: modpost: "_mcount" [drivers/tee/optee/optee.ko] undefined!
> ERROR: modpost: "_mcount" [drivers/fsi/fsi-occ.ko] undefined!
> ERROR: modpost: "_mcount" [drivers/fpga/dfl-pci.ko] undefined!
> 
> Since there is already a list of symbols that get generated at link
> time, add this one as well.
> 
> Fixes: fbe078d397b4 ("kbuild: lto: add a default list of used symbols")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks!

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-25 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-25 14:34 [PATCH] kbuild: lto: add _mcount to list of used symbols Arnd Bergmann
2021-02-25 20:00 ` Masahiro Yamada
2021-02-25 20:14 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox