ANDROID: 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: 145210207 Change-Id: Ib77f7c431fce54243c46d584b55761ed2342965c Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
@@ -48,3 +48,10 @@
|
||||
#else
|
||||
# define __noscs
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LTO_CLANG
|
||||
#ifdef CONFIG_FTRACE_MCOUNT_RECORD
|
||||
#define __norecordmcount \
|
||||
__attribute__((__section__(".text..ftrace")))
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user