summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/rtl
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2023-06-08 13:52:47 +1000
committerChris Johns <chrisj@rtems.org>2023-08-21 11:16:17 +1000
commit27da374e481b0067896f70b21c9d89c04f87a101 (patch)
tree9e8d60b543f65dff785ab2c286463e051abfa09a /cpukit/include/rtems/rtl
parentspec/cpukit: Omit Cortex-M from libdebugger build (diff)
downloadrtems-27da374e481b0067896f70b21c9d89c04f87a101.tar.bz2
libdl: Add support to import base image TLS symbols
This change requires an rtems-tools update for symbol generation. Working architectures: - aarch64 - arm - powerpc - sparc No newlib TLS support but checked: - i386 - m69k Updates #4920
Diffstat (limited to 'cpukit/include/rtems/rtl')
-rw-r--r--cpukit/include/rtems/rtl/rtl-sym.h26
-rw-r--r--cpukit/include/rtems/rtl/rtl.h8
2 files changed, 29 insertions, 5 deletions
diff --git a/cpukit/include/rtems/rtl/rtl-sym.h b/cpukit/include/rtems/rtl/rtl-sym.h
index 0d29a6ae40..3502b303b8 100644
--- a/cpukit/include/rtems/rtl/rtl-sym.h
+++ b/cpukit/include/rtems/rtl/rtl-sym.h
@@ -63,6 +63,22 @@ typedef struct rtems_rtl_symbols
} rtems_rtl_symbols;
/**
+ * A TLS variable offset call. There is one per base image TLS
+ * variable.
+ */
+typedef size_t (*rtems_rtl_tls_offset_func)(void);
+
+/**
+ * A TLS symbol offset entry. It is used with an exported symbol table
+ * to find a TSL table offset for a variable at runtime.
+ */
+typedef struct rtems_rtl_tls_offset
+{
+ size_t index; /** exported symbol table index */
+ rtems_rtl_tls_offset_func offset; /** TLS offset function */
+} rtems_rtl_tls_offset;
+
+/**
* Open a symbol table with the specified number of buckets.
*
* @param symbols The symbol table to open.
@@ -101,10 +117,14 @@ void rtems_rtl_symbol_table_close (rtems_rtl_symbols* symbols);
* @param obj The object table the symbols are for.
* @param esyms The exported symbol table.
* @param size The size of the table in bytes.
+ * @param tls_offsets The TLS offsets table. If NULL none provided.
+ * @param tls_size The number TLS offset entries in the table.
*/
-bool rtems_rtl_symbol_global_add (rtems_rtl_obj* obj,
- const unsigned char* esyms,
- unsigned int size);
+bool rtems_rtl_symbol_global_add (rtems_rtl_obj* obj,
+ const unsigned char* esyms,
+ unsigned int size,
+ rtems_rtl_tls_offset* tls_offsets,
+ unsigned int tls_size);
/**
* Find a symbol given the symbol label in the global symbol table.
diff --git a/cpukit/include/rtems/rtl/rtl.h b/cpukit/include/rtems/rtl/rtl.h
index 0fd4e74cdf..bd3dce588a 100644
--- a/cpukit/include/rtems/rtl/rtl.h
+++ b/cpukit/include/rtems/rtl/rtl.h
@@ -393,9 +393,13 @@ bool rtems_rtl_path_prepend (const char* path);
*
* @param esyms The exported symbol table.
* @param count The size of the exported symbol table.
+ * @param tls_offsets The TLS offsets table. If NULL none provided.
+ * @param tls_size The number TLS offset entries in the table.
*/
-void rtems_rtl_base_sym_global_add (const unsigned char* esyms,
- unsigned int count);
+void rtems_rtl_base_sym_global_add (const unsigned char* esyms,
+ unsigned int count,
+ rtems_rtl_tls_offset* tls_offsets,
+ unsigned int tls_size);
/**
* Return the object file descriptor for the base image. The object file