libc-tls.c 464 B

123456789101112131415161718
  1. #include <sysdeps/generic/libc-tls.c>
  2. #include <dl-tls.h>
  3. #if defined(USE_TLS) && USE_TLS
  4. /* On CSKY, linker optimizations are not required, so __tls_get_addr
  5. can be called even in statically linked binaries. In this case module
  6. must be always 1 and PT_TLS segment exist in the binary, otherwise it
  7. would not link. */
  8. void *
  9. __tls_get_addr (tls_index *ti)
  10. {
  11. dtv_t *dtv = THREAD_DTV ();
  12. return (char *) dtv[1].pointer.val + ti->ti_offset;
  13. }
  14. #endif