00001 /* 00002 Copyright (C) 2006-2007, Hewlett-Packard Company. All rights reserved. 00003 00004 Redistribution and use in source and binary forms, with or without modification, 00005 are permitted provided that the following conditions are met: 00006 00007 Redistributions of source code must retain the above copyright notice, this list 00008 of conditions and the following disclaimer. 00009 00010 Redistributions in binary form must reproduce the above copyright notice, this list 00011 of conditions and the following disclaimer in the documentation and/or other materials 00012 provided with the distribution. 00013 00014 Neither the name of the owner nor the names of its contributors may be used to endorse or 00015 promote products derived from this software without specific prior written permission. 00016 00017 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00018 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00019 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR 00020 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00021 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 00022 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00023 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 */ 00026 00027 #ifndef be_com_tls_INCLUDED 00028 #define be_com_tls_INCLUDED "tls.h" 00029 00030 #include "symtab.h" 00031 #include "sections.h" 00032 00033 /* GCC compatible Thread-Local-Storage support for open64 compiler */ 00034 00035 // TLS Access Model, it's GCC compatible on LINUX 00036 typedef enum { 00037 TLS_MODEL_UNKNOWN /* =0 */, 00038 TLS_MODEL_GLOBAL_DYNAMIC, 00039 TLS_MODEL_LOCAL_DYNAMIC, 00040 TLS_MODEL_INITIAL_EXEC, 00041 TLS_MODEL_LOCAL_EXEC, 00042 } TLS_MODEL; 00043 00044 extern TLS_MODEL TLS_model; /* TLS Access Model, parse from command line */ 00045 extern TY_IDX TLS_get_addr_ty_idx; /* TY_IDX of Pointer_Mtype __tls_get_addr(U8, U8); */ 00046 extern ST *TLS_get_addr_st; /* ST of '__tls_get_addr' */ 00047 00048 // These functions is implemented in tls.cxx 00049 extern void TLS_init(); /* Initialize the variables used by TLS */ 00050 extern void TLS_fini(); /* Finalize the TLS variables */ 00051 00052 static inline BOOL ST_is_tls(const ST* st) { 00053 if ( (ST_class(st) == CLASS_VAR && ST_is_thread_local(st) ) || 00054 (ST_class(st) == CLASS_BLOCK && SEC_is_tls(STB_section_idx(st)) ) ) { 00055 return TRUE; 00056 } 00057 else { 00058 return FALSE; 00059 } 00060 } 00061 00062 #endif // be_com_tls_INCLUDED 00063
1.5.6