aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/hack-4.9
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-10-18 22:46:29 +0200
committerFelix Fietkau <nbd@nbd.name>2017-10-18 22:59:05 +0200
commit7c42f15c2406481784d654d99244539d71522582 (patch)
tree82e1447bc5c28214303d9a89c6fa7a2f2a7012cf /target/linux/generic/hack-4.9
parent36d2884d553aa4cc98b1df5ed43a16ab336dd660 (diff)
downloadupstream-7c42f15c2406481784d654d99244539d71522582.tar.gz
upstream-7c42f15c2406481784d654d99244539d71522582.tar.bz2
upstream-7c42f15c2406481784d654d99244539d71522582.zip
kernel: fix ftrace support on 4.9
When porting the kernel patches from 4.4 to 4.9, they were missing a small chunk that ensures that ftrace sections are kept in the vmlinux image, even when linked with --gc-sections Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/generic/hack-4.9')
-rw-r--r--target/linux/generic/hack-4.9/220-gc_sections.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch
index 428fcb6501..eda8bb8b2b 100644
--- a/target/linux/generic/hack-4.9/220-gc_sections.patch
+++ b/target/linux/generic/hack-4.9/220-gc_sections.patch
@@ -201,6 +201,33 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
+@@ -105,7 +105,7 @@
+ #ifdef CONFIG_FTRACE_MCOUNT_RECORD
+ #define MCOUNT_REC() . = ALIGN(8); \
+ VMLINUX_SYMBOL(__start_mcount_loc) = .; \
+- *(__mcount_loc) \
++ KEEP(*(__mcount_loc)) \
+ VMLINUX_SYMBOL(__stop_mcount_loc) = .;
+ #else
+ #define MCOUNT_REC()
+@@ -113,7 +113,7 @@
+
+ #ifdef CONFIG_TRACE_BRANCH_PROFILING
+ #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \
+- *(_ftrace_annotated_branch) \
++ KEEP(*(_ftrace_annotated_branch)) \
+ VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .;
+ #else
+ #define LIKELY_PROFILE()
+@@ -121,7 +121,7 @@
+
+ #ifdef CONFIG_PROFILE_ALL_BRANCHES
+ #define BRANCH_PROFILE() VMLINUX_SYMBOL(__start_branch_profile) = .; \
+- *(_ftrace_branch) \
++ KEEP(*(_ftrace_branch)) \
+ VMLINUX_SYMBOL(__stop_branch_profile) = .;
+ #else
+ #define BRANCH_PROFILE()
@@ -130,7 +130,7 @@
#ifdef CONFIG_KPROBES
#define KPROBE_BLACKLIST() . = ALIGN(8); \