mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-09 20:12:57 +00:00
parent
419dc40c4d
commit
bfd9c48039
@ -87,13 +87,20 @@ void *dlopen(const char *name, int mode)
|
|||||||
|
|
||||||
void *dlsym(void *handle, const char *name)
|
void *dlsym(void *handle, const char *name)
|
||||||
{
|
{
|
||||||
if (handle == nullptr || handle == RTLD_NEXT || handle == RTLD_DEFAULT ||
|
if (handle == nullptr || handle == RTLD_NEXT || handle == RTLD_SELF) {
|
||||||
handle == RTLD_SELF) {
|
|
||||||
snprintf(err_str, MAX_ERR, "Unsupported handle %p\n", handle);
|
snprintf(err_str, MAX_ERR, "Unsupported handle %p\n", handle);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (handle == RTLD_DEFAULT) {
|
||||||
|
static Libc::Allocator global_alloc;
|
||||||
|
|
||||||
|
return Shared_object(*genode_env, global_alloc, nullptr,
|
||||||
|
Shared_object::BIND_LAZY,
|
||||||
|
Shared_object::KEEP).lookup(name);
|
||||||
|
}
|
||||||
|
|
||||||
return to_object(handle)->lookup(name);
|
return to_object(handle)->lookup(name);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
snprintf(err_str, MAX_ERR, "Symbol '%s' not found\n", name);
|
snprintf(err_str, MAX_ERR, "Symbol '%s' not found\n", name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user