Back to index

glibc  2.9
ldsodefs.h
Go to the documentation of this file.
00001 /* Run-time dynamic linker data structures for loaded ELF shared objects.
00002    Copyright (C) 1995-2006, 2007, 2008 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef       _LDSODEFS_H
00021 #define       _LDSODEFS_H   1
00022 
00023 #include <features.h>
00024 
00025 #include <stdbool.h>
00026 #define __need_size_t
00027 #define __need_NULL
00028 #include <stddef.h>
00029 #include <string.h>
00030 
00031 #include <elf.h>
00032 #include <dlfcn.h>
00033 #include <fpu_control.h>
00034 #include <sys/mman.h>
00035 #include <link.h>
00036 #include <dl-lookupcfg.h>
00037 #include <dl-sysdep.h>
00038 #include <bits/libc-lock.h>
00039 #include <hp-timing.h>
00040 #include <tls.h>
00041 #include <kernel-features.h>
00042 
00043 __BEGIN_DECLS
00044 
00045 /* We use this macro to refer to ELF types independent of the native wordsize.
00046    `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'.  */
00047 #define ELFW(type)   _ElfW (ELF, __ELF_NATIVE_CLASS, type)
00048 
00049 /* All references to the value of l_info[DT_PLTGOT],
00050   l_info[DT_STRTAB], l_info[DT_SYMTAB], l_info[DT_RELA],
00051   l_info[DT_REL], l_info[DT_JMPREL], and l_info[VERSYMIDX (DT_VERSYM)]
00052   have to be accessed via the D_PTR macro.  The macro is needed since for
00053   most architectures the entry is already relocated - but for some not
00054   and we need to relocate at access time.  */
00055 #ifdef DL_RO_DYN_SECTION
00056 # define D_PTR(map, i) ((map)->i->d_un.d_ptr + (map)->l_addr)
00057 #else
00058 # define D_PTR(map, i) (map)->i->d_un.d_ptr
00059 #endif
00060 
00061 /* Result of the lookup functions and how to retrieve the base address.  */
00062 typedef struct link_map *lookup_t;
00063 #define LOOKUP_VALUE(map) map
00064 #define LOOKUP_VALUE_ADDRESS(map) ((map) ? (map)->l_addr : 0)
00065 
00066 /* On some architectures a pointer to a function is not just a pointer
00067    to the actual code of the function but rather an architecture
00068    specific descriptor. */
00069 #ifndef ELF_FUNCTION_PTR_IS_SPECIAL
00070 # define DL_SYMBOL_ADDRESS(map, ref) \
00071  (void *) (LOOKUP_VALUE_ADDRESS (map) + ref->st_value)
00072 # define DL_LOOKUP_ADDRESS(addr) ((ElfW(Addr)) (addr))
00073 # define DL_DT_INIT_ADDRESS(map, start) (start)
00074 # define DL_DT_FINI_ADDRESS(map, start) (start)
00075 #endif
00076 
00077 /* On some architectures dladdr can't use st_size of all symbols this way.  */
00078 #define DL_ADDR_SYM_MATCH(L, SYM, MATCHSYM, ADDR) \
00079   ((ADDR) >= (L)->l_addr + (SYM)->st_value                            \
00080    && ((((SYM)->st_shndx == SHN_UNDEF || (SYM)->st_size == 0)         \
00081        && (ADDR) == (L)->l_addr + (SYM)->st_value)                    \
00082        || (ADDR) < (L)->l_addr + (SYM)->st_value + (SYM)->st_size)    \
00083    && ((MATCHSYM) == NULL || (MATCHSYM)->st_value < (SYM)->st_value))
00084 
00085 /* Unmap a loaded object, called by _dl_close (). */
00086 #ifndef DL_UNMAP_IS_SPECIAL
00087 # define DL_UNMAP(map) \
00088  __munmap ((void *) (map)->l_map_start,                                     \
00089           (map)->l_map_end - (map)->l_map_start)
00090 #endif
00091 
00092 /* By default we do not need special support to initialize DSOs loaded
00093    by statically linked binaries.  */
00094 #ifndef DL_STATIC_INIT
00095 # define DL_STATIC_INIT(map)
00096 #endif
00097 
00098 /* Reloc type classes as returned by elf_machine_type_class().
00099    ELF_RTYPE_CLASS_PLT means this reloc should not be satisfied by
00100    some PLT symbol, ELF_RTYPE_CLASS_COPY means this reloc should not be
00101    satisfied by any symbol in the executable.  Some architectures do
00102    not support copy relocations.  In this case we define the macro to
00103    zero so that the code for handling them gets automatically optimized
00104    out.  */
00105 #define ELF_RTYPE_CLASS_PLT 1
00106 #ifndef DL_NO_COPY_RELOCS
00107 # define ELF_RTYPE_CLASS_COPY 2
00108 #else
00109 # define ELF_RTYPE_CLASS_COPY 0
00110 #endif
00111 
00112 /* ELF uses the PF_x macros to specify the segment permissions, mmap
00113    uses PROT_xxx.  In most cases the three macros have the values 1, 2,
00114    and 3 but not in a matching order.  The following macros allows
00115    converting from the PF_x values to PROT_xxx values.  */
00116 #define PF_TO_PROT \
00117   ((PROT_READ << (PF_R * 4))                                                \
00118    | (PROT_WRITE << (PF_W * 4))                                             \
00119    | (PROT_EXEC << (PF_X * 4))                                              \
00120    | ((PROT_READ | PROT_WRITE) << ((PF_R | PF_W) * 4))                      \
00121    | ((PROT_READ | PROT_EXEC) << ((PF_R | PF_X) * 4))                       \
00122    | ((PROT_WRITE | PROT_EXEC) << (PF_W | PF_X) * 4)                        \
00123    | ((PROT_READ | PROT_WRITE | PROT_EXEC) << ((PF_R | PF_W | PF_X) * 4)))
00124 
00125 
00126 /* For the version handling we need an array with only names and their
00127    hash values.  */
00128 struct r_found_version
00129   {
00130     const char *name;
00131     ElfW(Word) hash;
00132 
00133     int hidden;
00134     const char *filename;
00135   };
00136 
00137 /* We want to cache information about the searches for shared objects.  */
00138 
00139 enum r_dir_status { unknown, nonexisting, existing };
00140 
00141 struct r_search_path_elem
00142   {
00143     /* This link is only used in the `all_dirs' member of `r_search_path'.  */
00144     struct r_search_path_elem *next;
00145 
00146     /* Strings saying where the definition came from.  */
00147     const char *what;
00148     const char *where;
00149 
00150     /* Basename for this search path element.  The string must end with
00151        a slash character.  */
00152     const char *dirname;
00153     size_t dirnamelen;
00154 
00155     enum r_dir_status status[0];
00156   };
00157 
00158 struct r_strlenpair
00159   {
00160     const char *str;
00161     size_t len;
00162   };
00163 
00164 
00165 /* A data structure for a simple single linked list of strings.  */
00166 struct libname_list
00167   {
00168     const char *name;              /* Name requested (before search).  */
00169     struct libname_list *next;     /* Link to next name for this object.  */
00170     int dont_free;          /* Flag whether this element should be freed
00171                                if the object is not entirely unloaded.  */
00172   };
00173 
00174 
00175 /* Bit masks for the objects which valid callers can come from to
00176    functions with restricted interface.  */
00177 enum allowmask
00178   {
00179     allow_libc = 1,
00180     allow_libdl = 2,
00181     allow_libpthread = 4,
00182     allow_ldso = 8
00183   };
00184 
00185 
00186 /* Type for list of auditing interfaces.  */
00187 struct La_i86_regs;
00188 struct La_i86_retval;
00189 struct La_x86_64_regs;
00190 struct La_x86_64_retval;
00191 struct La_ppc32_regs;
00192 struct La_ppc32_retval;
00193 struct La_ppc64_regs;
00194 struct La_ppc64_retval;
00195 struct La_sh_regs;
00196 struct La_sh_retval;
00197 struct La_alpha_regs;
00198 struct La_alpha_retval;
00199 struct La_s390_32_regs;
00200 struct La_s390_32_retval;
00201 struct La_s390_64_regs;
00202 struct La_s390_64_retval;
00203 struct La_ia64_regs;
00204 struct La_ia64_retval;
00205 struct La_sparc32_regs;
00206 struct La_sparc32_retval;
00207 struct La_sparc64_regs;
00208 struct La_sparc64_retval;
00209 
00210 struct audit_ifaces
00211 {
00212   void (*activity) (uintptr_t *, unsigned int);
00213   char *(*objsearch) (const char *, uintptr_t *, unsigned int);
00214   unsigned int (*objopen) (struct link_map *, Lmid_t, uintptr_t *);
00215   void (*preinit) (uintptr_t *);
00216   union
00217   {
00218     uintptr_t (*symbind32) (Elf32_Sym *, unsigned int, uintptr_t *,
00219                          uintptr_t *, unsigned int *, const char *);
00220     uintptr_t (*symbind64) (Elf64_Sym *, unsigned int, uintptr_t *,
00221                          uintptr_t *, unsigned int *, const char *);
00222   };
00223   union
00224   {
00225     Elf32_Addr (*i86_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
00226                                 uintptr_t *, struct La_i86_regs *,
00227                                 unsigned int *, const char *name,
00228                                 long int *framesizep);
00229     Elf64_Addr (*x86_64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *,
00230                                    uintptr_t *, struct La_x86_64_regs *,
00231                                    unsigned int *, const char *name,
00232                                    long int *framesizep);
00233     Elf32_Addr (*ppc32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
00234                                   uintptr_t *, struct La_ppc32_regs *,
00235                                   unsigned int *, const char *name,
00236                                   long int *framesizep);
00237     Elf64_Addr (*ppc64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *,
00238                                   uintptr_t *, struct La_ppc64_regs *,
00239                                   unsigned int *, const char *name,
00240                                   long int *framesizep);
00241     uintptr_t (*sh_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
00242                               uintptr_t *, const struct La_sh_regs *,
00243                               unsigned int *, const char *name,
00244                               long int *framesizep);
00245     Elf64_Addr (*alpha_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *,
00246                                   uintptr_t *, struct La_alpha_regs *,
00247                                   unsigned int *, const char *name,
00248                                   long int *framesizep);
00249     Elf32_Addr (*s390_32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
00250                                    uintptr_t *, struct La_s390_32_regs *,
00251                                    unsigned int *, const char *name,
00252                                    long int *framesizep);
00253     Elf64_Addr (*s390_64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *,
00254                                    uintptr_t *, struct La_s390_64_regs *,
00255                                    unsigned int *, const char *name,
00256                                    long int *framesizep);
00257     Elf64_Addr (*ia64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *,
00258                                  uintptr_t *, struct La_ia64_regs *,
00259                                  unsigned int *, const char *name,
00260                                  long int *framesizep);
00261     Elf32_Addr (*sparc32_gnu_pltenter) (Elf32_Sym *, unsigned int,
00262                                    uintptr_t *, uintptr_t *,
00263                                    const struct La_sparc32_regs *,
00264                                    unsigned int *, const char *name,
00265                                    long int *framesizep);
00266     Elf64_Addr (*sparc64_gnu_pltenter) (Elf64_Sym *, unsigned int,
00267                                    uintptr_t *, uintptr_t *,
00268                                    const struct La_sparc64_regs *,
00269                                    unsigned int *, const char *name,
00270                                    long int *framesizep);
00271 #ifdef ARCH_PLTENTER_MEMBERS
00272     ARCH_PLTENTER_MEMBERS;
00273 #endif
00274   };
00275   union
00276   {
00277     unsigned int (*i86_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
00278                                  uintptr_t *, const struct La_i86_regs *,
00279                                  struct La_i86_retval *, const char *);
00280     unsigned int (*x86_64_gnu_pltexit) (Elf64_Sym *, unsigned int, uintptr_t *,
00281                                    uintptr_t *,
00282                                    const struct La_x86_64_regs *,
00283                                    struct La_x86_64_retval *,
00284                                    const char *);
00285     unsigned int (*ppc32_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
00286                                    uintptr_t *,
00287                                    const struct La_ppc32_regs *,
00288                                    struct La_ppc32_retval *, const char *);
00289     unsigned int (*ppc64_gnu_pltexit) (Elf64_Sym *, unsigned int, uintptr_t *,
00290                                    uintptr_t *,
00291                                    const struct La_ppc64_regs *,
00292                                    struct La_ppc64_retval *, const char *);
00293     unsigned int (*sh_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
00294                                 uintptr_t *, const struct La_sh_regs *,
00295                                 struct La_sh_retval *, const char *);
00296     unsigned int (*alpha_gnu_pltexit) (Elf64_Sym *, unsigned int, uintptr_t *,
00297                                    uintptr_t *,
00298                                    const struct La_alpha_regs *,
00299                                    struct La_alpha_retval *, const char *);
00300     unsigned int (*s390_32_gnu_pltexit) (Elf32_Sym *, unsigned int,
00301                                     uintptr_t *, uintptr_t *,
00302                                     const struct La_s390_32_regs *,
00303                                     struct La_s390_32_retval *,
00304                                     const char *);
00305     unsigned int (*s390_64_gnu_pltexit) (Elf64_Sym *, unsigned int,
00306                                     uintptr_t *, uintptr_t *,
00307                                     const struct La_s390_64_regs *,
00308                                     struct La_s390_64_retval *,
00309                                     const char *);
00310     unsigned int (*ia64_gnu_pltexit) (Elf64_Sym *, unsigned int, uintptr_t *,
00311                                   uintptr_t *,
00312                                   const struct La_ia64_regs *,
00313                                   struct La_ia64_retval *, const char *);
00314     unsigned int (*sparc32_gnu_pltexit) (Elf32_Sym *, unsigned int,
00315                                     uintptr_t *, uintptr_t *,
00316                                     const struct La_sparc32_regs *,
00317                                     struct La_sparc32_retval *,
00318                                     const char *);
00319     unsigned int (*sparc64_gnu_pltexit) (Elf64_Sym *, unsigned int,
00320                                     uintptr_t *, uintptr_t *,
00321                                     const struct La_sparc32_regs *,
00322                                     struct La_sparc32_retval *,
00323                                     const char *);
00324 #ifdef ARCH_PLTEXIT_MEMBERS
00325     ARCH_PLTEXIT_MEMBERS;
00326 #endif
00327   };
00328   unsigned int (*objclose) (uintptr_t *);
00329 
00330   struct audit_ifaces *next;
00331 };
00332 
00333 
00334 /* Test whether given NAME matches any of the names of the given object.  */
00335 extern int _dl_name_match_p (const char *__name, const struct link_map *__map)
00336      internal_function;
00337 
00338 /* Function used as argument for `_dl_receive_error' function.  The
00339    arguments are the error code, error string, and the objname the
00340    error occurred in.  */
00341 typedef void (*receiver_fct) (int, const char *, const char *);
00342 
00343 /* Internal functions of the run-time dynamic linker.
00344    These can be accessed if you link again the dynamic linker
00345    as a shared library, as in `-lld' or `/lib/ld.so' explicitly;
00346    but are not normally of interest to user programs.
00347 
00348    The `-ldl' library functions in <dlfcn.h> provide a simple
00349    user interface to run-time dynamic linking.  */
00350 
00351 
00352 #ifndef SHARED
00353 # define EXTERN extern
00354 # define GL(name) _##name
00355 #else
00356 # define EXTERN
00357 # ifdef IS_IN_rtld
00358 #  define GL(name) _rtld_local._##name
00359 # else
00360 #  define GL(name) _rtld_global._##name
00361 # endif
00362 struct rtld_global
00363 {
00364 #endif
00365   /* Don't change the order of the following elements.  'dl_loaded'
00366      must remain the first element.  Forever.  */
00367 
00368 /* Non-shared code has no support for multiple namespaces.  */
00369 #ifdef SHARED
00370 # define DL_NNS 16
00371 #else
00372 # define DL_NNS 1
00373 #endif
00374   EXTERN struct link_namespaces
00375   {
00376     /* A pointer to the map for the main map.  */
00377     struct link_map *_ns_loaded;
00378     /* Number of object in the _dl_loaded list.  */
00379     unsigned int _ns_nloaded;
00380     /* Direct pointer to the searchlist of the main object.  */
00381     struct r_scope_elem *_ns_main_searchlist;
00382     /* This is zero at program start to signal that the global scope map is
00383        allocated by rtld.  Later it keeps the size of the map.  It might be
00384        reset if in _dl_close if the last global object is removed.  */
00385     size_t _ns_global_scope_alloc;
00386     /* Keep track of changes to each namespace' list.  */
00387     struct r_debug _ns_debug;
00388   } _dl_ns[DL_NNS];
00389 
00390   /* During the program run we must not modify the global data of
00391      loaded shared object simultanously in two threads.  Therefore we
00392      protect `_dl_open' and `_dl_close' in dl-close.c.
00393 
00394      This must be a recursive lock since the initializer function of
00395      the loaded object might as well require a call to this function.
00396      At this time it is not anymore a problem to modify the tables.  */
00397   __rtld_lock_define_recursive (EXTERN, _dl_load_lock)
00398 
00399   /* Incremented whenever something may have been added to dl_loaded.  */
00400   EXTERN unsigned long long _dl_load_adds;
00401 
00402 #ifndef MAP_ANON
00403   /* File descriptor referring to the zero-fill device.  */
00404   EXTERN int _dl_zerofd;
00405 #endif
00406 
00407   /* The object to be initialized first.  */
00408   EXTERN struct link_map *_dl_initfirst;
00409 
00410 #if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL
00411   /* Start time on CPU clock.  */
00412   EXTERN hp_timing_t _dl_cpuclock_offset;
00413 #endif
00414 
00415   /* Map of shared object to be profiled.  */
00416   EXTERN struct link_map *_dl_profile_map;
00417 
00418   /* Counters for the number of relocations performed.  */
00419   EXTERN unsigned long int _dl_num_relocations;
00420   EXTERN unsigned long int _dl_num_cache_relocations;
00421 
00422   /* List of search directories.  */
00423   EXTERN struct r_search_path_elem *_dl_all_dirs;
00424 
00425 #ifdef _LIBC_REENTRANT
00426   EXTERN void **(*_dl_error_catch_tsd) (void) __attribute__ ((const));
00427 #endif
00428 
00429   /* Structure describing the dynamic linker itself.  We need to
00430      reserve memory for the data the audit libraries need.  */
00431   EXTERN struct link_map _dl_rtld_map;
00432 #ifdef SHARED
00433   struct auditstate audit_data[DL_NNS];
00434 #endif
00435 
00436 #if defined SHARED && defined _LIBC_REENTRANT \
00437     && defined __rtld_lock_default_lock_recursive
00438   EXTERN void (*_dl_rtld_lock_recursive) (void *);
00439   EXTERN void (*_dl_rtld_unlock_recursive) (void *);
00440 #endif
00441 
00442   /* If loading a shared object requires that we make the stack executable
00443      when it was not, we do it by calling this function.
00444      It returns an errno code or zero on success.  */
00445   EXTERN int (*_dl_make_stack_executable_hook) (void **) internal_function;
00446 
00447   /* Prevailing state of the stack, PF_X indicating it's executable.  */
00448   EXTERN ElfW(Word) _dl_stack_flags;
00449 
00450   /* Flag signalling whether there are gaps in the module ID allocation.  */
00451   EXTERN bool _dl_tls_dtv_gaps;
00452   /* Highest dtv index currently needed.  */
00453   EXTERN size_t _dl_tls_max_dtv_idx;
00454   /* Information about the dtv slots.  */
00455   EXTERN struct dtv_slotinfo_list
00456   {
00457     size_t len;
00458     struct dtv_slotinfo_list *next;
00459     struct dtv_slotinfo
00460     {
00461       size_t gen;
00462       struct link_map *map;
00463     } slotinfo[0];
00464   } *_dl_tls_dtv_slotinfo_list;
00465   /* Number of modules in the static TLS block.  */
00466   EXTERN size_t _dl_tls_static_nelem;
00467   /* Size of the static TLS block.  */
00468   EXTERN size_t _dl_tls_static_size;
00469   /* Size actually allocated in the static TLS block.  */
00470   EXTERN size_t _dl_tls_static_used;
00471   /* Alignment requirement of the static TLS block.  */
00472   EXTERN size_t _dl_tls_static_align;
00473 
00474 /* Number of additional entries in the slotinfo array of each slotinfo
00475    list element.  A large number makes it almost certain take we never
00476    have to iterate beyond the first element in the slotinfo list.  */
00477 #define TLS_SLOTINFO_SURPLUS (62)
00478 
00479 /* Number of additional slots in the dtv allocated.  */
00480 #define DTV_SURPLUS  (14)
00481 
00482   /* Initial dtv of the main thread, not allocated with normal malloc.  */
00483   EXTERN void *_dl_initial_dtv;
00484   /* Generation counter for the dtv.  */
00485   EXTERN size_t _dl_tls_generation;
00486 
00487   EXTERN void (*_dl_init_static_tls) (struct link_map *);
00488 
00489   EXTERN void (*_dl_wait_lookup_done) (void);
00490 
00491   /* Scopes to free after next THREAD_GSCOPE_WAIT ().  */
00492   EXTERN struct dl_scope_free_list
00493   {
00494     size_t count;
00495     void *list[50];
00496   } *_dl_scope_free_list;
00497 #ifdef SHARED
00498 };
00499 # define __rtld_global_attribute__
00500 # ifdef IS_IN_rtld
00501 #  ifdef HAVE_SDATA_SECTION
00502 #   define __rtld_local_attribute__ \
00503            __attribute__ ((visibility ("hidden"), section (".sdata")))
00504 #   undef __rtld_global_attribute__
00505 #   define __rtld_global_attribute__ __attribute__ ((section (".sdata")))
00506 #  else
00507 #   define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
00508 #  endif
00509 extern struct rtld_global _rtld_local __rtld_local_attribute__;
00510 #  undef __rtld_local_attribute__
00511 # endif
00512 extern struct rtld_global _rtld_global __rtld_global_attribute__;
00513 # undef __rtld_global_attribute__
00514 #endif
00515 
00516 #ifndef SHARED
00517 # define GLRO(name) _##name
00518 #else
00519 # ifdef IS_IN_rtld
00520 #  define GLRO(name) _rtld_local_ro._##name
00521 # else
00522 #  define GLRO(name) _rtld_global_ro._##name
00523 # endif
00524 struct rtld_global_ro
00525 {
00526 #endif
00527 
00528   /* If nonzero the appropriate debug information is printed.  */
00529   EXTERN int _dl_debug_mask;
00530 #define DL_DEBUG_LIBS           (1 << 0)
00531 #define DL_DEBUG_IMPCALLS   (1 << 1)
00532 #define DL_DEBUG_BINDINGS   (1 << 2)
00533 #define DL_DEBUG_SYMBOLS    (1 << 3)
00534 #define DL_DEBUG_VERSIONS   (1 << 4)
00535 #define DL_DEBUG_RELOC      (1 << 5)
00536 #define DL_DEBUG_FILES      (1 << 6)
00537 #define DL_DEBUG_STATISTICS (1 << 7)
00538 #define DL_DEBUG_UNUSED         (1 << 8)
00539 /* These two are used only internally.  */
00540 #define DL_DEBUG_HELP       (1 << 9)
00541 #define DL_DEBUG_PRELINK    (1 << 10)
00542 
00543   /* OS version.  */
00544   EXTERN unsigned int _dl_osversion;
00545   /* Platform name.  */
00546   EXTERN const char *_dl_platform;
00547   EXTERN size_t _dl_platformlen;
00548 
00549   /* Cached value of `getpagesize ()'.  */
00550   EXTERN size_t _dl_pagesize;
00551 
00552   /* Copy of the content of `_dl_main_searchlist' at startup time.  */
00553   EXTERN struct r_scope_elem _dl_initial_searchlist;
00554 
00555   /* CLK_TCK as reported by the kernel.  */
00556   EXTERN int _dl_clktck;
00557 
00558   /* If nonzero print warnings messages.  */
00559   EXTERN int _dl_verbose;
00560 
00561   /* File descriptor to write debug messages to.  */
00562   EXTERN int _dl_debug_fd;
00563 
00564   /* Do we do lazy relocations?  */
00565   EXTERN int _dl_lazy;
00566 
00567   /* Nonzero if runtime lookups should not update the .got/.plt.  */
00568   EXTERN int _dl_bind_not;
00569 
00570   /* Nonzero if references should be treated as weak during runtime
00571      linking.  */
00572   EXTERN int _dl_dynamic_weak;
00573 
00574   /* Default floating-point control word.  */
00575   EXTERN fpu_control_t _dl_fpu_control;
00576 
00577   /* Expected cache ID.  */
00578   EXTERN int _dl_correct_cache_id;
00579 
00580   /* Mask for hardware capabilities that are available.  */
00581   EXTERN uint64_t _dl_hwcap;
00582 
00583   /* Mask for important hardware capabilities we honour. */
00584   EXTERN uint64_t _dl_hwcap_mask;
00585 
00586   /* Get architecture specific definitions.  */
00587 #define PROCINFO_DECL
00588 #ifndef PROCINFO_CLASS
00589 # define PROCINFO_CLASS EXTERN
00590 #endif
00591 #include <dl-procinfo.c>
00592 
00593   /* Names of shared object for which the RPATH should be ignored.  */
00594   EXTERN const char *_dl_inhibit_rpath;
00595 
00596   /* Location of the binary.  */
00597   EXTERN const char *_dl_origin_path;
00598 
00599   /* -1 if the dynamic linker should honor library load bias,
00600      0 if not, -2 use the default (honor biases for normal
00601      binaries, don't honor for PIEs).  */
00602   EXTERN ElfW(Addr) _dl_use_load_bias;
00603 
00604   /* Name of the shared object to be profiled (if any).  */
00605   EXTERN const char *_dl_profile;
00606   /* Filename of the output file.  */
00607   EXTERN const char *_dl_profile_output;
00608   /* Name of the object we want to trace the prelinking.  */
00609   EXTERN const char *_dl_trace_prelink;
00610   /* Map of shared object to be prelink traced.  */
00611   EXTERN struct link_map *_dl_trace_prelink_map;
00612 
00613   /* All search directories defined at startup.  */
00614   EXTERN struct r_search_path_elem *_dl_init_all_dirs;
00615 
00616 #if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL
00617   /* Overhead of a high-precision timing measurement.  */
00618   EXTERN hp_timing_t _dl_hp_timing_overhead;
00619 #endif
00620 
00621 #ifdef NEED_DL_SYSINFO
00622   /* Syscall handling improvements.  This is very specific to x86.  */
00623   EXTERN uintptr_t _dl_sysinfo;
00624 #endif
00625 
00626 #if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
00627   /* The vsyscall page is a virtual DSO pre-mapped by the kernel.
00628      This points to its ELF header.  */
00629   EXTERN const ElfW(Ehdr) *_dl_sysinfo_dso;
00630 
00631   /* At startup time we set up the normal DSO data structure for it,
00632      and this points to it.  */
00633   EXTERN struct link_map *_dl_sysinfo_map;
00634 #endif
00635 
00636 #ifdef SHARED
00637   /* We add a function table to _rtld_global which is then used to
00638      call the function instead of going through the PLT.  The result
00639      is that we can avoid exporting the functions and we do not jump
00640      PLT relocations in libc.so.  */
00641   void (*_dl_debug_printf) (const char *, ...)
00642        __attribute__ ((__format__ (__printf__, 1, 2)));
00643   int (internal_function *_dl_catch_error) (const char **, const char **,
00644                                        bool *, void (*) (void *), void *);
00645   void (internal_function *_dl_signal_error) (int, const char *, const char *,
00646                                          const char *);
00647   void (*_dl_mcount) (ElfW(Addr) frompc, ElfW(Addr) selfpc);
00648   lookup_t (internal_function *_dl_lookup_symbol_x) (const char *,
00649                                                struct link_map *,
00650                                                const ElfW(Sym) **,
00651                                                struct r_scope_elem *[],
00652                                                const struct r_found_version *,
00653                                                int, int,
00654                                                struct link_map *);
00655   int (*_dl_check_caller) (const void *, enum allowmask);
00656   void *(*_dl_open) (const char *file, int mode, const void *caller_dlopen,
00657                    Lmid_t nsid, int argc, char *argv[], char *env[]);
00658   void (*_dl_close) (void *map);
00659   void *(*_dl_tls_get_addr_soft) (struct link_map *);
00660 #ifdef HAVE_DL_DISCOVER_OSVERSION
00661   int (*_dl_discover_osversion) (void);
00662 #endif
00663 
00664   /* List of auditing interfaces.  */
00665   struct audit_ifaces *_dl_audit;
00666   unsigned int _dl_naudit;
00667 
00668   /* 0 if internal pointer values should not be guarded, 1 if they should.  */
00669   EXTERN int _dl_pointer_guard;
00670 };
00671 # define __rtld_global_attribute__
00672 # ifdef IS_IN_rtld
00673 #  define __rtld_local_attribute__ __attribute__ ((visibility ("hidden")))
00674 extern struct rtld_global_ro _rtld_local_ro
00675     attribute_relro __rtld_local_attribute__;
00676 extern struct rtld_global_ro _rtld_global_ro
00677     attribute_relro __rtld_global_attribute__;
00678 #  undef __rtld_local_attribute__
00679 # else
00680 /* We cheat a bit here.  We declare the variable as as const even
00681    though it is at startup.  */
00682 extern const struct rtld_global_ro _rtld_global_ro
00683     attribute_relro __rtld_global_attribute__;
00684 # endif
00685 # undef __rtld_global_attribute__
00686 #endif
00687 #undef EXTERN
00688 
00689 #ifdef IS_IN_rtld
00690 /* This is the initial value of GL(dl_error_catch_tsd).
00691    A non-TLS libpthread will change it.  */
00692 extern void **_dl_initial_error_catch_tsd (void) __attribute__ ((const))
00693      attribute_hidden;
00694 #endif
00695 
00696 /* This is the initial value of GL(dl_make_stack_executable_hook).
00697    A threads library can change it.  */
00698 extern int _dl_make_stack_executable (void **stack_endp) internal_function;
00699 rtld_hidden_proto (_dl_make_stack_executable)
00700 
00701 /* Variable pointing to the end of the stack (or close to it).  This value
00702    must be constant over the runtime of the application.  Some programs
00703    might use the variable which results in copy relocations on some
00704    platforms.  But this does not matter, ld.so can always use the local
00705    copy.  */
00706 extern void *__libc_stack_end attribute_relro;
00707 rtld_hidden_proto (__libc_stack_end)
00708 
00709 /* Parameters passed to the dynamic linker.  */
00710 extern int _dl_argc attribute_hidden attribute_relro;
00711 extern char **_dl_argv
00712 #ifndef DL_ARGV_NOT_RELRO
00713      attribute_relro
00714 #endif
00715      ;
00716 #ifdef IS_IN_rtld
00717 extern char **_dl_argv_internal attribute_hidden
00718 # ifndef DL_ARGV_NOT_RELRO
00719      attribute_relro
00720 # endif
00721      ;
00722 # define rtld_progname (INTUSE(_dl_argv)[0])
00723 #else
00724 # define rtld_progname _dl_argv[0]
00725 #endif
00726 
00727 /* Flag set at startup and cleared when the last initializer has run.  */
00728 extern int _dl_starting_up;
00729 weak_extern (_dl_starting_up)
00730 #ifdef IS_IN_rtld
00731 extern int _dl_starting_up_internal attribute_hidden;
00732 #endif
00733 
00734 /* OS-dependent function to open the zero-fill device.  */
00735 extern int _dl_sysdep_open_zero_fill (void); /* dl-sysdep.c */
00736 
00737 
00738 /* Write message on the debug file descriptor.  The parameters are
00739    interpreted as for a `printf' call.  All the lines start with a
00740    tag showing the PID.  */
00741 extern void _dl_debug_printf (const char *fmt, ...)
00742      __attribute__ ((__format__ (__printf__, 1, 2))) attribute_hidden;
00743 
00744 /* Write message on the debug file descriptor.  The parameters are
00745    interpreted as for a `printf' call.  All the lines buf the first
00746    start with a tag showing the PID.  */
00747 extern void _dl_debug_printf_c (const char *fmt, ...)
00748      __attribute__ ((__format__ (__printf__, 1, 2)));
00749 
00750 
00751 /* Write a message on the specified descriptor FD.  The parameters are
00752    interpreted as for a `printf' call.  */
00753 extern void _dl_dprintf (int fd, const char *fmt, ...)
00754      __attribute__ ((__format__ (__printf__, 2, 3)))
00755      attribute_hidden;
00756 
00757 /* Write a message on the specified descriptor standard output.  The
00758    parameters are interpreted as for a `printf' call.  */
00759 #define _dl_printf(fmt, args...) \
00760   _dl_dprintf (STDOUT_FILENO, fmt, ##args)
00761 
00762 /* Write a message on the specified descriptor standard error.  The
00763    parameters are interpreted as for a `printf' call.  */
00764 #define _dl_error_printf(fmt, args...) \
00765   _dl_dprintf (STDERR_FILENO, fmt, ##args)
00766 
00767 /* Write a message on the specified descriptor standard error and exit
00768    the program.  The parameters are interpreted as for a `printf' call.  */
00769 #define _dl_fatal_printf(fmt, args...) \
00770   do                                                                 \
00771     {                                                                \
00772       _dl_dprintf (STDERR_FILENO, fmt, ##args);                             \
00773       _exit (127);                                                   \
00774     }                                                                \
00775   while (1)
00776 
00777 
00778 /* This function is called by all the internal dynamic linker functions
00779    when they encounter an error.  ERRCODE is either an `errno' code or
00780    zero; OBJECT is the name of the problematical shared object, or null if
00781    it is a general problem; ERRSTRING is a string describing the specific
00782    problem.  */
00783 extern void _dl_signal_error (int errcode, const char *object,
00784                            const char *occurred, const char *errstring)
00785      internal_function __attribute__ ((__noreturn__)) attribute_hidden;
00786 
00787 /* Like _dl_signal_error, but may return when called in the context of
00788    _dl_receive_error.  */
00789 extern void _dl_signal_cerror (int errcode, const char *object,
00790                             const char *occation, const char *errstring)
00791      internal_function;
00792 
00793 /* Call OPERATE, receiving errors from `dl_signal_cerror'.  Unlike
00794    `_dl_catch_error' the operation is resumed after the OPERATE
00795    function returns.
00796    ARGS is passed as argument to OPERATE.  */
00797 extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *),
00798                             void *args)
00799      internal_function;
00800 
00801 
00802 /* Open the shared object NAME and map in its segments.
00803    LOADER's DT_RPATH is used in searching for NAME.
00804    If the object is already opened, returns its existing map.
00805    For preloaded shared objects PRELOADED is set to a non-zero
00806    value to allow additional security checks.  */
00807 extern struct link_map *_dl_map_object (struct link_map *loader,
00808                                    const char *name, int preloaded,
00809                                    int type, int trace_mode, int mode,
00810                                    Lmid_t nsid)
00811      internal_function attribute_hidden;
00812 
00813 /* Call _dl_map_object on the dependencies of MAP, and set up
00814    MAP->l_searchlist.  PRELOADS points to a vector of NPRELOADS previously
00815    loaded objects that will be inserted into MAP->l_searchlist after MAP
00816    but before its dependencies.  */
00817 extern void _dl_map_object_deps (struct link_map *map,
00818                              struct link_map **preloads,
00819                              unsigned int npreloads, int trace_mode,
00820                              int open_mode)
00821      internal_function attribute_hidden;
00822 
00823 /* Cache the locations of MAP's hash table.  */
00824 extern void _dl_setup_hash (struct link_map *map)
00825      internal_function attribute_hidden;
00826 
00827 
00828 /* Collect the directories in the search path for LOADER's dependencies.
00829    The data structure is defined in <dlfcn.h>.  If COUNTING is true,
00830    SI->dls_cnt and SI->dls_size are set; if false, those must be as set
00831    by a previous call with COUNTING set, and SI must point to SI->dls_size
00832    bytes to be used in filling in the result.  */
00833 extern void _dl_rtld_di_serinfo (struct link_map *loader,
00834                              Dl_serinfo *si, bool counting)
00835      internal_function;
00836 
00837 
00838 /* Search loaded objects' symbol tables for a definition of the symbol
00839    referred to by UNDEF.  *SYM is the symbol table entry containing the
00840    reference; it is replaced with the defining symbol, and the base load
00841    address of the defining object is returned.  SYMBOL_SCOPE is a
00842    null-terminated list of object scopes to search; each object's
00843    l_searchlist (i.e. the segment of the dependency tree starting at that
00844    object) is searched in turn.  REFERENCE_NAME should name the object
00845    containing the reference; it is used in error messages.
00846    TYPE_CLASS describes the type of symbol we are looking for.  */
00847 enum
00848   {
00849     /* If necessary add dependency between user and provider object.  */
00850     DL_LOOKUP_ADD_DEPENDENCY = 1,
00851     /* Return most recent version instead of default version for
00852        unversioned lookup.  */
00853     DL_LOOKUP_RETURN_NEWEST = 2,
00854     /* Set if dl_lookup* called with GSCOPE lock held.  */
00855     DL_LOOKUP_GSCOPE_LOCK = 4,
00856   };
00857 
00858 /* Lookup versioned symbol.  */
00859 extern lookup_t _dl_lookup_symbol_x (const char *undef,
00860                                  struct link_map *undef_map,
00861                                  const ElfW(Sym) **sym,
00862                                  struct r_scope_elem *symbol_scope[],
00863                                  const struct r_found_version *version,
00864                                  int type_class, int flags,
00865                                  struct link_map *skip_map)
00866      internal_function attribute_hidden;
00867 
00868 
00869 /* Look up symbol NAME in MAP's scope and return its run-time address.  */
00870 extern ElfW(Addr) _dl_symbol_value (struct link_map *map, const char *name)
00871      internal_function;
00872 
00873 /* Allocate a `struct link_map' for a new object being loaded,
00874    and enter it into the _dl_main_map list.  */
00875 extern struct link_map *_dl_new_object (char *realname, const char *libname,
00876                                    int type, struct link_map *loader,
00877                                    int mode, Lmid_t nsid)
00878      internal_function attribute_hidden;
00879 
00880 /* Relocate the given object (if it hasn't already been).
00881    SCOPE is passed to _dl_lookup_symbol in symbol lookups.
00882    If LAZY is nonzero, don't relocate its PLT.  */
00883 extern void _dl_relocate_object (struct link_map *map,
00884                              struct r_scope_elem *scope[],
00885                              int lazy, int consider_profiling)
00886      attribute_hidden;
00887 
00888 /* Protect PT_GNU_RELRO area.  */
00889 extern void _dl_protect_relro (struct link_map *map)
00890      internal_function attribute_hidden;
00891 
00892 /* Call _dl_signal_error with a message about an unhandled reloc type.
00893    TYPE is the result of ELFW(R_TYPE) (r_info), i.e. an R_<CPU>_* value.
00894    PLT is nonzero if this was a PLT reloc; it just affects the message.  */
00895 extern void _dl_reloc_bad_type (struct link_map *map,
00896                             unsigned int type, int plt)
00897      internal_function __attribute__ ((__noreturn__));
00898 
00899 /* Resolve conflicts if prelinking.  */
00900 extern void _dl_resolve_conflicts (struct link_map *l,
00901                                ElfW(Rela) *conflict,
00902                                ElfW(Rela) *conflictend);
00903 
00904 /* Check the version dependencies of all objects available through
00905    MAP.  If VERBOSE print some more diagnostics.  */
00906 extern int _dl_check_all_versions (struct link_map *map, int verbose,
00907                                int trace_mode)
00908      internal_function;
00909 
00910 /* Check the version dependencies for MAP.  If VERBOSE print some more
00911    diagnostics.  */
00912 extern int _dl_check_map_versions (struct link_map *map, int verbose,
00913                                int trace_mode)
00914      internal_function;
00915 
00916 /* Initialize the object in SCOPE by calling the constructors with
00917    ARGC, ARGV, and ENV as the parameters.  */
00918 extern void _dl_init (struct link_map *main_map, int argc, char **argv,
00919                     char **env) internal_function attribute_hidden;
00920 
00921 /* Call the finalizer functions of all shared objects whose
00922    initializer functions have completed.  */
00923 extern void _dl_fini (void) internal_function;
00924 
00925 /* Sort array MAPS according to dependencies of the contained objects.  */
00926 extern void _dl_sort_fini (struct link_map *l, struct link_map **maps,
00927                         size_t nmaps, char *used, Lmid_t ns)
00928      internal_function;
00929 
00930 /* The dynamic linker calls this function before and having changing
00931    any shared object mappings.  The `r_state' member of `struct r_debug'
00932    says what change is taking place.  This function's address is
00933    the value of the `r_brk' member.  */
00934 extern void _dl_debug_state (void);
00935 rtld_hidden_proto (_dl_debug_state)
00936 
00937 /* Initialize `struct r_debug' if it has not already been done.  The
00938    argument is the run-time load address of the dynamic linker, to be put
00939    in the `r_ldbase' member.  Returns the address of the structure.  */
00940 extern struct r_debug *_dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
00941      internal_function;
00942 
00943 /* Initialize the basic data structure for the search paths.  */
00944 extern void _dl_init_paths (const char *library_path) internal_function;
00945 
00946 /* Gather the information needed to install the profiling tables and start
00947    the timers.  */
00948 extern void _dl_start_profile (void) internal_function attribute_hidden;
00949 
00950 /* The actual functions used to keep book on the calls.  */
00951 extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
00952 extern void _dl_mcount_internal (ElfW(Addr) frompc, ElfW(Addr) selfpc)
00953      attribute_hidden;
00954 
00955 /* This function is simply a wrapper around the _dl_mcount function
00956    which does not require a FROMPC parameter since this is the
00957    calling function.  */
00958 extern void _dl_mcount_wrapper (void *selfpc);
00959 
00960 /* Show the members of the auxiliary array passed up from the kernel.  */
00961 extern void _dl_show_auxv (void) internal_function;
00962 
00963 /* Return all environment variables starting with `LD_', one after the
00964    other.  */
00965 extern char *_dl_next_ld_env_entry (char ***position) internal_function;
00966 
00967 /* Return an array with the names of the important hardware capabilities.  */
00968 extern const struct r_strlenpair *_dl_important_hwcaps (const char *platform,
00969                                                  size_t paltform_len,
00970                                                  size_t *sz,
00971                                                  size_t *max_capstrlen)
00972      internal_function;
00973 
00974 /* Look up NAME in ld.so.cache and return the file name stored there,
00975    or null if none is found.  */
00976 extern const char *_dl_load_cache_lookup (const char *name)
00977      internal_function;
00978 
00979 /* If the system does not support MAP_COPY we cannot leave the file open
00980    all the time since this would create problems when the file is replaced.
00981    Therefore we provide this function to close the file and open it again
00982    once needed.  */
00983 extern void _dl_unload_cache (void) attribute_hidden;
00984 
00985 /* System-dependent function to read a file's whole contents in the
00986    most convenient manner available.  *SIZEP gets the size of the
00987    file.  On error MAP_FAILED is returned.  */
00988 extern void *_dl_sysdep_read_whole_file (const char *file, size_t *sizep,
00989                                     int prot)
00990      internal_function attribute_hidden;
00991 
00992 /* System-specific function to do initial startup for the dynamic linker.
00993    After this, file access calls and getenv must work.  This is responsible
00994    for setting __libc_enable_secure if we need to be secure (e.g. setuid),
00995    and for setting _dl_argc and _dl_argv, and then calling _dl_main.  */
00996 extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
00997                                 void (*dl_main) (const ElfW(Phdr) *phdr,
00998                                                ElfW(Word) phnum,
00999                                                ElfW(Addr) *user_entry))
01000      attribute_hidden;
01001 
01002 extern void _dl_sysdep_start_cleanup (void)
01003      internal_function attribute_hidden;
01004 
01005 
01006 /* Determine next available module ID.  */
01007 extern size_t _dl_next_tls_modid (void) internal_function attribute_hidden;
01008 
01009 /* Calculate offset of the TLS blocks in the static TLS block.  */
01010 extern void _dl_determine_tlsoffset (void) internal_function attribute_hidden;
01011 
01012 /* Set up the data structures for TLS, when they were not set up at startup.
01013    Returns nonzero on malloc failure.
01014    This is called from _dl_map_object_from_fd or by libpthread.  */
01015 extern int _dl_tls_setup (void) internal_function;
01016 rtld_hidden_proto (_dl_tls_setup)
01017 
01018 /* Allocate memory for static TLS block (unless MEM is nonzero) and dtv.  */
01019 extern void *_dl_allocate_tls (void *mem) internal_function;
01020 rtld_hidden_proto (_dl_allocate_tls)
01021 
01022 /* Get size and alignment requirements of the static TLS block.  */
01023 extern void _dl_get_tls_static_info (size_t *sizep, size_t *alignp)
01024      internal_function;
01025 
01026 extern void _dl_allocate_static_tls (struct link_map *map)
01027      internal_function attribute_hidden;
01028 
01029 /* These are internal entry points to the two halves of _dl_allocate_tls,
01030    only used within rtld.c itself at startup time.  */
01031 extern void *_dl_allocate_tls_storage (void)
01032      internal_function attribute_hidden;
01033 extern void *_dl_allocate_tls_init (void *) internal_function;
01034 rtld_hidden_proto (_dl_allocate_tls_init)
01035 
01036 /* Deallocate memory allocated with _dl_allocate_tls.  */
01037 extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function;
01038 rtld_hidden_proto (_dl_deallocate_tls)
01039 
01040 extern void _dl_nothread_init_static_tls (struct link_map *) attribute_hidden;
01041 
01042 /* Find origin of the executable.  */
01043 extern const char *_dl_get_origin (void) attribute_hidden;
01044 
01045 /* Count DSTs.  */
01046 extern size_t _dl_dst_count (const char *name, int is_path) attribute_hidden;
01047 
01048 /* Substitute DST values.  */
01049 extern char *_dl_dst_substitute (struct link_map *l, const char *name,
01050                              char *result, int is_path) attribute_hidden;
01051 
01052 /* Check validity of the caller.  */
01053 extern int _dl_check_caller (const void *caller, enum allowmask mask)
01054      attribute_hidden;
01055 
01056 /* Open the shared object NAME, relocate it, and run its initializer if it
01057    hasn't already been run.  MODE is as for `dlopen' (see <dlfcn.h>).  If
01058    the object is already opened, returns its existing map.  */
01059 extern void *_dl_open (const char *name, int mode, const void *caller,
01060                      Lmid_t nsid, int argc, char *argv[], char *env[])
01061      attribute_hidden;
01062 
01063 /* Free or queue for freeing scope OLD.  If other threads might be
01064    in the middle of _dl_fixup, _dl_profile_fixup or dl*sym using the
01065    old scope, OLD can't be freed until no thread is using it.  */
01066 extern int _dl_scope_free (void *) attribute_hidden;
01067 
01068 /* Add module to slot information data.  */
01069 extern void _dl_add_to_slotinfo (struct link_map  *l) attribute_hidden;
01070 
01071 /* Update slot information data for at least the generation of the
01072    module with the given index.  */
01073 extern struct link_map *_dl_update_slotinfo (unsigned long int req_modid);
01074 
01075 /* Look up the module's TLS block as for __tls_get_addr,
01076    but never touch anything.  Return null if it's not allocated yet.  */
01077 extern void *_dl_tls_get_addr_soft (struct link_map *l) attribute_hidden;
01078 
01079 extern int _dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr)
01080      internal_function attribute_hidden;
01081 
01082 __END_DECLS
01083 
01084 #endif /* ldsodefs.h */