diff options
author | Naveen N Rao <naveen@kernel.org> | 2023-05-30 11:44:36 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-27 08:44:26 +0200 |
commit | 3d1d037f274940201b95d67dfc223b184cc009ce (patch) | |
tree | 2f8102952ad463597b3f57c3214254135c7d159d /arch/powerpc | |
parent | fe1ae1fb507a2e14578fe0fb24209cef8a02b436 (diff) | |
download | linux-stable-3d1d037f274940201b95d67dfc223b184cc009ce.tar.gz linux-stable-3d1d037f274940201b95d67dfc223b184cc009ce.tar.bz2 linux-stable-3d1d037f274940201b95d67dfc223b184cc009ce.zip |
powerpc: Fail build if using recordmcount with binutils v2.37
commit 25ea739ea1d4d3de41acc4f4eb2d1a97eee0eb75 upstream.
binutils v2.37 drops unused section symbols, which prevents recordmcount
from capturing mcount locations in sections that have no non-weak
symbols. This results in a build failure with a message such as:
Cannot find symbol for section 12: .text.perf_callchain_kernel.
kernel/events/callchain.o: failed
The change to binutils was reverted for v2.38, so this behavior is
specific to binutils v2.37:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c09c8b42021180eee9495bd50d8b35e683d3901b
Objtool is able to cope with such sections, so this issue is specific to
recordmcount.
Fail the build and print a warning if binutils v2.37 is detected and if
we are using recordmcount.
Cc: stable@vger.kernel.org
Suggested-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Naveen N Rao <naveen@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230530061436.56925-1-naveen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/Makefile | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index a3f66ade09b3..912e64ab5f24 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -429,3 +429,11 @@ checkbin: echo -n '*** Please use a different binutils version.' ; \ false ; \ fi + @if test "x${CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT}" = "xy" -a \ + "x${CONFIG_LD_IS_BFD}" = "xy" -a \ + "${CONFIG_LD_VERSION}" = "23700" ; then \ + echo -n '*** binutils 2.37 drops unused section symbols, which recordmcount ' ; \ + echo 'is unable to handle.' ; \ + echo '*** Please use a different binutils version.' ; \ + false ; \ + fi |