Revert: PowerPC: Don't generate unused section symbols

Alan Modra amodra@gmail.com
Sun Jul 25 02:21:55 GMT 2021


On Sat, Jul 24, 2021 at 09:34:47AM -0700, Fangrui Song wrote:
> On 2021-07-24, Alan Modra via Binutils wrote:
> > Blindly following x86 broke linux kernel builds.
> 
> Can the root cause in the Linux kernel be fixed instead?

Probably.  The problem is triggered by enabling CONFIG_FUNCTION_TRACER
on a target that does not have -mrecord-mcount implemented in the
compiler.  Under those conditions the tool recordmcount is used and
complains if it can't find a non-weak symbol in each section that
might have kernel _mcount calls.

> ClangBuiltLinux has some PowerPC configurations with clang and its
> integrated assembler (which suppresses unused STT_SECTION):
> https://github.com/ClangBuiltLinux/continuous-integration2/runs/3150620586?check_suite_focus=true

I saw the fail compiling on an x86_64 host with
make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- ppc64le_defconfig prepare
make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- V=1 -j32 &> make.log

So nothing unusual about the kernel config.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list