From: Chris Kay Date: Thu, 26 Jan 2023 18:31:52 +0000 (+0000) Subject: build(bl31): sort sections by alignment by default X-Git-Tag: baikal/aarch64/sdk5.10~1^2~62^2~3 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=ffe7bae02117443ebd846964c7a5c728051d8cb2;p=arm-tf.git build(bl31): sort sections by alignment by default 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: Iadcd38a66a7a9f4b2af3adbc0487a15091486b17 Signed-off-by: Chris Kay --- diff --git a/bl31/bl31.mk b/bl31/bl31.mk index 4d151ab45..9b5cf55bc 100644 --- a/bl31/bl31.mk +++ b/bl31/bl31.mk @@ -159,6 +159,12 @@ endif BL31_DEFAULT_LINKER_SCRIPT_SOURCE := bl31/bl31.ld.S +ifneq ($(findstring gcc,$(notdir $(LD))),) + BL31_LDFLAGS += -Wl,--sort-section=alignment +else ifneq ($(findstring ld,$(notdir $(LD))),) + BL31_LDFLAGS += --sort-section=alignment +endif + # Flag used to indicate if Crash reporting via console should be included # in BL31. This defaults to being present in DEBUG builds only ifndef CRASH_REPORTING