📄 solib_depend.h
字号:
/* *---------------------------------------------------------------------- * T-Kernel / Standard Extension * * Copyright (C) 2006 by Ken Sakamura. All rights reserved. * T-Kernel / Standard Extension is distributed * under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * * Version: 1.00.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* * solib.h * * Shared object (SO) support library */#ifndef __SYS_SOLIB_DEPEND_H__#define __SYS_SOLIB_DEPEND_H__#include <basic.h>#include <extension/dynload.h>#include <sys/queue.h>#include <sys/elf.h>#ifdef __cplusplusextern "C" {#endiftypedef struct dlinfo DLInfo;/* * Symbol scope list */typedef struct { W nent; /* Number of entries */ DLInfo **ent; /* Target for search (variable-length array) */} DLScope;/* * Object management information */struct dlinfo { QUEUE q; /* For management information connection */ W count; /* Reference count */ W dllcount; /* DLL loading count */ VP dllhandle; /* DLL handle */ SOBJ_HDR soHdr; /* Shared object file */ W ldid; /* Loading ID */ P_DYNLDINF ldinf; /* Loading information */ W ldofs; /* Loading offset */ DLInfo *loader; /* First loaded (DLL) main */ BOOL global:1; /* Global scope: True */ BOOL relocated:1; /* Already relocated: True */ BOOL nowloading:1; /* In process of loading: True */ BOOL initcalled:1; /* init has been called: True */ /* Loading object information */ Elf32_Dyn *dyn; /* Dynamic section */ VP *got; /* Global offset table DT_PLTGOT */ Elf32_Rel *reltab; /* Relocation table DT_REL */ UW relsz; /* Relocation table size DT_RELSZ */ Elf32_Rela *relatab; /* Relocation table DT_RELA */ UW relasz; /* Relocation table size DT_RELASZ */ Elf32_Rel *jreltab; /* Relocation table DT_JMPREL */ UW jrelsz; /* Relocation table size DT_PLTRELSZ */ UB *strtab; /* String table DT_STRTAB */ Elf32_Sym *symtab; /* Symbol table DT_SYMTAB */ struct hash { /* Hash table DT_HASH */ UW nbucket; UW *bucket; UW *chain; } hash; FP init; /* Initialization routine DT_INIT */ FP fini; /* Termination processing routine DT_FINI */ /* Symbol search list */ DLScope search; /* Dependent library */ /* Symbol scope list */ DLScope *scope[4]; /* Standard scope */ DLScope *lscope[2]; /* Local scope */};IMPORT DLInfo __dlInfo;#define DLInfoID(dlp) ( (UW)(dlp) >> 2 ) /* Access handle *//* * Conversion from link address to loaded address * VP LDADR( DLInfo *dlp, VP vp ) */#define LDADR(dlp, vp) ( (VP)((UW)(vp) + (UW)(dlp)->ldofs) )/* * Exclusive control for DLInfo access */IMPORT ER __so_lock( BOOL ignore_mintr );IMPORT void __so_unlock( void );/* * solib entry */IMPORT ER __so_loading( DLInfo **dlpp, SOBJ_HDR *soHdr, DLInfo *loader );IMPORT ER __so_depsloading( DLInfo *loader, UW global );IMPORT ER __so_relocate( DLInfo *loader, UW lazy );IMPORT void __so_callinit( DLInfo *loader );IMPORT void __so_callfini( DLInfo *loader );IMPORT UW __so_resolve( DLInfo *dlp, UB *name, UW reltype, Elf32_Sym **sym );IMPORT UW __so_localresolve( DLInfo *dlp, UB *name, DLInfo *skip, Elf32_Sym **sym );IMPORT void __freeDLInfo( DLInfo *dlp );#ifdef __cplusplus}#endif#endif /* __SYS_SOLIB_DEPEND_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -