From mboxrd@z Thu Jan  1 00:00:00 1970
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 15/15] u-boot: Ignore LOAD segments with RWX permissions
Date: Mon, 15 Aug 2022 17:17:53 +0000
Message-ID: <20220815171753.1858688-15-michael.tremer@ipfire.org>
In-Reply-To: <20220815171753.1858688-1-michael.tremer@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1001862313110363193=="
List-Id: <development.lists.ipfire.org>

--===============1001862313110363193==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is a new check in binutils which has to be disabled for some legacy
bootloaders.

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 lfs/u-boot | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lfs/u-boot b/lfs/u-boot
index f7341675d..3488204ee 100644
--- a/lfs/u-boot
+++ b/lfs/u-boot
@@ -34,6 +34,7 @@ TARGET     =3D $(DIR_INFO)/$(THISAPP)-$(MKIMAGE)
 SUP_ARCH   =3D armv6l aarch64
=20
 CFLAGS    :=3D $(patsubst -fstack-protector-strong,,$(CFLAGS))
+LDFLAGS   +=3D --no-warn-rwx-segments
=20
 ATF_VER    =3D 2.6
=20
@@ -189,7 +190,7 @@ else
 	# OrangePi Zero Plus
 	cd $(DIR_APP) && rm -rf arm-trusted-firmware-$(ATF_VER)
 	cd $(DIR_APP) && tar axf $(DIR_DL)/arm-trusted-firmware-$(ATF_VER).tar.gz
-	cd $(DIR_APP)/arm-trusted-firmware-$(ATF_VER) && make PLAT=3Dsun50i_a64 DEB=
UG=3D0 bl31
+	cd $(DIR_APP)/arm-trusted-firmware-$(ATF_VER) && make PLAT=3Dsun50i_a64 DEB=
UG=3D0 bl31 LDFLAGS=3D"$(LDFLAGS)"
 	cd $(DIR_APP) && cp arm-trusted-firmware-$(ATF_VER)/build/sun50i_a64/releas=
e/bl31.bin bl31.bin
 	cd $(DIR_APP) && rm -rf arm-trusted-firmware-$(ATF_VER)
 	-mkdir -pv /usr/share/u-boot/orangepi_zero_plus
@@ -204,7 +205,7 @@ else
 	# Nanopi R2S
 	cd $(DIR_APP) && rm -rf arm-trusted-firmware-$(ATF_VER)
 	cd $(DIR_APP) && tar axf $(DIR_DL)/arm-trusted-firmware-$(ATF_VER).tar.gz
-	cd $(DIR_APP)/arm-trusted-firmware-$(ATF_VER) && make PLAT=3Drk3328 ARCH=3D=
aarch64 DEBUG=3D0 bl31
+	cd $(DIR_APP)/arm-trusted-firmware-$(ATF_VER) && make PLAT=3Drk3328 ARCH=3D=
aarch64 DEBUG=3D0 bl31 LDFLAGS=3D"$(LDFLAGS)"
 	cd $(DIR_APP) && cp arm-trusted-firmware-$(ATF_VER)/build/rk3328/release/bl=
31/bl31.elf bl31.elf
 	cd $(DIR_APP) && rm -rf arm-trusted-firmware-$(ATF_VER)
 	-mkdir -pv /usr/share/u-boot/nanopi_r2s
--=20
2.30.2


--===============1001862313110363193==--