aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/purgatory/purgatory.lds.S
diff options
context:
space:
mode:
authorPhilipp Rudo <prudo@linux.ibm.com>2019-03-05 17:18:13 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2019-04-29 10:43:53 +0200
commit61f3f8fc223524692aaa87cf46d95ca3015e83a9 (patch)
tree167546bfdced6b6d8e7bf9150cbff85e22392102 /arch/s390/purgatory/purgatory.lds.S
parents390/kexec_file: Fix detection of text segment in ELF loader (diff)
downloadlinux-dev-61f3f8fc223524692aaa87cf46d95ca3015e83a9.tar.xz
linux-dev-61f3f8fc223524692aaa87cf46d95ca3015e83a9.zip
s390/purgatory: Reduce purgatory size
The purgatory is compiled into the vmlinux and keept in memory all the time during runtime. Thus any section not needed to load the purgatory unnecessarily bloats up its foot print in file- and memorysize. Reduce the purgatory size by stripping the unneeded sections from the purgatory. This reduces the purgatories size by ~33%. Signed-off-by: Philipp Rudo <prudo@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to '')
-rw-r--r--arch/s390/purgatory/purgatory.lds.S54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/s390/purgatory/purgatory.lds.S b/arch/s390/purgatory/purgatory.lds.S
new file mode 100644
index 000000000000..482eb4fbcef1
--- /dev/null
+++ b/arch/s390/purgatory/purgatory.lds.S
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <asm-generic/vmlinux.lds.h>
+
+OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
+OUTPUT_ARCH(s390:64-bit)
+
+ENTRY(purgatory_start)
+
+SECTIONS
+{
+ . = 0;
+ .head.text : {
+ _head = . ;
+ HEAD_TEXT
+ _ehead = . ;
+ }
+ .text : {
+ _text = .; /* Text */
+ *(.text)
+ *(.text.*)
+ _etext = . ;
+ }
+ .rodata : {
+ _rodata = . ;
+ *(.rodata) /* read-only data */
+ *(.rodata.*)
+ _erodata = . ;
+ }
+ .data : {
+ _data = . ;
+ *(.data)
+ *(.data.*)
+ _edata = . ;
+ }
+
+ . = ALIGN(256);
+ .bss : {
+ _bss = . ;
+ *(.bss)
+ *(.bss.*)
+ *(COMMON)
+ . = ALIGN(8); /* For convenience during zeroing */
+ _ebss = .;
+ }
+ _end = .;
+
+ /* Sections to be discarded */
+ /DISCARD/ : {
+ *(.eh_frame)
+ *(*__ksymtab*)
+ *(___kcrctab*)
+ }
+}