Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds

commit d65283f7b695b5 added mod->arch.secstr under
CONFIG_ARC_DW2_UNWIND, but used it unconditionally which broke builds
when the option was disabled. Fix that by adjusting the #ifdef guard.

And while at it add a missing guard (for unwinder) in module.c as well

Reported-by: Waldemar Brodkorb <wbx@openadk.org>
Cc: stable@vger.kernel.org #4.9
Fixes: d65283f7b695b5 ("ARC: module: elide loop to save reference to .eh_frame")
Tested-by: Anton Kolesov <akolesov@synopsys.com>
Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com>
[abrodkin: provided fixlet to Kconfig per failure in allnoconfig build]
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

+6 -4
+1 -1
arch/arc/Kconfig
··· 29 29 select HAVE_KPROBES 30 30 select HAVE_KRETPROBES 31 31 select HAVE_MEMBLOCK 32 - select HAVE_MOD_ARCH_SPECIFIC if ARC_DW2_UNWIND 32 + select HAVE_MOD_ARCH_SPECIFIC 33 33 select HAVE_OPROFILE 34 34 select HAVE_PERF_EVENTS 35 35 select HANDLE_DOMAIN_IRQ
+2 -2
arch/arc/include/asm/module.h
··· 14 14 15 15 #include <asm-generic/module.h> 16 16 17 - #ifdef CONFIG_ARC_DW2_UNWIND 18 17 struct mod_arch_specific { 18 + #ifdef CONFIG_ARC_DW2_UNWIND 19 19 void *unw_info; 20 20 int unw_sec_idx; 21 + #endif 21 22 const char *secstr; 22 23 }; 23 - #endif 24 24 25 25 #define MODULE_PROC_FAMILY "ARC700" 26 26
+3 -1
arch/arc/kernel/module.c
··· 32 32 #ifdef CONFIG_ARC_DW2_UNWIND 33 33 mod->arch.unw_sec_idx = 0; 34 34 mod->arch.unw_info = NULL; 35 - mod->arch.secstr = secstr; 36 35 #endif 36 + mod->arch.secstr = secstr; 37 37 return 0; 38 38 } 39 39 ··· 113 113 114 114 } 115 115 116 + #ifdef CONFIG_ARC_DW2_UNWIND 116 117 if (strcmp(module->arch.secstr+sechdrs[tgtsec].sh_name, ".eh_frame") == 0) 117 118 module->arch.unw_sec_idx = tgtsec; 119 + #endif 118 120 119 121 return 0; 120 122