linux/arch/s390/boot
Vasily Gorbik 5a2e1853d6 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>
2018-10-26 10:19:40 +02:00
..
compressed s390: avoid vmlinux segments overlap 2018-10-26 10:19:40 +02:00
.gitignore s390: introduce .boot.data section compile time validation 2018-10-09 11:21:08 +02:00
Makefile s390/kasan: avoid instrumentation of early C code 2018-10-09 11:21:17 +02:00
als.c s390/als: avoid .init.* sections usage 2018-06-25 10:14:38 +02:00
boot.h s390: move ipl block and cmd line handling to early boot phase 2018-10-09 11:21:14 +02:00
cmdline.c s390: move ipl block and cmd line handling to early boot phase 2018-10-09 11:21:14 +02:00
ctype.c s390: move ipl block and cmd line handling to early boot phase 2018-10-09 11:21:14 +02:00
ebcdic.c s390/decompressor: avoid reusing uncompressed image objects 2018-06-25 10:14:39 +02:00
head.S s390/head: avoid doubling early boot stack size under KASAN 2018-10-09 11:21:32 +02:00
head_kdump.S s390/boot: make head.S and als.c be part of the decompressor only 2018-06-25 10:14:38 +02:00
install.sh s390: Remove redundant license text 2017-11-24 15:37:24 +01:00
ipl_parm.c s390/kasan: use noexec and large pages 2018-10-09 11:21:24 +02:00
ipl_vmparm.c s390: move ipl block and cmd line handling to early boot phase 2018-10-09 11:21:14 +02:00
mem.S s390/decompressor: reuse lib/mem.S for mem functions 2018-06-25 10:14:39 +02:00
mem_detect.c s390/mem_detect: add missing include 2018-10-10 07:37:22 +02:00
sclp_early_core.c s390/decompressor: avoid reusing uncompressed image objects 2018-06-25 10:14:39 +02:00
startup.c s390: move ipl block and cmd line handling to early boot phase 2018-10-09 11:21:14 +02:00
string.c s390/kasan: use noexec and large pages 2018-10-09 11:21:24 +02:00