mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 03:33:33 +08:00
support: Add xdlvsym function
This commit is contained in:
parent
5a659ccc0e
commit
17432d7150
@ -1,3 +1,8 @@
|
||||
2019-06-28 Florian Weimer <fweimer@redhat.com>
|
||||
|
||||
* support/xdlfcn.h (xdlvsym): Declare function.
|
||||
* support/xdlfcn.c (xdlvsym): Define funciton.
|
||||
|
||||
2019-06-28 Florian Weimer <fweimer@redhat.com>
|
||||
|
||||
[BZ #24744]
|
||||
|
@ -51,6 +51,26 @@ xdlsym (void *handle, const char *symbol)
|
||||
return sym;
|
||||
}
|
||||
|
||||
void *
|
||||
xdlvsym (void *handle, const char *symbol, const char *version)
|
||||
{
|
||||
/* Clear any pending errors. */
|
||||
dlerror ();
|
||||
|
||||
void *sym = dlvsym (handle, symbol, version);
|
||||
|
||||
if (sym == NULL)
|
||||
{
|
||||
const char *error = dlerror ();
|
||||
if (error != NULL)
|
||||
FAIL_EXIT1 ("error: dlvsym: %s\n", error);
|
||||
/* If there was no error, we found a NULL symbol. Return the
|
||||
NULL value in this case. */
|
||||
}
|
||||
|
||||
return sym;
|
||||
}
|
||||
|
||||
void
|
||||
xdlclose (void *handle)
|
||||
{
|
||||
|
@ -27,6 +27,7 @@ __BEGIN_DECLS
|
||||
void *xdlopen (const char *filename, int flags);
|
||||
void *xdlmopen (Lmid_t lmid, const char *filename, int flags);
|
||||
void *xdlsym (void *handle, const char *symbol);
|
||||
void *xdlvsym (void *handle, const char *symbol, const char *version);
|
||||
void xdlclose (void *handle);
|
||||
|
||||
__END_DECLS
|
||||
|
Loading…
Reference in New Issue
Block a user