Michael Ellerman f8b2336f15 powerpc: Avoid dead code/data elimination when using recordmcount
Although powerpc now has objtool mcount support, it's not enabled in all
configurations due to dependencies.

On those configurations, with some linkers (binutils 2.37 at least),
it's still possible to hit the dreaded "recordmcount bug", eg. errors
such as:

    CC      kernel/kexec_file.o
  Cannot find symbol for section 10: .text.unlikely.
  kernel/kexec_file.o: failed
  make[1]: *** [scripts/Makefile.build:287 : kernel/kexec_file.o] Error 1

Those errors are much more prevalent when building with
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION, because it places every function
in a separate section.

CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is marked experimental and is not
enabled in any powerpc defconfigs or by major distros. Although it does
have at least some users on 32-bit where kernel size tends to be more
important.

Avoid the build errors by blocking CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
when the build is using recordmcount, rather than objtool. In practice
that means for 64-bit big endian builds, or 64-bit clang builds - both
because they lack CONFIG_MPROFILE_KERNEL.

On 32-bit objtool is always used, so
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is still available there.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230221130331.2714199-1-mpe@ellerman.id.au
2023-02-28 14:32:34 +11:00
2023-02-24 12:58:55 -08:00
2023-02-21 18:24:12 -08:00
2023-02-25 11:00:06 -08:00
2023-02-25 11:00:06 -08:00
2023-02-25 09:19:23 -08:00
2023-02-25 09:19:23 -08:00
2023-02-25 09:19:23 -08:00
2023-02-24 12:17:14 -08:00
2023-02-20 10:40:42 -08:00
2023-02-24 12:58:55 -08:00
2023-02-24 13:31:53 -08:00
2023-02-25 11:00:06 -08:00
2023-02-24 17:29:52 -08:00
2023-02-25 11:00:06 -08:00
2023-01-23 11:56:07 -08:00
2022-12-14 09:15:43 -08:00
2022-12-30 17:22:14 +09:00
2022-09-28 09:02:20 +02:00
2022-10-10 12:00:45 -07:00
2023-02-24 13:31:53 -08:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
The linux-next integration testing tree
Readme
Languages
C 97.5%
Assembly 1%
Shell 0.6%
Python 0.3%
Makefile 0.3%