diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2018-04-18 10:03:22 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2018-05-04 15:58:52 +0200 |
commit | c27907e1bc5a46f3f95e72f901d7b0dfa3fa577f (patch) | |
tree | 2a0539e5c0c5725c607c000c615c1f479c6a8772 /mk/config.mk | |
parent | bc8fc882f344e6aa6b205c1859cb4537fa81a306 (diff) |
core: arm32: add support for dynamically linked TAs
This commit adds support for 32-bit dynamically linked Trusted
Applications. The config flag for this feature is CFG_TA_DYNLINK,
default enabled.
Why do this? Several reasons:
1. Save space in the TA storage area. The OP-TEE core libraries
(libutee, libutils, libmpa) could very well be provided as shared
objects (.so) rather than archive files (.a). They would be installed
only once in the TA storage, instead of being duplicated inside each TA.
2. Allow upgrade of some libraries without re-linking the TAs.
3. Pave the way to sharing code pages between TAs, thus potentially
reducing the memory footprint of the TEE.
The ELF loader is updated as follows:
- Locate the dynamic section in the program headers (PT_DYNAMIC entry).
- Find the required external libraries by looking for DT_NEEDED entries
in the dynamic section. Libraries are .so files signed like TAs and
identified by a UUID so that the TA stores can be re-used. Using a UUID
is also more flexible, because a new versions of a library may keep the
same UUID or use another one.
- Load all the libraries.
- Process the dynamic relocations of type R_ARM_GLOB_DAT and
R_ARM_JUMP_SLOT by resolving symbols by name, in breadth first order.
- Map the library code and data into the user VA space.
The stack unwinding code will be updated in a later commit. As a result
only the main executable may be unwound ; stack dumps will stop if the
call stack goes inside a shared library.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU)
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960 32/64)
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Joakim Bech <joakim.bech@linaro.org>
Diffstat (limited to 'mk/config.mk')
-rw-r--r-- | mk/config.mk | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mk/config.mk b/mk/config.mk index fcab13c3..1bc12086 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -211,6 +211,9 @@ ifeq ($(CFG_EARLY_TA),y) $(call force,CFG_ZLIB,y) endif +# Support for dynamically linked user TAs +CFG_TA_DYNLINK ?= y + # Enable paging, requires SRAM, can't be enabled by default CFG_WITH_PAGER ?= n |