summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Forissier <jerome@forissier.org>2021-01-14 15:38:52 +0100
committerJérôme Forissier <jerome@forissier.org>2021-01-15 13:03:20 +0100
commitccb9ae9018f72fce467d799572833111c8d323db (patch)
tree0ab6fc3c2314b3c6d339dc524aadb3ba7d9aaaf3
parentb6ca39d50b42896e12e359d156fbccd274031561 (diff)
ta: link.mk: export trace_ext_prefix and trace_level
Global data defined in user_ta_header.c need to be made visible to shared libraries because they may be referenced by them. For example, trace_level is ultimately referenced by the trace macros (IMSG() and similar). Therefore, when IMSG() is called in a shared library, the dynamic loader (ldelf) needs to locate the trace_level symbol in the TA. But since a TA is a "main executable" and not a shared library, the linker by default will not add all global symbols to the dynamic symbol table (.dynsym section). Instead those symbols are put in the static symbol table (.symtab) which is typically not used at run time and discarded when executables are stripped. In any case, ldelf only uses the dynamic symbol table. Add trace_ext_prefix and trace_level to the list of exported symbols to fix the IMSG() issue. Link: https://github.com/OP-TEE/optee_client/issues/242#issuecomment-755378055 Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--ta/arch/arm/link.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
index 3025acb1..cca6e6f4 100644
--- a/ta/arch/arm/link.mk
+++ b/ta/arch/arm/link.mk
@@ -42,6 +42,8 @@ $(link-out-dir$(sm))/dyn_list:
ifeq ($(CFG_FTRACE_SUPPORT),y)
$(q)echo "__ftrace_info;" >>$@
endif
+ $(q)echo "trace_ext_prefix;" >>$@
+ $(q)echo "trace_level;" >>$@
$(q)echo "};" >>$@
link-ldflags += --dynamic-list $(link-out-dir$(sm))/dyn_list
dynlistdep = $(link-out-dir$(sm))/dyn_list