From: Peng Fan Date: Mon, 3 Jul 2017 21:14:08 +0800 Subject: [U-Boot] [PATCH 2/2] arm: config: enforce -fno-pic for SPL and normal U-Boot In-Reply-To: <1499087648-9617-1-git-send-email-peng.fan@nxp.com> References: <1499087648-9617-1-git-send-email-peng.fan@nxp.com> Message-ID: <1499087648-9617-2-git-send-email-peng.fan@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de If not pass -fno-pic to toolchains, some toolchains may generate .got and .got.plt sections, but when generate binaries, we did not take .got and .got.plt into consideration, then SPL or normal U-Boot boot failure because image corrupted. Need to pass -fno-pic to disable generating .got and .got.plt sections. Signed-off-by: Peng Fan Cc: Albert Aribaud Cc: Tom Rini --- arch/arm/config.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 1a77779..66ae403 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -130,9 +130,10 @@ ALL-y += checkarmreloc # instruction. Relocation is not supported for that case, so disable # such usage by requiring word relocations. PLATFORM_CPPFLAGS += $(call cc-option, -mword-relocations) -PLATFORM_CPPFLAGS += $(call cc-option, -fno-pic) endif +PLATFORM_CPPFLAGS += $(call cc-option, -fno-pic) + # limit ourselves to the sections we want in the .bin. ifdef CONFIG_ARM64 OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \ -- 2.6.2