diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2018-10-17 14:59:46 +0300 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-10-26 11:19:40 +0300 |
commit | 5a2e1853d68904c4b26706dba2884cbeb77bc3ee (patch) | |
tree | 712b1af543f3db44a15bb2959817f8cd8a6ee0b4 /arch/s390/boot | |
parent | b44b136a3773d8a9c7853f8df716bd1483613cbb (diff) | |
download | linux-5a2e1853d68904c4b26706dba2884cbeb77bc3ee.tar.xz |
s390: avoid vmlinux segments overlap
Currently .vmlinux.info section of uncompressed vmlinux elf image is
included into the data segment and load address specified as 0. That
extends data segment to address 0 and makes "text" and "data" segments
overlap.
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
LOAD 0x0000000000001000 0x0000000000100000 0x0000000000100000
0x0000000000ead03c 0x0000000000ead03c R E 0x1000
LOAD 0x0000000000eaf000 0x0000000000000000 0x0000000000000000
0x0000000001a13400 0x000000000233b520 RWE 0x1000
NOTE 0x0000000000eae000 0x0000000000fad000 0x0000000000fad000
0x000000000000003c 0x000000000000003c 0x4
Section to Segment mapping:
Segment Sections...
00 .text .notes
01 .rodata __ksymtab __ksymtab_gpl __ksymtab_strings __param
__modver .data..ro_after_init __ex_table .data __bug_table .init.text
.exit.text .exit.data .altinstructions .altinstr_replacement
.nospec_call_table .nospec_return_table .boot.data .init.data
.data..percpu .bss .vmlinux.info
02 .notes
Later when vmlinux.bin is produced from vmlinux, .vmlinux.info section
is removed. But elf vmlinux file, even though it is not bootable anymore,
used for debugging and loadable segments overlap should be avoided.
Utilize special ":NONE" phdr specification to avoid adding .vmlinux.info
into loadable data segment. Also set .vmlinux.info section type to INFO,
which allows to get a not-loadable info CONTENTS section.
Since minimal supported version of binutils 2.20 does not have
--dump-section objcopy option, make .vmlinux.info section loadable during
info.bin creation to get actual section contents.
Reported-by: Philipp Rudo <prudo@linux.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/boot')
-rw-r--r-- | arch/s390/boot/compressed/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile index 92b5487b0556..b1bdd15e3429 100644 --- a/arch/s390/boot/compressed/Makefile +++ b/arch/s390/boot/compressed/Makefile @@ -25,7 +25,7 @@ LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T $(obj)/vmlinux: $(obj)/vmlinux.lds $(objtree)/arch/s390/boot/startup.a $(OBJECTS) FORCE $(call if_changed,ld) -OBJCOPYFLAGS_info.bin := -O binary --only-section=.vmlinux.info +OBJCOPYFLAGS_info.bin := -O binary --only-section=.vmlinux.info --set-section-flags .vmlinux.info=load $(obj)/info.bin: vmlinux FORCE $(call if_changed,objcopy) |