Skip to content

Commit

Permalink
core: link.mk: force link of tee.elf when object list has changed
Browse files Browse the repository at this point in the history
Since the parent commit ("Add support for early Trusted Applications"),
the link step of tee.elf may pull object files generated from Trusted
Application binaries. This is controlled by $(EARLY_TA_PATHS). Adding
or removing files should cause tee.elf to be re-linked, even when no
re-compilation or change in the configuration variables occur. This is
not the case currently. For example:
 $ make EARLY_TA_PATHS="a.elf b.elf"
 $ make EARLY_TA_PATHS="a.elf"  # Should re-link without b.elf

The link recipe is modified so that the link step is forced when the
object list changes.

Signed-off-by: Jerome Forissier <[email protected]>
  • Loading branch information
jforissier committed Aug 22, 2017
1 parent 748fbdb commit 386f211
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/arch/arm/kernel/link.mk
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,20 @@ endef
$(link-out-dir)/version.o:
$(call gen-version-o)

-include $(link-out-dir)/.tee.elf.cmd
define check-link-objs
$(if $(strip $(filter-out $(link-objs), $(old-link-objs))
$(filter-out $(old-link-objs), $(link-objs))), FORCE_LINK := FORCE)
endef
$(eval $(call check-link-objs))

all: $(link-out-dir)/tee.elf
cleanfiles += $(link-out-dir)/tee.elf $(link-out-dir)/tee.map
cleanfiles += $(link-out-dir)/version.o
cleanfiles += $(link-out-dir)/.buildcount
$(link-out-dir)/tee.elf: $(link-objs) $(libdeps) $(link-script-pp)
cleanfiles += $(link-out-dir)/.tee.elf.cmd
$(link-out-dir)/tee.elf: $(link-objs) $(libdeps) $(link-script-pp) $(FORCE_LINK)
@echo "old-link-objs := $(link-objs)" >$(link-out-dir)/.tee.elf.cmd
@$(cmd-echo-silent) ' LD $@'
$(q)$(LDcore) $(ldargs-tee.elf) -o $@

Expand Down

0 comments on commit 386f211

Please sign in to comment.