aboutsummaryrefslogtreecommitdiff
path: root/ldelf/include/elf_common.h
diff options
context:
space:
mode:
authorJerome Forissier <jerome@forissier.org>2020-07-21 10:54:59 +0200
committerJérôme Forissier <jerome@forissier.org>2020-08-06 11:10:44 +0200
commitfe6849487f7845d474828af162ddd882cbd3bb99 (patch)
tree52fe13a1c8362b8626eeaddd9f99afd47906708f /ldelf/include/elf_common.h
parentc88ba1258463bfa946499d2caa9341115b2fa849 (diff)
ldelf: arm64: support R_AARCH64_TLS_TPREL relocations
Preparing for C++ support in TAs. This commit adds support for relocation type R_AARCH64_TLS_TPREL. Although OP-TEE does not support multi-threaded TAs, introducing basic support for multi-threading will allow binaries generated by the aarch64-linux-gnueabihf-g++ compiler to work properly. Indeed, this compiler is configured for a multi-threadded environment by default. The way R_AARCH64_TLS_TPREL works is simple: the runtime library needs to keep a per-thread copy of all the TLS segments in the application. When the compiler needs to access a thread-specific symbol, it emits this relocation. The loader will then replace the value by the offset of the desired symbol in the Thread Control Block of the current thread (the address of the TCB is obtained via the TPIDR_EL0 register). The runtime code that sets up the TCB from the TLS segments will come in a later commit. Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'ldelf/include/elf_common.h')
-rw-r--r--ldelf/include/elf_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ldelf/include/elf_common.h b/ldelf/include/elf_common.h
index da18d395..ca59a46d 100644
--- a/ldelf/include/elf_common.h
+++ b/ldelf/include/elf_common.h
@@ -656,6 +656,7 @@ typedef struct {
#define R_AARCH64_GLOB_DAT 1025 /* Set GOT entry to data address. */
#define R_AARCH64_JUMP_SLOT 1026 /* Set GOT entry to code address. */
#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object. */
+#define R_AARCH64_TLS_TPREL 1030 /* Offset of the TLS block in the TCB */
#define R_ARM_NONE 0 /* No relocation. */
#define R_ARM_PC24 1