1 /* Copyright (C) 2005-2016 Free Software Foundation, Inc.
2 
3    The GNU C Library is free software; you can redistribute it and/or
4    modify it under the terms of the GNU Lesser General Public License as
5    published by the Free Software Foundation; either version 2.1 of the
6    License, or (at your option) any later version.
7 
8    The GNU C Library is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11    Lesser General Public License for more details.
12 
13    You should have received a copy of the GNU Lesser General Public
14    License along with the GNU C Library; if not, see
15    <http://www.gnu.org/licenses/>.  */
16 
17 /* Type used for the representation of TLS information in the GOT.  */
18 typedef struct
19 {
20   unsigned long int ti_module;
21   unsigned long int ti_offset;
22 } tls_index;
23 
24 /* The thread pointer points to the first static TLS block.  */
25 #define TLS_TP_OFFSET           0
26 
27 /* Dynamic thread vector pointers point 0x800 past the start of each
28    TLS block.  */
29 #define TLS_DTV_OFFSET          0x800
30 
31 extern void *__tls_get_addr (tls_index *ti);
32 
33 #define GET_ADDR_OFFSET        (ti->ti_offset + TLS_DTV_OFFSET)
34 #define __TLS_GET_ADDR(__ti)	(__tls_get_addr (__ti) - TLS_DTV_OFFSET)
35 
36 /* Value used for dtv entries for which the allocation is delayed.  */
37 #define TLS_DTV_UNALLOCATED    ((void *) -1l)
38