Skip to content

Commit eb1357d

Browse files
committed
ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds
commit d65283f 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 raspberrypi#4.9 Fixes: d65283f ("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>
1 parent ecd43af commit eb1357d

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎arch/arc/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ config ARC
2929
select HAVE_KPROBES
3030
select HAVE_KRETPROBES
3131
select HAVE_MEMBLOCK
32-
select HAVE_MOD_ARCH_SPECIFIC if ARC_DW2_UNWIND
32+
select HAVE_MOD_ARCH_SPECIFIC
3333
select HAVE_OPROFILE
3434
select HAVE_PERF_EVENTS
3535
select HANDLE_DOMAIN_IRQ

‎arch/arc/include/asm/module.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
#include <asm-generic/module.h>
1616

17-
#ifdef CONFIG_ARC_DW2_UNWIND
1817
struct mod_arch_specific {
18+
#ifdef CONFIG_ARC_DW2_UNWIND
1919
void *unw_info;
2020
int unw_sec_idx;
21+
#endif
2122
const char *secstr;
2223
};
23-
#endif
2424

2525
#define MODULE_PROC_FAMILY "ARC700"
2626

‎arch/arc/kernel/module.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
3232
#ifdef CONFIG_ARC_DW2_UNWIND
3333
mod->arch.unw_sec_idx = 0;
3434
mod->arch.unw_info = NULL;
35-
mod->arch.secstr = secstr;
3635
#endif
36+
mod->arch.secstr = secstr;
3737
return 0;
3838
}
3939

@@ -113,8 +113,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
113113

114114
}
115115

116+
#ifdef CONFIG_ARC_DW2_UNWIND
116117
if (strcmp(module->arch.secstr+sechdrs[tgtsec].sh_name, ".eh_frame") == 0)
117118
module->arch.unw_sec_idx = tgtsec;
119+
#endif
118120

119121
return 0;
120122

0 commit comments

Comments
 (0)