dlopen failed: file not found
Saeed Ehteshamifar
salpha.2004 at gmail.com
Wed Jul 27 22:05:04 UTC 2016
Hello,
I followed the instructions Chris posted on using WAF to make a TAR object
file and linked it to my program. But when I run it, I get "file not found"
error. I'm using SPARC SIS.
Here is my waf script:
import rtems_waf.rtems as rtems
def init(ctx):
rtems.init(ctx)
def options(opt):
rtems.options(opt)
def configure(conf):
rtems.configure(conf)
def build(bld):
rtems.build(bld)
rtems.root_filesystem(bld, 'dl',
['init.c',
'hello.c'],
'dl.tar', 'dl-tar.o')
And here is how I untar the object in my Init task and load the dynamic
object, which should print "Hello":
...
extern int _binary_dl_tar_start;
extern int _binary_dl_tar_size;
rtems_task Init(
rtems_task_argument ignored
)
{
int (*hello)();
int te = Untar_FromMemory((void *)(&_binary_dl_tar_start),
(size_t)(_binary_dl_tar_size));
/* error checking. omitted here. */
void* handle = dlopen ("/hello.o", RTLD_NOW | RTLD_GLOBAL);
if (!handle)
{
printf("dlopen failed: %s\n", dlerror());
exit(1);
}
...
What am I doing wrong? Using *objdump* and *nm* I didn't find ANY
occurrence of *hello *in the final executable file.
Best Regards,
Saeed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160728/8c066f03/attachment.html>
More information about the users
mailing list