libports: libc: extract file name from path in dlopen

'dlopen' causes the ldso to open ROM connections, right now we only
support single file names for these ROM not paths. Therefore, we extract
the file name from path within libc's 'dlopen'

fixes #3551
This commit is contained in:
Sebastian Sumpf 2019-11-07 16:01:01 +01:00 committed by Christian Helmuth
parent a54c04d247
commit f7509a5b78

View File

@ -76,8 +76,11 @@ void *dlopen(const char *name, int mode)
try {
static Libc::Allocator global_alloc;
return new (global_alloc)
Shared_object(*genode_env, global_alloc, name, bind, keep);
Shared_object(*genode_env, global_alloc,
name ? Genode::Path<128>(name).last_element() : nullptr, /* extract file name */
bind, keep);
} catch (...) {
snprintf(err_str, MAX_ERR, "Unable to open file %s\n", name);
}