Patrick Williams | 705982a | 2024-01-12 09:51:57 -0600 | [diff] [blame] | 1 | From 051c723a6463a579b05dcaa81f204516737a3645 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ross Burton <ross.burton@arm.com> |
| 3 | Date: Wed, 9 Aug 2023 15:56:03 -0400 |
| 4 | Subject: [PATCH] Binutils 2.39 now warns when a segment has RXW |
| 5 | permissions[1]: |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 6 | |
| 7 | aarch64-none-elf-ld.bfd: warning: bl31.elf has a LOAD segment with RWX |
| 8 | permissions |
| 9 | |
| 10 | However, TF-A passes --fatal-warnings to LD, so this is a build failure. |
| 11 | |
| 12 | There is a ticket filed upstream[2], so until that is resolved just |
| 13 | remove --fatal-warnings. |
| 14 | |
| 15 | [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 |
| 16 | [2] https://developer.trustedfirmware.org/T996 |
| 17 | |
| 18 | Upstream-Status: Inappropriate |
| 19 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
Patrick Williams | 705982a | 2024-01-12 09:51:57 -0600 | [diff] [blame] | 20 | --- |
| 21 | Makefile | 4 ++-- |
| 22 | 1 file changed, 2 insertions(+), 2 deletions(-) |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 23 | |
| 24 | diff --git a/Makefile b/Makefile |
Patrick Williams | 705982a | 2024-01-12 09:51:57 -0600 | [diff] [blame] | 25 | index 1ddb7b84417d..9eae30c923ec 100644 |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 26 | --- a/Makefile |
| 27 | +++ b/Makefile |
Patrick Williams | 705982a | 2024-01-12 09:51:57 -0600 | [diff] [blame] | 28 | @@ -425,7 +425,7 @@ TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 29 | # LD = gcc (used when GCC LTO is enabled) |
| 30 | else ifneq ($(findstring gcc,$(notdir $(LD))),) |
| 31 | # Pass ld options with Wl or Xlinker switches |
| 32 | -TF_LDFLAGS += -Wl,--fatal-warnings -O1 |
| 33 | +TF_LDFLAGS += -O1 |
| 34 | TF_LDFLAGS += -Wl,--gc-sections |
| 35 | ifeq ($(ENABLE_LTO),1) |
| 36 | ifeq (${ARCH},aarch64) |
Patrick Williams | 705982a | 2024-01-12 09:51:57 -0600 | [diff] [blame] | 37 | @@ -442,7 +442,7 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 38 | |
| 39 | # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other |
| 40 | else |
| 41 | -TF_LDFLAGS += --fatal-warnings -O1 |
| 42 | +TF_LDFLAGS += -O1 |
| 43 | TF_LDFLAGS += --gc-sections |
| 44 | # ld.lld doesn't recognize the errata flags, |
| 45 | # therefore don't add those in that case |