summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/arc/libc-tls.c
blob: f53ad112e398108445d75c9e5c173056f950d4b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * Thread-local storage handling in statically linked binaries.
 * Copyright (C) 2009 Free Software Foundation, Inc.
 *
 * Based on GNU C Library (file: libc/sysdeps/sh/libc-tls.c)
 *
 * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
 * Copyright (C) 2010 STMicroelectronics Ltd.
 *
 * Author: Filippo Arcidiacono <filippo.arcidiacono@st.com>
 *
 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
 */

#include <sysdeps/generic/libc-tls.c>
#include <dl-tls.h>

#if defined(USE_TLS) && USE_TLS

void *
__tls_get_addr (tls_index *ti)
{
  dtv_t *dtv = THREAD_DTV ();
  return (char *) dtv[1].pointer.val + ti->ti_offset;
}

#endif