From: Chris Kay Date: Thu, 26 Jan 2023 18:31:52 +0000 (+0000) Subject: build(trp): sort sections by alignment by default X-Git-Tag: baikal/aarch64/sdk5.10~1^2~62^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=2ed0936dd07da8faed8748ac7e7eb5433c4c5081;p=arm-tf.git build(trp): 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: Ife89a8bb9e592b55c761d9a3dfefc2aeeb07802f Signed-off-by: Chris Kay --- diff --git a/services/std_svc/rmmd/trp/trp.mk b/services/std_svc/rmmd/trp/trp.mk index e511bf5d1..b7bd31762 100644 --- a/services/std_svc/rmmd/trp/trp.mk +++ b/services/std_svc/rmmd/trp/trp.mk @@ -10,6 +10,12 @@ RMM_SOURCES += services/std_svc/rmmd/trp/trp_entry.S \ RMM_DEFAULT_LINKER_SCRIPT_SOURCE := services/std_svc/rmmd/trp/linker.ld.S +ifneq ($(findstring gcc,$(notdir $(LD))),) + RMM_LDFLAGS += -Wl,--sort-section=alignment +else ifneq ($(findstring ld,$(notdir $(LD))),) + RMM_LDFLAGS += --sort-section=alignment +endif + # Include the platform-specific TRP Makefile # If no platform-specific TRP Makefile exists, it means TRP is not supported # on this platform.