diff options
author | Varun Wadekar <vwadekar@nvidia.com> | 2019-01-11 14:47:48 -0800 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2019-02-27 08:33:35 -0800 |
commit | c2ad38ce4fe754c750f3db480f732ac280f508e4 (patch) | |
tree | 7e8ee58a109c58a3f913e7c5ca0683706e19d2d3 /make_helpers | |
parent | ab3d22473df279c61ed4d4873d26b072dcf887e8 (diff) |
Tegra: Support for scatterfile for the BL31 image
This patch provides support for using the scatterfile format as
the linker script with the 'armlink' linker for Tegra platforms.
In order to enable the scatterfile usage the following changes
have been made:
* provide mapping for ld.S symbols in bl_common.h
* include bl_common.h from all the affected files
* update the makefile rules to use the scatterfile and armlink
to compile BL31
* update pubsub.h to add sections to the scatterfile
NOTE: THIS CHANGE HAS BEEN VERIFIED WITH TEGRA PLATFORMS ONLY.
Change-Id: I7bb78b991c97d74a842e5635c74cb0b18e0fce67
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'make_helpers')
-rw-r--r-- | make_helpers/build_macros.mk | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index 4a264d7e..5d33954a 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -355,8 +355,13 @@ $(eval $(call MAKE_LIB_OBJS,$(BUILD_DIR),$(SOURCES),$(1))) .PHONY : lib${1}_dirs lib${1}_dirs: | ${BUILD_DIR} ${LIB_DIR} ${ROMLIB_DIR} ${LIBWRAPPER_DIR} libraries: ${LIB_DIR}/lib$(1).a +ifneq ($(findstring armlink,$(notdir $(LD))),) +LDPATHS = --userlibpath=${LIB_DIR} +LDLIBS += --library=$(1) +else LDPATHS = -L${LIB_DIR} LDLIBS += -l$(1) +endif ifeq ($(USE_ROMLIB),1) LIBWRAPPER = -lwrappers @@ -421,9 +426,18 @@ else const char version_string[] = "${VERSION_STRING}";' | \ $$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o endif +ifneq ($(findstring armlink,$(notdir $(LD))),) + $$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) --entry=bl${1}_entrypoint \ + --predefine="-D__LINKER__=$(__LINKER__)" \ + --predefine="-DTF_CFLAGS=$(TF_CFLAGS)" \ + --map --list="$(MAPFILE)" --scatter=${PLAT_DIR}/scat/bl${1}.scat \ + $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS) \ + $(BUILD_DIR)/build_message.o $(OBJS) +else $$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) -Map=$(MAPFILE) \ --script $(LINKERFILE) $(BUILD_DIR)/build_message.o \ $(OBJS) $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS) +endif $(DUMP): $(ELF) $${ECHO} " OD $$@" |