From a464579fb3c8025b53c786f235c1cfcb4f1a15a8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Sep 2021 08:57:18 +0200 Subject: [PATCH] 4.4-stable patches added patches: arm-8918-2-only-build-return_address-if-needed.patch --- ...-only-build-return_address-if-needed.patch | 65 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 66 insertions(+) create mode 100644 queue-4.4/arm-8918-2-only-build-return_address-if-needed.patch diff --git a/queue-4.4/arm-8918-2-only-build-return_address-if-needed.patch b/queue-4.4/arm-8918-2-only-build-return_address-if-needed.patch new file mode 100644 index 00000000000..dce058662af --- /dev/null +++ b/queue-4.4/arm-8918-2-only-build-return_address-if-needed.patch @@ -0,0 +1,65 @@ +From fb033c95c94ca1ee3d16e04ebdb85d65fb55fff8 Mon Sep 17 00:00:00 2001 +From: Ben Dooks +Date: Mon, 4 Nov 2019 18:15:15 +0100 +Subject: ARM: 8918/2: only build return_address() if needed + +From: Ben Dooks + +commit fb033c95c94ca1ee3d16e04ebdb85d65fb55fff8 upstream. + +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 +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -16,10 +16,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 +@@ -10,8 +10,6 @@ + */ + #include + #include +- +-#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) + #include + + #include +@@ -56,6 +54,4 @@ void *return_address(unsigned int level) + return NULL; + } + +-#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */ +- + EXPORT_SYMBOL_GPL(return_address); diff --git a/queue-4.4/series b/queue-4.4/series index bce55b09d30..b7666926f62 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -3,3 +3,4 @@ xtensa-fix-kconfig-unmet-dependency-warning-for-have_futex_cmpxchg.patch arc-fix-allnoconfig-build-warning.patch qede-fix-memset-corruption.patch cryptoloop-add-a-deprecation-warning.patch +arm-8918-2-only-build-return_address-if-needed.patch -- 2.47.3