Skip to content

Commit

Permalink
zipl: pad stage3 binary
Browse files Browse the repository at this point in the history
The stage 3 loader size has to be a multiple of the filesystem
blocksize so that the signature maps with the later in memory
stage 3 loader. The lowest common blocksize is 4k so the image
is padded to a 4k boundary.

Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Acked-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
  • Loading branch information
Stefan Haberland authored and hoeppnerj committed Apr 29, 2019
1 parent 58a7462 commit 75d4317
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions zipl/boot/Makefile
Expand Up @@ -77,6 +77,22 @@ stage3.exec: head.o stage3.o kdump3.o libc.o sclp.o sclp_stage3.o \
--only-section=.fixup \
$< $@

stage3.bin: stage3.exec

This comment has been minimized.

Copy link
@sharkcz

sharkcz Apr 30, 2019

Contributor

I guess you need to copy the .rodata.cst8 section too, same as is done in the general %.bin: %.exec rule, otherwise we will get corrupted binary with gcc9, see PR #60 .

This comment has been minimized.

Copy link
@stefan-haberland

stefan-haberland May 3, 2019

Contributor

Hi, thanks for pointing out. Missed the update in between.

This comment has been minimized.

Copy link
@sharkcz

sharkcz May 3, 2019

Contributor

I've already opened PR #61 to fix that.

$(OBJCOPY) -O binary \
--only-section=.stage2.head \
--only-section=.text.dummy \
--only-section=.text.start \
--only-section=.text \
--only-section=.ex_table \
--only-section=.data \
--only-section=.rodata.str1.2 \
--only-section=.rodata \
--only-section=.stage2dump.tail \
--only-section=.eckd2dump_mv.tail \
--only-section=.fixup \
--pad-to=0xf000 \
$< $@

data.o: $(FILES)
$(LD) $(NO_PIE_LDFLAGS) -r -b binary -o data.o $(FILES)

Expand Down

0 comments on commit 75d4317

Please sign in to comment.