Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
rld_interface.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 /* $Header: /m_home/m_utkej/Argonne/cvs2svn/cvs/Open64/osprey1.0/include/rld_interface.h,v 1.1.1.1 2002-05-22 20:09:05 dsystem Exp $ */
00037 
00038 /*
00039  Everything in this header is intended solely for use by
00040  the implementation (by libc.so and libpthread.so, for example).
00041 
00042  Nothing here is intended for direct use by applications.
00043  Direct call of any of the interfaces by any
00044  user application or use library is unsupported, and interfaces
00045  may change without notice.
00046 
00047 */
00048 
00049 #ifndef __RLD_INTERFACE_H__
00050 #define __RLD_INTERFACE_H__
00051 
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055 
00056 
00057 /* _RLD_OP_MODIFY_LIST's op codes */
00058 #define _RLD_OP_NONE            0       /* nop */
00059 
00060 #define _RLD_OP_INSERT          1       /* insert new object 'name' */
00061                                         /* before element */
00062                                         /* DO NOT USE. will be deleted. */
00063                                         /* Currently unused */
00064 
00065 #define _RLD_OP_ADD             2       /* add new object 'name' after */
00066                                         /* element */
00067 
00068 #define _RLD_OP_DELETE          3       /* delete element */
00069 
00070 #define _RLD_OP_REPLACE         4       /* replace element with new */
00071                                         /* object 'name' */
00072                                         /* DO NOT USE. will be deleted. */
00073                                         /* Currently unused */
00074 
00075 /* _rld_new_interface's op codes */
00076 #define _SHUT_DOWN              0       /* execute all .fini sections */
00077 #define _RLD_FIRST_PATHNAME     1       /* get to the first obj on the list */
00078 #define _RLD_NEXT_PATHNAME      2       /* get to the next obj on the list */
00079 #define _RLD_MODIFY_LIST        3       /* modify the current obj list */
00080 
00081 #define _RLD_ADDR_TO_NAME       4       /* get global symbol name */
00082                                         /* from addr of symbol. Must
00083                                            be exact symbol address, else
00084                                            name not returned.
00085                                            _RLD_DLADDR, below, is
00086                                            a more usable service.
00087                                         */
00088 
00089 #define _RLD_NAME_TO_ADDR       5       /* get address of global symbol */
00090                                         /* from its name. 
00091                                         */
00092 
00093 #define _RLD_LIBDL_INTERFACE    6       /* libdl simulation      */
00094 #define _RLD_VERSION_EXPECTED   7       /* get version string    */
00095                                         /* corresponding to name */
00096 #define _RLD_SPROC_NOTIFY       8       /* tell rld that it needs to use */
00097                                         /* multi-threaded locking        */
00098 #define _RLD_DSO_VERSION        9       /* get the version of a certain dso */
00099 #define _RLD_SHUTDOWN_THREAD    10      /* when any thread calls "exit", */
00100                                         /* cleanup sync for that thread. */
00101 #define _RLD_SPROC_FINI         11      /* when we are no longer         */
00102                                         /* multithreaded, such as after  */
00103                                         /* "fork", don't do MP locks.    */
00104 #define _RLD_PTHREADS_START     12      /* pthreads initialization       */
00105                                         /* beginning.                    */
00106 
00107 #define _RLD_NOP                13      /* Does nothing.                 */
00108                                         /* Useful for preloading the GOT */
00109                                         /* so that the follow-on         */
00110                                         /* call to _rld_new_interface    */
00111                                         /* does not require              */
00112                                         /* lazy-evalation.               */
00113 
00114 #define _RLD_DLADDR             14      /* for dladdr(), returning */
00115                                         /* dso name etc thru pointer arg
00116                                            (3rd arg pointer to Dl_info).
00117                                         */
00118 
00119 /* __rld_libdl_interface op codes */
00120 #define _LIBDL_RLD_DLOPEN       0
00121 #define _LIBDL_RLD_DLSYM        1
00122 #define _LIBDL_RLD_DLCLOSE      2
00123 #define _LIBDL_RLD_DLERROR      3
00124 #define _LIBDL_SGI_RLD_DLADD    4
00125 #define _LIBDL_RLD_DLOPEN_VERSION 5
00126 
00127         /* The next two used internally by rld: must not be used
00128         ** by any system code or any user code.
00129         */
00130 #define _LIBDL_SGI_LIBLIST_DL_ADD  6
00131         /* _LIBDL_SGI_LIBLIST_DL_ADD means that rld is doing a 
00132            delay-load of a DSO thru _ rld_new_interface 
00133            and the DSO doing the call was
00134            sgi_dladded (by a user-level sgidladd)
00135         */ 
00136 #define _LIBDL_SGI_LIBLIST_DL_OPEN 7
00137         /* _LIBDL_SGI_LIBLIST_DL_OPEN means that rld is doing a 
00138            delay-load of a DSO thru _ rld_new_interface
00139            and the DSO doing the call was
00140            dlopened (by a user-level dlopen)
00141         */ 
00142 
00143         /* The highest LIBDL interface number in use */
00144 #define _LIBDL_RLD_MAX_CODE     7
00145 
00146 #if (defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS))
00147 
00148 #include <elf.h>
00149 
00150 #if (_MIPS_SZPTR == 64)
00151 
00152 /* The following six are an older rld interface and
00153    cannot be used unless the _RLD_ARGS -old_interface
00154    argument is given to rld.debug  
00155    DO NOT USE. Will be removed.
00156    
00157 */
00158 extern char      *_rld_first_pathname(void);
00159 extern char      *_rld_next_pathname(void);
00160 extern char      *_rld_modify_list(Elf64_Word   operation,
00161                       char *original_pathname,
00162                       char *name);
00163 extern char      *_rld_address_to_name(Elf64_Addr address);
00164 extern Elf64_Addr _rld_name_to_address(char *name);
00165 extern int        _rld_interface(Elf64_Word operation);
00166 
00167 /* The following is the current rld interface.
00168    It is intended for use by the implementation, not
00169    by applications.
00170 */
00171 extern void      *_rld_new_interface(Elf64_Word operation, ...);
00172 
00173 /* The following is not obsolete, but applications
00174    should not be using it. It is intended for use
00175    by the rld implementation.
00176 */
00177 extern void      *__rld_libdl_interface(int what, unsigned long arg1,
00178                     unsigned long arg2, unsigned long arg3, 
00179                     unsigned long arg4);
00180 
00181 #else /* 32 bit world */
00182 /* The following six are an older rld interface and
00183    cannot be used unless the _RLD_ARGS -old_interface
00184    argument is given to rld.debug
00185    DO NOT USE. Will be removed.
00186 */
00187 extern char      *_rld_first_pathname(void);
00188 extern char      *_rld_next_pathname(void);
00189 extern char      *_rld_modify_list(Elf32_Word   operation,
00190                       char *original_pathname,
00191                       char *name);
00192 extern char      *_rld_address_to_name(Elf32_Addr address);
00193 extern Elf32_Addr _rld_name_to_address(char *name);
00194 extern int        _rld_interface(Elf32_Word operation);
00195 
00196 /* The following is the current rld interface.
00197    It is intended for use by the implementation, not
00198    by applications.
00199 */
00200 extern void      *_rld_new_interface(Elf32_Word operation, ...);
00201 
00202 /* The following is not obsolete, but applications
00203    should not be using it. It is intended for use
00204    by the rld implementation.
00205 */
00206 extern void      *__rld_libdl_interface(int what, unsigned long arg1, 
00207                     unsigned long arg2, unsigned long arg3, 
00208                     unsigned long arg4);
00209 
00210 #endif /* _MIPS_SZPTR */
00211 
00212 #ifndef _RLD_INTERFACE_DLFCN_H_DLADDR
00213 #define _RLD_INTERFACE_DLFCN_H_DLADDR
00214 struct Dl_info {
00215         const char * dli_fname;
00216         void       * dli_fbase;
00217         const char * dli_sname;
00218         void       * dli_saddr;
00219         int          dli_version;
00220         int          dli_reserved1;
00221         long         dli_reserved[4];
00222 };
00223 #endif
00224 
00225 #endif /* _LANGUAGE_C */
00226 
00227 #ifdef __cplusplus
00228 }
00229 #endif
00230 
00231 #endif  /* __RLD_INTERFACE_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines