Commit eb1357d9 authored by Vineet Gupta's avatar Vineet Gupta

ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds

commit d65283f7 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: default avatarWaldemar Brodkorb <wbx@openadk.org>
Cc: stable@vger.kernel.org    #4.9
Fixes: d65283f7 ("ARC: module: elide loop to save reference to .eh_frame")
Tested-by: default avatarAnton Kolesov <akolesov@synopsys.com>
Reviewed-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
[abrodkin: provided fixlet to Kconfig per failure in allnoconfig build]
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent ecd43afd
...@@ -29,7 +29,7 @@ config ARC ...@@ -29,7 +29,7 @@ config ARC
select HAVE_KPROBES select HAVE_KPROBES
select HAVE_KRETPROBES select HAVE_KRETPROBES
select HAVE_MEMBLOCK select HAVE_MEMBLOCK
select HAVE_MOD_ARCH_SPECIFIC if ARC_DW2_UNWIND select HAVE_MOD_ARCH_SPECIFIC
select HAVE_OPROFILE select HAVE_OPROFILE
select HAVE_PERF_EVENTS select HAVE_PERF_EVENTS
select HANDLE_DOMAIN_IRQ select HANDLE_DOMAIN_IRQ
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
#include <asm-generic/module.h> #include <asm-generic/module.h>
#ifdef CONFIG_ARC_DW2_UNWIND
struct mod_arch_specific { struct mod_arch_specific {
#ifdef CONFIG_ARC_DW2_UNWIND
void *unw_info; void *unw_info;
int unw_sec_idx; int unw_sec_idx;
#endif
const char *secstr; const char *secstr;
}; };
#endif
#define MODULE_PROC_FAMILY "ARC700" #define MODULE_PROC_FAMILY "ARC700"
......
...@@ -32,8 +32,8 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, ...@@ -32,8 +32,8 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
#ifdef CONFIG_ARC_DW2_UNWIND #ifdef CONFIG_ARC_DW2_UNWIND
mod->arch.unw_sec_idx = 0; mod->arch.unw_sec_idx = 0;
mod->arch.unw_info = NULL; mod->arch.unw_info = NULL;
mod->arch.secstr = secstr;
#endif #endif
mod->arch.secstr = secstr;
return 0; return 0;
} }
...@@ -113,8 +113,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, ...@@ -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) if (strcmp(module->arch.secstr+sechdrs[tgtsec].sh_name, ".eh_frame") == 0)
module->arch.unw_sec_idx = tgtsec; module->arch.unw_sec_idx = tgtsec;
#endif
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment