From 5a848c98bb84891467364e18a82590e231e0657f Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 18 Jul 2023 14:39:22 +0200 Subject: [PATCH] zipl/src: remove no-pie and noexecstack compiler and linker flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the bootloaders cannot be built as PIE and for that there are already the -no-pie linker and compiler flags set by the boot/Makefile. In addition, remove the `noexecstack` linker flag as it has no use anymore (see commit 518bf7d7357 ("zipl/boot: use `--no-warn-rwx-segments` linker flag")). It was originally introduced to declare the ELF segment of the bootloader stack as non-executable. But this ELF attribute had no effect for multiple reasons: 1. ALL_LDFLAGS is not used for the bootloaders 2. no ELF loader is used for the bootloaders that would take this ELF attribute into account This fixes the problem of overriding `-fPIE` set by the distributor. Reviewed-by: Steffen Eiden Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- zipl/src/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zipl/src/Makefile b/zipl/src/Makefile index cab56557..ead6a4c4 100644 --- a/zipl/src/Makefile +++ b/zipl/src/Makefile @@ -4,8 +4,7 @@ include ../../common.mak ALL_CPPFLAGS += -I../include -I../boot \ -DZFCPDUMP_IMAGE="STRINGIFY($(ZFCPDUMP_DIR)/$(ZFCPDUMP_IMAGE))" \ -DZFCPDUMP_INITRD="STRINGIFY($(ZFCPDUMP_DIR)/$(ZFCPDUMP_INITRD))" \ - -D_FILE_OFFSET_BITS=64 $(NO_PIE_CFLAGS) -DBUILD_PATH="../boot" -ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS) + -D_FILE_OFFSET_BITS=64 -DBUILD_PATH="../boot" libs = $(rootdir)/libutil/libutil.a \ $(rootdir)/libvtoc/libvtoc.a \