diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2020-03-01 15:51:31 +0100 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2020-03-01 16:02:49 +0100 |
commit | 854114800ce7636f4d7628774023e399154b04bc (patch) | |
tree | 435ca730cef13a3cc91bdede285645b700601b0d /target/linux/generic/backport-5.4 | |
parent | 6f9bc70dd584ed41dc1da31bf0342b3cf95ba5d9 (diff) | |
download | upstream-854114800ce7636f4d7628774023e399154b04bc.tar.gz upstream-854114800ce7636f4d7628774023e399154b04bc.tar.bz2 upstream-854114800ce7636f4d7628774023e399154b04bc.zip |
linux-5.4: backport ARM symbol export fix
Fixes the following warning for ARM targets:
WARNING: "return_address" [vmlinux] is a static EXPORT_SYMBOL_GPL
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-5.4')
-rw-r--r-- | target/linux/generic/backport-5.4/040-ARM-8918-2-only-build-return_address-if-needed.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.4/040-ARM-8918-2-only-build-return_address-if-needed.patch b/target/linux/generic/backport-5.4/040-ARM-8918-2-only-build-return_address-if-needed.patch new file mode 100644 index 0000000000..c9301f9c2a --- /dev/null +++ b/target/linux/generic/backport-5.4/040-ARM-8918-2-only-build-return_address-if-needed.patch @@ -0,0 +1,60 @@ +From fb033c95c94ca1ee3d16e04ebdb85d65fb55fff8 Mon Sep 17 00:00:00 2001 +From: Ben Dooks <ben-linux@fluff.org> +Date: Mon, 4 Nov 2019 18:15:15 +0100 +Subject: [PATCH] ARM: 8918/2: only build return_address() if needed + +The system currently warns if the config conditions for +building return_address in arch/arm/kernel/return_address.c +are not met, leaving just an EXPORT_SYMBOL_GPL(return_address) +of a function defined to be 'static linline'. +This is a result of aeea3592a13b ("ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h"). + +Since we're not going to build anything other than an exported +symbol for something that is already being defined to be an +inline-able return of NULL, just avoid building the code to +remove the following warning: + +Fixes: aeea3592a13b ("ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h") +Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> +Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> +--- + arch/arm/kernel/Makefile | 6 +++++- + arch/arm/kernel/return_address.c | 4 ---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/arm/kernel/Makefile ++++ b/arch/arm/kernel/Makefile +@@ -17,10 +17,14 @@ CFLAGS_REMOVE_return_address.o = -pg + # Object file lists. + + obj-y := elf.o entry-common.o irq.o opcodes.o \ +- process.o ptrace.o reboot.o return_address.o \ ++ process.o ptrace.o reboot.o \ + setup.o signal.o sigreturn_codes.o \ + stacktrace.o sys_arm.o time.o traps.o + ++ifneq ($(CONFIG_ARM_UNWIND),y) ++obj-$(CONFIG_FRAME_POINTER) += return_address.o ++endif ++ + obj-$(CONFIG_ATAGS) += atags_parse.o + obj-$(CONFIG_ATAGS_PROC) += atags_proc.o + obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o +--- a/arch/arm/kernel/return_address.c ++++ b/arch/arm/kernel/return_address.c +@@ -7,8 +7,6 @@ + */ + #include <linux/export.h> + #include <linux/ftrace.h> +- +-#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) + #include <linux/sched.h> + + #include <asm/stacktrace.h> +@@ -53,6 +51,4 @@ void *return_address(unsigned int level) + return NULL; + } + +-#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */ +- + EXPORT_SYMBOL_GPL(return_address); |