summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChris Kay <chris.kay@arm.com>2022-12-22 13:26:37 +0000
committerChris Kay <chris.kay@arm.com>2023-02-15 10:24:14 +0000
commitac98b82a1f2e1ee323967a8a80e496e82ad9a832 (patch)
tree53084389021cf3178317fa1142595bdd2bb5e527 /Makefile
parentbe2a05058311855d8648d6682cd393ccf232a4e8 (diff)
downloadarm-trusted-firmware-ac98b82a1f2e1ee323967a8a80e496e82ad9a832.tar.gz
build: communicate correct page size to linker
This change communicates the common and maximum page sizes to the linker, which allows us to use the built-in constants that it provides to deal with page alignments. We only support 4K pages today so the fact these are fixed is not too much of an issue, but we will need to revisit this if we ever support other page sizes. Change-Id: I3358c51e70df794025ddf25209ae0e2a96550b0e Signed-off-by: Chris Kay <chris.kay@arm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 578083221..a69bfbb3b 100644
--- a/Makefile
+++ b/Makefile
@@ -456,6 +456,10 @@ else ifneq ($(findstring gcc,$(notdir $(LD))),)
# Pass ld options with Wl or Xlinker switches
TF_LDFLAGS += -Wl,--fatal-warnings -O1
TF_LDFLAGS += -Wl,--gc-sections
+
+TF_LDFLAGS += -Wl,-z,common-page-size=4096 # Configure page size constants
+TF_LDFLAGS += -Wl,-z,max-page-size=4096
+
ifeq ($(ENABLE_LTO),1)
ifeq (${ARCH},aarch64)
TF_LDFLAGS += -flto -fuse-linker-plugin
@@ -473,6 +477,10 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH)))
else
TF_LDFLAGS += -O1
TF_LDFLAGS += --gc-sections
+
+TF_LDFLAGS += -z common-page-size=4096 # Configure page size constants
+TF_LDFLAGS += -z max-page-size=4096
+
# ld.lld doesn't recognize the errata flags,
# therefore don't add those in that case.
# ld.lld reports section type mismatch warnings,