208fae5c3b
It was reported that a kernel with CONFIG_ARM_PATCH_IDIV=y stopped booting when compiled with the upcoming gcc 6. Turns out that turning a function address into a writable array is undefined and gcc 6 decided it was OK to omit the store to the first word of the function while still preserving the store to the second word. Even though gcc 6 is now fixed to behave more coherently, it is a mystery that gcc 4 and gcc 5 actually produce wanted code in the kernel. And in fact the reduced test case to illustrate the issue does indeed break with gcc < 6 as well. In any case, let's guard the kernel against undefined compiler behavior by hiding the nature of the array location as suggested by gcc developers. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70128 Signed-off-by: Nicolas Pitre <nico@linaro.org> Reported-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: stable@vger.kernel.org # v4.5 Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> |
||
---|---|---|
.. | ||
.gitignore | ||
arch_timer.c | ||
armksyms.c | ||
asm-offsets.c | ||
atags_compat.c | ||
atags_parse.c | ||
atags_proc.c | ||
atags.h | ||
bios32.c | ||
calls.S | ||
cpuidle.c | ||
crash_dump.c | ||
debug.S | ||
devtree.c | ||
dma-isa.c | ||
dma.c | ||
early_printk.c | ||
efi.c | ||
elf.c | ||
entry-armv.S | ||
entry-common.S | ||
entry-ftrace.S | ||
entry-header.S | ||
entry-v7m.S | ||
fiq.c | ||
fiqasm.S | ||
ftrace.c | ||
head-common.S | ||
head-nommu.S | ||
head.S | ||
hibernate.c | ||
hw_breakpoint.c | ||
hyp-stub.S | ||
insn.c | ||
io.c | ||
irq.c | ||
isa.c | ||
iwmmxt.S | ||
jump_label.c | ||
kgdb.c | ||
machine_kexec.c | ||
Makefile | ||
module-plts.c | ||
module.c | ||
module.lds | ||
opcodes.c | ||
paravirt.c | ||
patch.c | ||
perf_callchain.c | ||
perf_event_v6.c | ||
perf_event_v7.c | ||
perf_event_xscale.c | ||
perf_regs.c | ||
pj4-cp0.c | ||
process.c | ||
psci_smp.c | ||
ptrace.c | ||
reboot.c | ||
reboot.h | ||
relocate_kernel.S | ||
return_address.c | ||
setup.c | ||
signal.c | ||
sigreturn_codes.S | ||
sleep.S | ||
smccc-call.S | ||
smp_scu.c | ||
smp_tlb.c | ||
smp_twd.c | ||
smp.c | ||
stacktrace.c | ||
suspend.c | ||
swp_emulate.c | ||
sys_arm.c | ||
sys_oabi-compat.c | ||
tcm.c | ||
thumbee.c | ||
time.c | ||
topology.c | ||
traps.c | ||
unwind.c | ||
v7m.c | ||
vdso.c | ||
vmlinux-xip.lds.S | ||
vmlinux.lds.S | ||
xscale-cp0.c |