feat(st): adapt .stm32 file creation for clang
The LLVM/clang linker (ld.lld) does not genrate the same map file as
GCC. Adapt the commands to retrieve the load address and entry point
from this new file.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I54d18f01a96f14f2dc6d5844dc1e8085220706ae
diff --git a/plat/st/common/common_rules.mk b/plat/st/common/common_rules.mk
index 88c1087..bb7e3c5 100644
--- a/plat/st/common/common_rules.mk
+++ b/plat/st/common/common_rules.mk
@@ -71,8 +71,13 @@
tf-a-%.stm32: tf-a-%.bin ${STM32_DEPS}
$(s)echo
$(s)echo "Generate $@"
+ifeq ($($(ARCH)-ld-id),llvm-lld)
+ $(eval LOADADDR = 0x$(shell cat $(@:.stm32=.map) | grep '\.data$$' | awk '{print $$1}'))
+ $(eval ENTRY = 0x$(shell cat $(@:.stm32=.map) | grep "__BL2_IMAGE_START" | awk '{print $$1}'))
+else
$(eval LOADADDR = $(shell cat $(@:.stm32=.map) | grep '^RAM' | awk '{print $$2}'))
$(eval ENTRY = $(shell cat $(@:.stm32=.map) | grep "__BL2_IMAGE_START" | awk '{print $$1}'))
+endif
$(q)${STM32IMAGE} -s $< -d $@ \
-l $(LOADADDR) -e ${ENTRY} \
-v ${STM32_TF_VERSION} \