diff options
author | Chris Johns <chrisj@rtems.org> | 2023-06-08 13:52:47 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2023-08-21 11:16:17 +1000 |
commit | 27da374e481b0067896f70b21c9d89c04f87a101 (patch) | |
tree | 9e8d60b543f65dff785ab2c286463e051abfa09a /testsuites | |
parent | spec/cpukit: Omit Cortex-M from libdebugger build (diff) | |
download | rtems-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 'testsuites')
-rw-r--r-- | testsuites/libtests/dl11/dl-load.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/testsuites/libtests/dl11/dl-load.c b/testsuites/libtests/dl11/dl-load.c index aee1517269..70d7bf1c65 100644 --- a/testsuites/libtests/dl11/dl-load.c +++ b/testsuites/libtests/dl11/dl-load.c @@ -37,10 +37,17 @@ #define TEST_TRACE 0 #if TEST_TRACE + #define SHOW_GLOBAL_SYMS 1 + #if SHOW_GLOBAL_SYMS + #define TRACE_GLOBAL_SYMBOL RTEMS_RTL_TRACE_GLOBAL_SYM + #else + #define TRACE_GLOBAL_SYMBOL 0 + #endif #define DEBUG_TRACE (RTEMS_RTL_TRACE_DETAIL | \ RTEMS_RTL_TRACE_WARNING | \ RTEMS_RTL_TRACE_LOAD | \ RTEMS_RTL_TRACE_UNLOAD | \ + TRACE_GLOBAL_SYMBOL | \ RTEMS_RTL_TRACE_SYMBOL | \ RTEMS_RTL_TRACE_RELOC | \ RTEMS_RTL_TRACE_ALLOCATOR | \ @@ -69,6 +76,9 @@ static void dl_load_dump (void) typedef int (*int_call_t)(void); typedef int* (*ptr_call_t)(void); +void* get_errno_ptr(void); +int get_errno(void); + int dl_load_test(void) { void* handle; @@ -116,7 +126,7 @@ int dl_load_test(void) } ptr_call_ret = ptr_call (); - if (ptr_call_ret != &errno) + if (ptr_call_ret != get_errno_ptr()) { printf("dlsym ptr_call failed: ret value bad\n"); return 1; @@ -124,7 +134,7 @@ int dl_load_test(void) errno = 12345; int_call_ret = int_call (); - if (int_call_ret != 12345) + if (int_call_ret != get_errno()) { printf("dlsym int_call failed: ret value bad\n"); return 1; @@ -140,3 +150,16 @@ int dl_load_test(void) return 0; } + +/* + * Disasseble these to see how the platform accesses TLS + */ +void* get_errno_ptr(void) +{ + return &errno; +} + +int get_errno(void) +{ + return errno; +} |