]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
build(bl1): sort sections by alignment by default
authorChris Kay <chris.kay@arm.com>
Fri, 6 Jan 2023 11:02:00 +0000 (11:02 +0000)
committerChris Kay <chris.kay@arm.com>
Mon, 17 Apr 2023 15:45:09 +0000 (16:45 +0100)
This change forces LD to sort all input sections by alignment when
allocating them within an output section. This is done in some places
explicitly in the linker scripts today, but this makes sure we don't
miss any easy targets.

Change-Id: I69d6acea822036a6365a7ea10fa732b5e0387f52
Signed-off-by: Chris Kay <chris.kay@arm.com>
bl1/bl1.mk

index 0c43f13d0c11a5129223219dcbde19e2bdca1a76..b1791b1377daf96153b156419e1ae314064e5703 100644 (file)
@@ -29,4 +29,10 @@ ifeq (${TRUSTED_BOARD_BOOT},1)
 BL1_SOURCES            +=      bl1/bl1_fwu.c
 endif
 
+ifneq ($(findstring gcc,$(notdir $(LD))),)
+        BL1_LDFLAGS    +=      -Wl,--sort-section=alignment
+else ifneq ($(findstring ld,$(notdir $(LD))),)
+        BL1_LDFLAGS    +=      --sort-section=alignment
+endif
+
 BL1_DEFAULT_LINKER_SCRIPT_SOURCE := bl1/bl1.ld.S