genprotimg/zipl: boot: Makefile: small refactoring

Move the common `-nostdlib` and `$(NO_PIE_LINKFLAGS) linker options to
the actual linker call. This makes the code easier to maintain.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2022-02-01 09:08:42 +00:00
committed by Jan Höppner
parent 67dbf094b2
commit 5ac171d224
2 changed files with 10 additions and 10 deletions

View File

@@ -75,11 +75,11 @@ stage3b_reloc.elf:
%.elf: %.o
case $* in \
stage3a) SFLAGS="$(NO_PIE_LDFLAGS) -nostdlib -Wl,-T,stage3a.lds";; \
stage3b) SFLAGS="$(NO_PIE_LDFLAGS) -nostdlib -Wl,-T,stage3b.lds";; \
stage3b_reloc) SFLAGS="$(NO_PIE_LDFLAGS) -nostdlib -Wl,-estage3b_reloc_start,-Ttext,0";; \
stage3a) SFLAGS="-Wl,-T,stage3a.lds";; \
stage3b) SFLAGS="-Wl,-T,stage3b.lds";; \
stage3b_reloc) SFLAGS="-Wl,-estage3b_reloc_start,-Ttext,0";; \
esac; \
$(LINK) $$SFLAGS -m64 -static $(filter %.o, $^) -o $@
$(LINK) $$SFLAGS $(NO_PIE_LDFLAGS) -m64 -static -nostdlib $(filter %.o, $^) -o $@
@chmod a-x $@
%.bin: %.elf

View File

@@ -68,13 +68,13 @@ stage3.exec: head.o stage3.o kdump3.o libc.o ebcdic.o ebcdic_conv.o sclp.o \
}' \
); \
case $$STAGE in \
0) SFLAGS="$(NO_PIE_LDFLAGS) -nostdlib -Wl,-Ttext,0";; \
1) SFLAGS="$(NO_PIE_LDFLAGS) -nostdlib -Wl,-Ttext,0x18";; \
1b) SFLAGS="$(NO_PIE_LDFLAGS) -nostdlib -Wl,-Ttext,0xE000";; \
2) SFLAGS="$(NO_PIE_LDFLAGS) -nostdlib -Wl,-T,stage2.lds";; \
3) SFLAGS="$(NO_PIE_LDFLAGS) -nostdlib -Wl,-T,stage3.lds";; \
0) SFLAGS="-Wl,-Ttext,0";; \
1) SFLAGS="-Wl,-Ttext,0x18";; \
1b) SFLAGS="-Wl,-Ttext,0xE000";; \
2) SFLAGS="-Wl,-T,stage2.lds";; \
3) SFLAGS="-Wl,-T,stage3.lds";; \
esac; \
$(LINK) $$SFLAGS -m64 -static $(filter %.o, $^) -o $@
$(LINK) $$SFLAGS $(NO_PIE_LDFLAGS) -m64 -static -nostdlib $(filter %.o, $^) -o $@
%.bin: %.exec
$(OBJCOPY) -O binary \