From d1884db2369a650bfcc624f6170e87f81ba657c7 Mon Sep 17 00:00:00 2001 From: Mikhail Zaslonko Date: Fri, 15 Nov 2024 00:52:51 +0100 Subject: [PATCH] zipl/boot: Add assertion of the dumper size to the linker script Update eckd2dump linker script with assertions of single-volume and multi-volume DASD dumper size. Signed-off-by: Mikhail Zaslonko Reviewed-by: Alexander Egorenkov Signed-off-by: Steffen Eiden --- zipl/boot/eckd2dump.lds.S | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/zipl/boot/eckd2dump.lds.S b/zipl/boot/eckd2dump.lds.S index 05da8ad8..a16a73be 100644 --- a/zipl/boot/eckd2dump.lds.S +++ b/zipl/boot/eckd2dump.lds.S @@ -30,6 +30,7 @@ SECTIONS __stage2_desc = .; . = STAGE2_LOAD_ADDRESS; + __stage2_head = .; .stage2.head : { *(.stage2.head) } . = STAGE2_ENTRY; .text.start : { @@ -43,7 +44,16 @@ SECTIONS .data : { *(.data) } . = STAGE2DUMP_TAIL_ADDRESS; - .stage2dump.tail : { *(.stage2dump.tail) } + .stage2dump.tail : { *(.stage2dump.tail) +#ifdef ECKD2DUMP_MV + ASSERT(__stage2dump_tail_end - __stage2_head == STAGE2_DUMPER_SIZE_MV, + "MV dumper size doesn't conform to the described memory layout"); +#else + ASSERT(__stage2dump_tail_end - __stage2_head == STAGE2_DUMPER_SIZE_ZLIB, + "SV dumper size doesn't conform to the described memory layout"); +#endif + } + __stage2dump_tail_end = .; #ifdef ECKD2DUMP_MV . = ECKD2DUMP_MV_TAIL_ADDRESS; .eckd2dump_mv.tail : { *(.eckd2dump_mv.tail) }