Back to index

glibc  2.9
dl-tlsdesc.h
Go to the documentation of this file.
00001 /* Thread-local storage descriptor handling in the ELF dynamic linker.
00002    x86_64 version.
00003    Copyright (C) 2005, 2008 Free Software Foundation, Inc.
00004    This file is part of the GNU C Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #ifndef _X86_64_DL_TLSDESC_H
00022 # define _X86_64_DL_TLSDESC_H 1
00023 
00024 /* Use this to access DT_TLSDESC_PLT and DT_TLSDESC_GOT.  */
00025 #ifndef ADDRIDX
00026 # define ADDRIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \
00027                      + DT_EXTRANUM + DT_VALNUM + DT_ADDRTAGIDX (tag))
00028 #endif
00029 
00030 /* Type used to represent a TLS descriptor in the GOT.  */
00031 struct tlsdesc
00032 {
00033   ptrdiff_t (*entry)(struct tlsdesc *on_rax);
00034   void *arg;
00035 };
00036 
00037 typedef struct dl_tls_index
00038 {
00039   unsigned long int ti_module;
00040   unsigned long int ti_offset;
00041 } tls_index;
00042 
00043 /* Type used as the argument in a TLS descriptor for a symbol that
00044    needs dynamic TLS offsets.  */
00045 struct tlsdesc_dynamic_arg
00046 {
00047   tls_index tlsinfo;
00048   size_t gen_count;
00049 };
00050 
00051 extern ptrdiff_t attribute_hidden
00052   _dl_tlsdesc_return(struct tlsdesc *on_rax),
00053   _dl_tlsdesc_undefweak(struct tlsdesc *on_rax),
00054   _dl_tlsdesc_resolve_rela(struct tlsdesc *on_rax),
00055   _dl_tlsdesc_resolve_hold(struct tlsdesc *on_rax);
00056 
00057 # ifdef SHARED
00058 extern void *internal_function _dl_make_tlsdesc_dynamic (struct link_map *map,
00059                                                   size_t ti_offset);
00060 
00061 extern ptrdiff_t attribute_hidden _dl_tlsdesc_dynamic(struct tlsdesc *);
00062 # endif
00063 
00064 #endif