Skip to content

Commit 25ea739

Browse files
rnavmpe
authored andcommitted
powerpc: Fail build if using recordmcount with binutils v2.37
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: [email protected] Suggested-by: Joel Stanley <[email protected]> Signed-off-by: Naveen N Rao <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent d61cd13 commit 25ea739

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/powerpc/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,3 +409,11 @@ checkbin:
409409
echo -n '*** Please use a different binutils version.' ; \
410410
false ; \
411411
fi
412+
@if test "x${CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT}" = "xy" -a \
413+
"x${CONFIG_LD_IS_BFD}" = "xy" -a \
414+
"${CONFIG_LD_VERSION}" = "23700" ; then \
415+
echo -n '*** binutils 2.37 drops unused section symbols, which recordmcount ' ; \
416+
echo 'is unable to handle.' ; \
417+
echo '*** Please use a different binutils version.' ; \
418+
false ; \
419+
fi

0 commit comments

Comments
 (0)