diff --git a/Makefile b/Makefile index a69bfbb3b..04b75fe59 100644 --- a/Makefile +++ b/Makefile @@ -445,6 +445,8 @@ endif GCC_V_OUTPUT := $(shell $(CC) -v 2>&1) +TF_LDFLAGS += -z noexecstack + # LD = armlink ifneq ($(findstring armlink,$(notdir $(LD))),) TF_LDFLAGS += --diag_error=warning --lto_level=O1 @@ -475,6 +477,9 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other else +# With ld.bfd version 2.39 and newer new warnings are added. Skip those since we +# are not loaded by a elf loader. +TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments) TF_LDFLAGS += -O1 TF_LDFLAGS += --gc-sections