From 5e46632767cb95afbf867cded150a4b2326f47f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B6ppner?= Date: Mon, 28 Feb 2022 11:24:19 +0100 Subject: [PATCH] zipl: Use the compiler for linking instead of ld MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of directly calling ld, it is recommended to call the compiler to do the linking. Do that and adapt the linker flags accordingly. This also fixes build issues with newer binutils as -no-pie has never been a valid option for ld itself. See: https://sourceware.org/bugzilla/show_bug.cgi?id=27050 https://bugs.launchpad.net/ubuntu/+source/s390-tools/+bug/1907789 LD has no user anymore and is removed. Closes: https://github.com/ibm-s390-tools/s390-tools/pull/106 Reported-by: Lukas Märdian Reviewed-by: Marc Hartmayer Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- common.mak | 1 - zipl/boot/Makefile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common.mak b/common.mak index 9624f354..dd4586ad 100644 --- a/common.mak +++ b/common.mak @@ -60,7 +60,6 @@ endef $(eval $(call cmd_define, AS," AS ",$(CROSS_COMPILE)as)) $(eval $(call cmd_define, LINK," LINK ",$(CROSS_COMPILE)gcc)) -$(eval $(call cmd_define, LD," LD ",$(CROSS_COMPILE)ld)) $(eval $(call cmd_define, CC," CC ",$(CROSS_COMPILE)gcc)) $(eval $(call cmd_define, HOSTCC," HOSTCC ",gcc)) $(eval $(call cmd_define, LINKXX," LINKXX ",$(CROSS_COMPILE)g++)) diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile index 09403a78..e0c041e7 100644 --- a/zipl/boot/Makefile +++ b/zipl/boot/Makefile @@ -110,7 +110,7 @@ stage3.bin: stage3.exec $< $@ data.o: $(FILES) - $(LD) $(NO_PIE_LDFLAGS) -r -b binary -o data.o $(FILES) + $(LINK) $(NO_PIE_LDFLAGS) -static -nostdlib -Wl,--relocatable -Wl,--format,binary -o data.o $(FILES) data.h: data.o rm -f data.h