📄 libdl.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. * *---------------------------------------------------------------------- *//* * @(#)libdl.h (libdl) * * DLL support library */#include <basic.h>#include <extension/proctask.h>#include <extension/tkcall.h>#include <sys/pinfo.h>#include <sys/solib.h>#include <sys/libs.h>#include <sys/syslog.h>#include <sys/knldbg.h>#include <extension/errno.h>#include <sys/debug.h>#define WEAK __attribute__ ((weak))/* * Log output */#define LOG KnlLogMsg/* * Lock * Use the library shared lock */#define LockDL() _lib_lock(_LL_DLL, FALSE)#define UnlockDL() _lib_unlock(_LL_DLL)/* * Local use memory allocation function * Define it to prevent the use of malloc() etc by mistake. * */#define malloc __so_malloc#define calloc __so_calloc#define realloc __so_realloc#define free __so_free/* * solib entry * solib entity is linked to the main program. * It is linked to the entity at runtime by linking libdl as a shared library. */IMPORT DLInfo __dlInfo WEAK;IMPORT void* __so_malloc( size_t size ) WEAK;IMPORT void __so_free( void *ptr ) WEAK;IMPORT ER __so_loading( DLInfo **dlpp, SOBJ_HDR *sohdr, DLInfo *loader ) WEAK;IMPORT ER __so_depsloading( DLInfo *loader, UW global ) WEAK;IMPORT ER __so_relocate( DLInfo *loader, UW lazy ) WEAK;IMPORT void __so_callinit( DLInfo *loader ) WEAK;IMPORT void __so_callfini( DLInfo *loader ) WEAK;IMPORT UW __so_resolve( DLInfo *dlp, UB *name, UW reltype, Elf32_Sym **sym ) WEAK;IMPORT UW __so_localresolve( DLInfo *dlp, UB *name, DLInfo *skip, Elf32_Sym **sym ) WEAK;IMPORT void __freeDLInfo( DLInfo *dlp ) WEAK;/* ------------------------------------------------------------------------ *//* * Global variable/function * */#define IMPORT_DEFINE 1#if IMPORT_DEFINE/* addrinfo.c */IMPORT WER tkse_dladdr( VP addr, T_DLINFO *info );/* search.c */IMPORT ER tkse_dlsearch( TC *path, LINK *lnk, W mode );/* load.c */IMPORT DLInfo* __getdlinfo( W handle );IMPORT WER tkse_dlopen( T_DLOPEN *info );IMPORT ER tkse_dlclose( W handle );/* symbol.c */IMPORT DLInfo* __addrdlinfo( VP addr );IMPORT ER tkse_dlsym( W handle, const char *symbol, UW *val );IMPORT void *dlopen(const char *filename, int flag);IMPORT int dlclose( void *handle );IMPORT void *dlsym(void *handle, const char *symbol);IMPORT int dladdr( void *addr, Dl_info *info );#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -