methods of loading symbols

Chris Johns chrisj at rtems.org
Wed Aug 2 02:34:09 UTC 2017


On 27/07/2017 16:14, jaeho jo wrote:
> 
> Hi, I have a question about methods of loading the symbols When I want to load
> RAP dynamically
> 
> My environment)
> : target pc = pc386 ( on QEMU )
> : I didn't use flash file system of a network to load external file. Only used
> IMFS (basic)
> : I used Untar_FromMemory( ) function to copy tar file(RAP) to the IMFS
> 
> My build step)
> 1. build base_kernel_image
> 
> 2. make RAP using object file(will be loaded dynamically) and base_kernel_image
> // use 'rtems-ld' command
> 
> 3. create tar file ( RAP -> tar )
> 
> 4. convert 'tar file' to 'c file' // use 'rtems-bin2c' command
> 
> 5. tar.c -> tar.o
> 
> 6. build preImage
> 
> 7. generate symbol table // use 'rtems-syms -e -c "cflags" -o symbol_table preImage'
> 
> 8. build finalImage including symbol table
> 
> 9. dynamic load test success
> 
> 
> I know there are two way managing symbol
>   1) the symbols table is embedded in the base image // no use flash file system
> or network to load external symbols
>   2) create an object file containing the symbols and it can be loaded at run time
> and I think my method is 'embed the symbols in the base image'.
> 
> 
> Queition)
> Is it possible to use the second method - 'create an object file containing the
> symbols and it can be loaded at run time', without using the file system or the
> network(my current state)?

I do not think so. You are embedding the file system in the base image which
changes the address map of the base image. The first approach works because
linking the symbol table to the base image resolves the symbols to the address
the 2nd stage linking or any further linking passes assigns them. With the
second approach of a separate object file the symbols are assigned the address
of the base image when you create the .o file and if you then relink the base
image with something different that address map will change.

> If so, what should I do?

You need to evaluate the benefit dynamic loading gives you and I cannot answer
that without further system level information.

You need to follow the 'embedded' approach to create the symbol table and then
create the RAP file and then final image with the updated tar file.

> 
> Thank you for reading the long question
> 

Sorry about the delay in answering.

Chris


More information about the users mailing list