<div dir="ltr"><div>sorry, my reply mistake</div><div><br></div><div><br></div><div><div>Thank you! You were a huge help.</div><div>but...I have another three question..</div><div><br>In my process, I had problem when I build base image and RAP</div><div><br></div><div>building base image, I used Untar_FromMemory( ) in init.c and this function needed tar file(RAP -> tarfile -> c file) for compile.</div><div><br></div><div>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.</div><div><br></div><div>To build base image, I needed RAP and I needed base image to execute the 'rtems-ld'.</div><div><br>1. Is it common situation ? if not, Did I make a mistake ?</div><div><br></div><div>To solve this problem, I make a temp file using 'dd' command-line utility.</div><div> a) At fiest, I roughly set the size of temp file<br> b) temp file -> tarfile -> c file<br> c) To build base image, Used this file <br> d) To build RAP, used base image<br> e) take the size of RAP <br> <br> f) set the size of temp file to RAP size <br> g) rebuild base image...</div><div>I think this way is very bad way but dynamic load is success...</div><div><br>2. Is it possible to change address map in base image when I build base image using temp file ?</div><div>3. Without tempfile , How to solve that dependency proboem between building base image and RAP ?</div><div><br>thank you.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-02 11:34 GMT+09:00 Chris Johns <span dir="ltr"><<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="im HOEnZb">On 27/07/2017 16:14, jaeho jo wrote:<br>
><br>
</span><div class="HOEnZb"><div class="h5">> Hi, I have a question about methods of loading the symbols When I want to load<br>
> RAP dynamically<br>
><br>
> My environment)<br>
> : target pc = pc386 ( on QEMU )<br>
> : I didn't use flash file system of a network to load external file. Only used<br>
> IMFS (basic)<br>
> : I used Untar_FromMemory( ) function to copy tar file(RAP) to the IMFS<br>
><br>
> My build step)<br>
> 1. build base_kernel_image<br>
><br>
> 2. make RAP using object file(will be loaded dynamically) and base_kernel_image<br>
> // use 'rtems-ld' command<br>
><br>
> 3. create tar file ( RAP -> tar )<br>
><br>
> 4. convert 'tar file' to 'c file' // use 'rtems-bin2c' command<br>
><br>
> 5. tar.c -> tar.o<br>
><br>
> 6. build preImage<br>
><br>
> 7. generate symbol table // use 'rtems-syms -e -c "cflags" -o symbol_table preImage'<br>
><br>
> 8. build finalImage including symbol table<br>
><br>
> 9. dynamic load test success<br>
><br>
><br>
> I know there are two way managing symbol<br>
> 1) the symbols table is embedded in the base image // no use flash file system<br>
> or network to load external symbols<br>
> 2) create an object file containing the symbols and it can be loaded at run time<br>
> and I think my method is 'embed the symbols in the base image'.<br>
><br>
><br>
> Queition)<br>
> Is it possible to use the second method - 'create an object file containing the<br>
> symbols and it can be loaded at run time', without using the file system or the<br>
> network(my current state)?<br>
<br>
</div></div><span class="im HOEnZb">I do not think so. You are embedding the file system in the base image which<br>
changes the address map of the base image. The first approach works because<br>
linking the symbol table to the base image resolves the symbols to the address<br>
the 2nd stage linking or any further linking passes assigns them. With the<br>
second approach of a separate object file the symbols are assigned the address<br>
of the base image when you create the .o file and if you then relink the base<br>
image with something different that address map will change.<br>
<br>
</span><span class="im HOEnZb">> If so, what should I do?<br>
<br>
</span><span class="im HOEnZb">You need to evaluate the benefit dynamic loading gives you and I cannot answer<br>
that without further system level information.<br>
<br>
You need to follow the 'embedded' approach to create the symbol table and then<br>
create the RAP file and then final image with the updated tar file.<br>
<br>
><br>
</span><span class="im HOEnZb">> Thank you for reading the long question<br>
><br>
<br>
</span><div class="HOEnZb"><div class="h5">Sorry about the delay in answering.<br>
<br>
Chris<br>
</div></div></blockquote></div><br></div>