Dynamic load real-time tasks
chrisj at rtems.org
Wed Jun 28 07:22:37 UTC 2017
On 28/06/2017 17:09, Павел Жданов wrote:
> Hello, Chris. Thanks a lot for the answers.
> Have you loaded a symbol table for the base image that contains the 'printf'
> I created it but symbols are all undefined. Is it OK?
Did you load the symbol table on to the target somehow?
> The executable that is
> used to create symbol table was not linked against the file to be loaded.
Correct the linking happens on the target. The symbols loaded onto the target
need to match the kernel running and loading the module.
> Do I
> have to load symbol table at runtime using dl_open or link the file to be loaded
> against the symbol table (dl-sym)? Do I have to use 2-pass linking in my case?
This is something for you to decide.
If your target has networking and you have an NFS mount you can load the object
file via NFS or if you have storage and some way to copy files into the storage
you can have 'rtems-sym' command create an object file from the kernel's ELF
file and you can load that using the dlopen. This will populate the symbol table.
If you do not have a way to access an object file or do not want this you can
use the 2-pass linking method and embed the symbol table into the base image.
There is a target command that can load object files via the 'dlopen' call. I
think the tests has some detail about doing this.
Also check the bug reports for the version you are running. There was issues
with the symbol loading via loading an object that have been fixed (I think). If
it is not working and there is no bug open please raise one.
More information about the users