mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added dlclose(), dlerror(), dlopen() and dlsym() functions, which are
available only under OS4. There is a variant of dlopen() in libunix.a which will perform a path name conversion. Note that these functions will not work in the thread-safe variant of the library because it would be unwise to tinker with the currently running program's binary. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15207 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib_dlopen.c,v 1.1 2010-08-21 10:59:34 obarthel Exp $
|
||||
* $Id: stdlib_dlopen.c,v 1.2 2010-08-21 11:37:03 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -52,7 +52,7 @@
|
||||
/****************************************************************************/
|
||||
|
||||
extern struct ElfIFace * __IElf;
|
||||
extern Elf32_Handle __elf_handle;
|
||||
extern Elf32_Handle __dl_elf_handle;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@ -88,21 +88,22 @@ void * dlopen(const char * path_name,int mode)
|
||||
}
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
|
||||
if(__elf_handle != NULL)
|
||||
if(__dl_elf_handle != NULL)
|
||||
{
|
||||
struct ElfIFace * IElf = __IElf;
|
||||
uint32 flags;
|
||||
uint32 flags = 0;
|
||||
|
||||
if(mode & RTLD_LOCAL)
|
||||
flags = ELF32_RTLD_LOCAL;
|
||||
else if (mode & RTLD_GLOBAL)
|
||||
flags = ELF32_RTLD_GLOBAL;
|
||||
else
|
||||
flags = 0;
|
||||
|
||||
result = DLOpen(__elf_handle,path_name,flags);
|
||||
if(mode & RTLD_GLOBAL)
|
||||
flags = ELF32_RTLD_GLOBAL;
|
||||
|
||||
result = DLOpen(__dl_elf_handle,path_name,flags);
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user