diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2019-02-07 15:15:51 +0100 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2019-02-08 10:55:35 +0100 |
commit | ce0bad5535aa5813f30da471a694d6cf5bc1d959 (patch) | |
tree | d0ba5e16310dbc3ff3b8b7a8155ef01380544940 /ta | |
parent | 1095cc2ec7398c1dc39020826a0556c841e530be (diff) |
ta: link.mk: set linker max-page-size to 4K
TA binaries contain a lot of zero padding (almost 64 KiB) between sections
.ta_head and .text. This value can be reduced to 4 KiB by reducing the
linker's max-page-size parameter. Since the OP-TEE ELF loader always
aligns on small page boundaries, it does not make sense to request a
larger alignment.
This patch adds "-z max-page-size=4096" to the linker flags so that the
alignment constraints are relaxed from 64 KiB (the default for our 32 and
64 targets as it seems) to what OP-TEE is actually expecting (4 KiB).
The TA file size is reduced by 60 KiB. It changes nothing to the layout
of the TA in memory.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'ta')
-rw-r--r-- | ta/arch/arm/link.mk | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk index c465629f..21ceb471 100644 --- a/ta/arch/arm/link.mk +++ b/ta/arch/arm/link.mk @@ -19,6 +19,7 @@ link-ldflags = -pie link-ldflags += -T $(link-script-pp$(sm)) link-ldflags += -Map=$(link-out-dir$(sm))/$(user-ta-uuid).map link-ldflags += --sort-section=alignment +link-ldflags += -z max-page-size=4096 # OP-TEE always uses 4K alignment link-ldadd = $(user-ta-ldadd) $(addprefix -L,$(libdirs)) link-ldadd += --start-group $(addprefix -l,$(libnames)) --end-group |