Dynamic linking in RTEMS

Saeed Ehteshamifar salpha.2004 at gmail.com
Tue Jul 26 23:01:29 UTC 2016


Hello,

Thanks Pavel for your answer. I tried to write an app myself that uses
dynamic loading and I ended up with the following questions:

1. How to generate *tar* array? Since on top of dl-tar.c it's been noted
that it's automatically generated. If I'm not wrong, by making a tar image,
RTEMS puts all binary objects within a single tar file and calls them
dynamically at run-time, right?

2. What's the difference between dl01.exe and dl01.pre? Both are executable
but running dl01.pre leads to "unresolved externals" and the execution
hangs.

Thank you in advance.

Best Regards,
Saeed

On Tue, Jul 19, 2016 at 5:12 PM, Pavel Pisa <pisa at cmp.felk.cvut.cz> wrote:

> Hello Saeed,
>
> libdl had been merged to RTEMS mainline.
>
> https://git.rtems.org/rtems/tree/cpukit/libdl
>
> There is even example how to use it in mainline
> and shell functions for test from commandline
>
> int shell_dlopen (int argc, char* argv[]);
> int shell_dlclose (int argc, char* argv[]);
> int shell_dlsym (int argc, char* argv[]);
> int shell_dlcall (int argc, char* argv[]);
>
> The test cases are included in mainline as well
>
> https://git.rtems.org/rtems/tree/testsuites/libtests/dl01
>
> https://git.rtems.org/rtems/tree/testsuites/libtests/dl02
>
> There is some my example for dlopen shell command as well.
>
>
> https://rtime.felk.cvut.cz/gitweb/rtems-devel.git/blob/HEAD:/rtems-omk-template/appdl/init.c
>
> I have posted recently cache operations patches series
> which is pending comments. This includes some corrections
> required to synchronize caches after code load and relocate.
> These patches are required to use libdl on CPUs
> where instruction cache is not snooped/synchronized
> automatically (most RISCs, ARM, PowerPC etc.).
>
> Best wishes
>                 Pavel
> --
>
>                 Pavel Pisa
>     e-mail:     pisa at cmp.felk.cvut.cz
>     www:        http://cmp.felk.cvut.cz/~pisa
>     university: http://dce.fel.cvut.cz/
>     company:    http://www.pikron.com/
>
> On Tuesday 19 of July 2016 11:57:47 Saeed Ehteshamifar wrote:
> > Hi,
> >
> > For the slingshot (RTEMS fault-injection tool) I need to dynamically link
> > test cases into the test suite(s) and execute them on-the-fly.
> > With a google search on "rtems libdl", I found two pointers for libdl:
> >
> > 1. https://git.rtems.org/chrisj/rtl.git/
> > https://git.rtems.org/chrisj/rtl-host.git/
> >
> > 2. https://git.rtems.org/rtems/tree/cpukit/libdl
> >
> > Now my question is: Has libdl already been merged in the tree, as the
> > second pointer suggests? And if yes, are there examples available maybe
> in
> > the testsuite folder on how to use that?
> >
> > Best Regards,
> > Saeed
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20160727/89e58d01/attachment-0002.html>


More information about the devel mailing list