linux/arch/s390
Vasily Gorbik 2d6f74f797 s390/decompressor: correct EXCLUDE_FILE construct
The following linker construct is problematic with linkers of
binutils < 2.28:

EXCLUDE_FILE (*piggy.o) *(.rodata.*)

from 8f1732fc2a11dc of binutils:
"though the linker accepts this without complaint the
EXCLUDE_FILE part is silently ignored and has no effect."

Silent ignoring of EXCLUDE_FILE construct made .rodata.compressed be
part of .rodata, and in case of .rodata.compressed following some
unaligned data, input_len would also become unaligned.

from arch/s390/boot/compressed/vmlinux.map:
 .rodata.compressed
                0x0000000000012fea   0x4d57e7 arch/s390/boot/compressed/piggy.o
                0x0000000000012fea                input_len
                0x0000000000012fee                input_data

input_len is later used here:
arch/s390/boot/compressed/misc.c:113
	__decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error);

asm generated by gcc looks like:
	.loc 3 113 0
egfrl	%r11,input_len

from what assembler generates invalid (the second operand must be aligned
on a doubleword boundary):
   0x00000000000129b4 <+148>:   c4 bc 00 00 03 1b       lgfrl   %r11,0x12fea
hence specification exception is recognized.

To avoid an issue use EXCLUDE_FILE construct which is recognized by
older linkers (since at least binutils-2_11)
	*(EXCLUDE_FILE (*piggy.o) .rodata.compressed)

Also ensure that .rodata.compressed is at least doubleword aligned.

Fixes: 89b5202e81 ("s390/decompressor: support uncompressed kernel")
Reported-by: Halil Pasic <pasic@linux.ibm.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2018-07-02 11:25:01 +02:00
..
appldata s390: fix gcc 8 stringop-truncation warnings in proc handlers 2018-07-02 11:24:53 +02:00
boot s390/decompressor: correct EXCLUDE_FILE construct 2018-07-02 11:25:01 +02:00
configs s390: update defconfigs 2018-04-27 06:51:31 +02:00
crypto s390/archrandom: Rework arch random implementation. 2018-05-30 11:18:04 +02:00
hypfs s390: hypfs: use ktime_get_seconds() instead of get_seconds() 2018-06-25 10:14:41 +02:00
include s390: remove unused _ehead symbol 2018-07-02 11:24:58 +02:00
kernel s390: move _text to an actual .text start 2018-07-02 11:25:00 +02:00
kvm - Error path bug fix for overflow tests (Dan) 2018-06-12 18:28:00 -07:00
lib s390: introduce compile time check for empty .bss section 2018-05-09 10:55:01 +02:00
mm s390/extmem: fix gcc 8 stringop-overflow warning 2018-07-02 11:24:50 +02:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
numa s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 20:27:54 -07:00
purgatory s390/purgatory: Fix endless interrupt loop 2018-05-18 07:24:35 +02:00
scripts s390: add custom target and make path extension optional for .bss check 2018-06-25 10:14:39 +02:00
tools KVM: s390: implement CPU model only facilities 2018-03-09 09:44:17 +00:00
defconfig s390: update defconfig 2018-04-16 10:29:34 +02:00
Kbuild s390/kexec_file: Add purgatory 2018-04-16 09:10:22 +02:00
Kconfig s390/decompressor: support uncompressed kernel 2018-06-25 10:14:40 +02:00
Kconfig.debug License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile s390/boot: make head.S and als.c be part of the decompressor only 2018-06-25 10:14:38 +02:00