FROMLIST: kbuild: fix dynamic ftrace with clang LTO
authorSami Tolvanen <samitolvanen@google.com>
Fri, 16 Jun 2017 19:52:57 +0000 (12:52 -0700)
committerSami Tolvanen <samitolvanen@google.com>
Thu, 26 Apr 2018 23:03:36 +0000 (16:03 -0700)
commit9abcee5156e441679298a03a5af29675c6161802
tree6f8912ddbb085add618a399b70c488ae4836c074
parentaf1f94d0afc1d5da04ad6327235f78b3a98f0736
FROMLIST: kbuild: fix dynamic ftrace with clang LTO

With CONFIG_LTO_CLANG enabled, LLVM IR won't be compiled into object
files until modpost_link. This change postpones calls to recordmcount
until after this step.

In order to exclude ftrace_process_locs from inspection, we add a new
code section .text..ftrace, which we tell recordmcount to ignore, and
a __norecordmcount attribute for moving functions to this section.

Bug: 62093296
Bug: 67506682
Change-Id: Iba2c053968206acf533fadab1eb34a743b5088ee
(am from https://patchwork.kernel.org/patch/10060327/)
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
arch/Kconfig
include/asm-generic/vmlinux.lds.h
include/linux/compiler-clang.h
include/linux/compiler_types.h
kernel/trace/ftrace.c
scripts/Makefile.build
scripts/Makefile.modpost
scripts/link-vmlinux.sh
scripts/recordmcount.c