ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds
PATCH 1/1 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 at openadk.org>
Cc <stable at vger.kernel.org [4.9]>
Fixes d65283f7b695b5 ("ARC: module: elide loop to save reference to .eh_frame")
Signed-off-by Vineet Gupta <vgupta at synopsys.com>
--- arch/arc/include/asm/module.h | 4 ++-- arch/arc/kernel/module.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-)
arch/arc/include/asm/module.h +2 -2
@@ -14,13 +14,13 @@#include <asm-generic/module.h> -#ifdef CONFIG_ARC_DW2_UNWIND struct mod_arch_specific { +#ifdef CONFIG_ARC_DW2_UNWIND void *unw_info;int unw_sec_idx; +#endif const char *secstr; }; -#endif #define MODULE_PROC_FAMILY "ARC700"
arch/arc/kernel/module.c +3 -1
@@ -32,8 +32,8 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,#ifdef CONFIG_ARC_DW2_UNWIND mod->arch.unw_sec_idx =0 ; mod->arch.unw_info =NULL ; - mod->arch.secstr = secstr;#endif + mod->arch.secstr = secstr;return 0 ; }
@@ -113,8 +113,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, } +#ifdef CONFIG_ARC_DW2_UNWIND if (strcmp (module->arch.secstr+sechdrs[tgtsec].sh_name,".eh_frame" ) ==0 ) module->arch.unw_sec_idx = tgtsec; +#endif return 0 ;
Signature · 1 line
2.7.4