methods of loading symbols
jaeho jo
hot486two at gmail.com
Wed Aug 2 07:03:53 UTC 2017
Thank you! You were a huge help.
but...I have another three question..
In my process, I had problem when I build base image and RAP
building base image, I used Untar_FromMemory( ) in init.c and this function
needed tar file(RAP -> tarfile -> c file) for compile.
building RAP, I used this command 'rtems-ld -v --base baseImage -e
Test_task task.o -o app.rap'. So, rtems-ld requires a base image.
To build base image, I needed RAP and I needed base image to execute the
'rtems-ld'.
1. Is it common situation ? if not, Did I make a mistake ?
To solve this problem, I make a temp file using 'dd' command-line utility.
a) At fiest, I roughly set the size of temp file
b) temp file -> tarfile -> c file
c) To build base image, Used this file
d) To build RAP, used base image
e) take the size of RAP
f) set the size of temp file to RAP size
g) rebuild base image...
I think this way is very bad way but dynamic load is success...
2. Is it possible to change address map in base image when I build base
image using temp file ?
3. Without tempfile , How to solve that dependency proboem between building
base image and RAP ?
thank you.
2017-08-02 11:34 GMT+09:00 Chris Johns <chrisj at rtems.org>:
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20170802/67d0c026/attachment-0002.html>
More information about the users
mailing list