<div dir="ltr"><div><div>Interestingly, when I compiled and ran dl01 and dl02 manually, using the source files that were generated during making rtems (like dl-tar.c/h etc.), BUT with application development Makefile (from examples-v2 hello_world_c), AND CFLAGS from the generated Makefile for dl01 test, I got the following output:<br><br><br>*** BEGIN OF TEST libdl (RTL) 1 ***<br>load: /dl-o1.o<br>handle: 0x20409c8 has unresolved externals<br><br></div>and the application hanged.<br></div>Now it seems that there some CFLAGS and/or LDFLAGS or something similar that I missing. Something that happens when testsuites are automatically built, but not when one manually makes them. Any ideas, comments?<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 27, 2016 at 1:00 PM, Saeed Ehteshamifar <span dir="ltr"><<a href="mailto:salpha.2004@gmail.com" target="_blank">salpha.2004@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello,<br><br></div>Thanks for the answers Pavel, Chris.<span class=""><br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">You need to link list of symbols to the base executable image<br>
to inform runtime linker which symbols are available.</blockquote></span><div>I followed your instructions carefully and after building my app, I get an "untar failed: 1" error. How should I debug this error? My application is attached to the email I would really appreciate if you can have a look. <br></div><div>I was thinking to put this app on examples-v2 to serve as a starting point for DL app dev. Though I don't know if the DL lib usage is stable now.<span class=""><br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The rtems_waf support (<a rel="noreferrer" href="https://git.rtems.org/chrisj/rtems_waf.git/" target="_blank">https://git.rtems.org/chrisj/rtems_waf.git/</a>) now provides a simple way to add files via an embedded tar file to an executable. You can:</blockquote></span><div>How can I start using WAF build system? I found <a href="https://devel.rtems.org/wiki/waf" target="_blank">https://devel.rtems.org/wiki/waf</a> on the wiki but it wasn't helping much.<span class=""><br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There are two ways you can manage symbols and it depends on your system
architecture and available services in your running target.</blockquote></span><div>I was wondering why I couldn't find "rtems_main" symbol in libtests/dl01.exe:<br>sparc-rtems4.12-nm $(find . -name dl01.exe) | grep "rtems_main"<br><br></div><div>Shouldn't the exe version contain all the symbols required for the dynamic linker?<br><br></div><div>Best Regards,<br></div><div>Saeed <br></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 27, 2016 at 11:28 AM, Pavel Pisa <span dir="ltr"><<a href="mailto:ppisa4lists@pikron.com" target="_blank">ppisa4lists@pikron.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Chris,<br>
<br>
thanks for clarification.<br>
<span><br>
On Wednesday 27 of July 2016 02:57:06 Chris Johns wrote:<br>
> Pavel, thanks for the excellent detail provided. I will try and expand<br>
> on a couple of parts being discussed.<br>
</span><span>> > You need to link list of symbols to the base executable image<br>
> > to inform runtime linker which symbols are available.<br>
><br>
> There are two ways you can manage symbols and it depends on your system<br>
> architecture and available services in your running target.<br>
<br>
</span>In the fact, I would like to have third supported/maintained way<br>
for the table inclusion in the base RTEMS application image.<br>
<br>
It would be great if it is possible to select "API profiles"<br>
which should be exported to the loadable code.<br>
These profiles should be (ideally) maintained directly<br>
in RTEMS mainline. My idea is that I decide that I need<br>
POSIX, RTEMS and dynamic loader API exported, so I put in Init<br>
of base application<br>
<br>
rtems_rtl_base_register_sym_table(&rtems_rtl_base_sym_table_posix);<br>
rtems_rtl_base_register_sym_table(&rtems_rtl_base_sym_table_rtems);<br>
rtems_rtl_base_register_sym_table(&rtems_rtl_base_sym_table_libdl);<br>
<br>
The main problem with this approach is to found intermediatte<br>
symbols required by these directives which are implemented by<br>
inlines or macros (that is, documented externally visible name<br>
does not correspond directly to the symbol).<br>
<br>
It would be ideal, if officially exported, documented API function<br>
are somehow marked (Doxygen?) that these official tables can<br>
be build automatically.<br>
<br>
>From the long term perspective for RAM memory constrained systems,<br>
it would be ideal, if symbol table can be recompiled to the format<br>
which can be stored directly into Flash/RO memory and does not need<br>
memory dynamic allocation as is used now<br>
<br>
obj->global_size = count * sizeof (rtems_rtl_obj_sym_t);<br>
obj->global_table = rtems_rtl_alloc_new (RTEMS_RTL_ALLOC_SYMBOL,<br>
<br>
But keeping the same format for that embedded symbol tables<br>
and dynamically loaded ones which require updates can be challenge.<br>
<br>
Best wishes,<br>
<br>
Pavel<br>
<div><div><br>
> You can embed the symbols in the base image. To do this you need two<br>
> link passes. The first link pass brings the executable together so you<br>
> can get a list of symbols. This is used to create a symbol table you add<br>
> to the second link pass. The way the symbol table is created and linked<br>
> allows it to adjust to a different memory map created by the second link<br>
> pass.<br>
><br>
> The second method is loading an external symbol table. This is a single<br>
> link process and again you create a symbols object file which is<br>
> external. Instead of a 2nd phase of linking you simply make the symbol's<br>
> object file available to the running target and you dynamically load it<br>
> before any other modules. In this case the symbol addresses are fixed to<br>
> the addresses in the executable.<br>
><br>
> An example of an embedded symbol table is a target that does not have a<br>
> flash file system or a network to load external symbols. It is also used<br>
> when you do not want to have to configuration control the kernel image<br>
> and the symbols. The two link passes added complexity to your build system.<br>
><br>
> An example of external symbols is a team development environment where a<br>
> boot loader such as iPXE or uboot loads a kernel from the network and<br>
> you load the symbols via the network as well. When you move to a<br>
> production build the symbols are loaded into a local file system.<br>
><br>
> Chris<br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
<br>
</div></div><span>--<br>
Yours sincerely<br>
Pavel Pisa<br>
<br>
</span>==================================================<br>
PiKRON s.r.o. Phone/Fax: <a href="tel:%2B420%20284684676" value="+420284684676" target="_blank">+420 284684676</a><br>
Kankovskeho 1235 Phone: <a href="tel:%2B420%20234697622" value="+420234697622" target="_blank">+420 234697622</a><br>
182 00 Praha 8 WWW: <a href="http://www.pikron.com/" rel="noreferrer" target="_blank">http://www.pikron.com/</a><br>
Czech Republic e-mail: <a href="mailto:pikron@pikron.com" target="_blank">pikron@pikron.com</a><br>
==================================================<br>
<div><div>_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>