From 5ac171d2249c69a9a192ae63a4e826dc64a33a91 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 1 Feb 2022 09:08:42 +0000 Subject: [PATCH] genprotimg/zipl: boot: Makefile: small refactoring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jan Höppner Reviewed-by: Steffen Eiden Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- genprotimg/boot/Makefile | 8 ++++---- zipl/boot/Makefile | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/genprotimg/boot/Makefile b/genprotimg/boot/Makefile index d71afdb1..1ccc8b26 100644 --- a/genprotimg/boot/Makefile +++ b/genprotimg/boot/Makefile @@ -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 diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile index 04a58952..c2ec76ae 100644 --- a/zipl/boot/Makefile +++ b/zipl/boot/Makefile @@ -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 \