arch/arm/config.mk is meant to leave out -ffunction-sections and
-fdata-sections for LTO builds. Once LTO_ENABLE is set in time, and with
--gc-sections kept, that makes U-Boot proper smaller on 32-bit ARM but
larger on almost every ARM64 board, most of all on i.MX8M, where the
16 KiB alignment of early_tlb then pads .data.

Leave the flags out only for 32-bit LTO builds. This changes no image
on main.

Signed-off-by: Josef Schlehofer <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Marek BehĂșn <[email protected]>
Cc: Simon Glass <[email protected]>
---
 arch/arm/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index bce9a31e966..e9606e7c78a 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -17,7 +17,7 @@ ifneq ($(LTO_ENABLE)$(CONFIG_USE_PRIVATE_LIBGCC),yy)
 LDFLAGS_FINAL += --gc-sections
 endif
 
-ifneq ($(LTO_ENABLE),y)
+ifneq ($(LTO_ENABLE).$(CONFIG_ARM64),y.)
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 endif
 
-- 
2.54.0 (Apple Git-157)

Reply via email to