mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds
commitd65283f7b6
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:d65283f7b6
("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>
This commit is contained in:
parent
ecd43afdbe
commit
eb1357d942
3 changed files with 6 additions and 4 deletions
|
@ -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 @@
|
||||||
|
|
||||||
#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,
|
||||||
#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,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue