From 6fc450f696887f1fe86cb2a31a897cc28d3f1c11 Mon Sep 17 00:00:00 2001 From: Frank Heimes Date: Mon, 26 Aug 2024 18:08:59 +0200 Subject: [PATCH] (genprotimg|zipl)/boot: discard .note.package ELF section to save memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .note.package [1] section is not used by the zipl/genprotimg bootloaders, therefore discard them via linker script. This fix solves the error: /usr/bin/ld: Heap section doesn't conform to the described memory layout collect2: error: ld returned 1 exit status make[4]: *** [Makefile:77: stage3a.elf] Error 1 make[4]: Leaving directory '/<>/genprotimg/boot' make[3]: *** [Makefile:20: all-recursive] Error 1 make[3]: Leaving directory '/<>/genprotimg' make[2]: *** [Makefile:56: genprotimg] Error 2 [1] https://systemd.io/ELF_PACKAGE_METADATA/ Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/174 Closes: https://github.com/ibm-s390-linux/s390-tools/pull/176 [seiden@linux.ibm.com: Add/edit fixes tags] Signed-off-by: Marc Hartmayer Signed-off-by: Frank Heimes Reviewed-by: Steffen Eiden Signed-off-by: Steffen Eiden Signed-off-by: Jan Höppner --- genprotimg/boot/stage3a.lds.S | 1 + genprotimg/boot/stage3b.lds.S | 1 + genprotimg/boot/stage3b_reloc.lds.S | 1 + zipl/boot/eckd2dump_sv.lds.S | 1 + zipl/boot/stage0.lds.S | 1 + zipl/boot/stage1.lds.S | 1 + zipl/boot/stage1b.lds.S | 1 + zipl/boot/stage2.lds.S | 1 + zipl/boot/stage3.lds.S | 1 + 9 files changed, 9 insertions(+) diff --git a/genprotimg/boot/stage3a.lds.S b/genprotimg/boot/stage3a.lds.S index 654ca945..cc50948d 100644 --- a/genprotimg/boot/stage3a.lds.S +++ b/genprotimg/boot/stage3a.lds.S @@ -93,5 +93,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } } diff --git a/genprotimg/boot/stage3b.lds.S b/genprotimg/boot/stage3b.lds.S index 9705ffd3..e0eb10a3 100644 --- a/genprotimg/boot/stage3b.lds.S +++ b/genprotimg/boot/stage3b.lds.S @@ -79,5 +79,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } } diff --git a/genprotimg/boot/stage3b_reloc.lds.S b/genprotimg/boot/stage3b_reloc.lds.S index 39b4d73a..52b7471a 100644 --- a/genprotimg/boot/stage3b_reloc.lds.S +++ b/genprotimg/boot/stage3b_reloc.lds.S @@ -15,5 +15,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } } diff --git a/zipl/boot/eckd2dump_sv.lds.S b/zipl/boot/eckd2dump_sv.lds.S index 0518d24d..d574fd66 100644 --- a/zipl/boot/eckd2dump_sv.lds.S +++ b/zipl/boot/eckd2dump_sv.lds.S @@ -72,5 +72,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } } diff --git a/zipl/boot/stage0.lds.S b/zipl/boot/stage0.lds.S index 751e252e..5fa93c3b 100644 --- a/zipl/boot/stage0.lds.S +++ b/zipl/boot/stage0.lds.S @@ -14,5 +14,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } } diff --git a/zipl/boot/stage1.lds.S b/zipl/boot/stage1.lds.S index d0ba5873..3d7fec31 100644 --- a/zipl/boot/stage1.lds.S +++ b/zipl/boot/stage1.lds.S @@ -14,5 +14,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } } diff --git a/zipl/boot/stage1b.lds.S b/zipl/boot/stage1b.lds.S index c319c2eb..6bed14e6 100644 --- a/zipl/boot/stage1b.lds.S +++ b/zipl/boot/stage1b.lds.S @@ -14,5 +14,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } } diff --git a/zipl/boot/stage2.lds.S b/zipl/boot/stage2.lds.S index 057da853..4eba7f24 100644 --- a/zipl/boot/stage2.lds.S +++ b/zipl/boot/stage2.lds.S @@ -93,5 +93,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } } diff --git a/zipl/boot/stage3.lds.S b/zipl/boot/stage3.lds.S index 92009307..80f39eb6 100644 --- a/zipl/boot/stage3.lds.S +++ b/zipl/boot/stage3.lds.S @@ -74,5 +74,6 @@ SECTIONS *(.eh_frame) *(.interp) *(.note.GNU-stack) + *(.note.package) } }