diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2018-06-28 07:39:24 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-07-02 11:25:01 +0200 |
commit | 2d6f74f797f26e14bdd672b3547ad29199bbb6b8 (patch) | |
tree | ab9dee05f4eefc41796e1e90ee30c0b083c80edd /arch/s390 | |
parent | f56506ef3061f3362bb35a396f6951f7035b8294 (diff) | |
download | linux-2d6f74f797f26e14bdd672b3547ad29199bbb6b8.tar.bz2 |
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: 89b5202e81df ("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>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/boot/compressed/vmlinux.lds.S | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/boot/compressed/vmlinux.lds.S b/arch/s390/boot/compressed/vmlinux.lds.S index 93ab95cf16fb..b16ac8b3c439 100644 --- a/arch/s390/boot/compressed/vmlinux.lds.S +++ b/arch/s390/boot/compressed/vmlinux.lds.S @@ -26,7 +26,7 @@ SECTIONS .rodata : { _rodata = . ; *(.rodata) /* read-only data */ - EXCLUDE_FILE (*piggy.o) *(.rodata.*) + *(EXCLUDE_FILE (*piggy.o) .rodata.compressed) _erodata = . ; } .data : { @@ -38,6 +38,8 @@ SECTIONS startup_continue = 0x100000; #ifdef CONFIG_KERNEL_UNCOMPRESSED . = 0x100000; +#else + . = ALIGN(8); #endif .rodata.compressed : { *(.rodata.compressed) |