<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">Thanks for answer. Sorry for my english.</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">>What happens when the size of the code changes ?<br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">I'm developing my application with memory "segmentation". I mean:</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;
 ">0x40000000</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">--------------</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">main task</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">--------------</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">0x40001000 (for example)</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">-------------</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">second task</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">-------------</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;
 "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><div>0x40002000</div><div>-------------</div><div>third task</div><div>-------------</div></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">0x4000f000</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">------------</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">functions like printf() and other common functions and data</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">------------</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;
 "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">0x40001000-0x40000000 > sizeof(main task)</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">0x40002000-0x40001000 > sizeof(second task)</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">......</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div><font class="Apple-style-span" size="3">I mean what i must manually locate all of this tasks in memory, and allocate memory "segment" for every task. It will be doing by main task that could load task code from EEPROM. I'm trying to create mechanism to </font>dynamically<font class="Apple-style-span" size="3"> loading and unloading tasks like it did in usual OSes with processes. This mechanism need not be universally. It only for this project
 now. </font></div><div><br></div><div><span class="Apple-style-span" style="font-size: 16px; ">>I suggest you take a look at:<br>><br>></span><span class="Apple-style-span" style="font-size: 16px; "><a href="http://www.rtems.org/ftp/pub/rtems/people/chrisj/rtl/" target="_blank">http://www.rtems.org/ftp/pub/rtems/people/chrisj/rtl/</a></span></div><div><br></div><div>Thanks. Now i'm downloading archive from this directory, and will see what is it.</div><div><br></div><div><br></div><div><span class="Apple-style-span" style="font-size: 16px; ">>In the traditional definition dynamic and static libraries are not the same type of code. They can varying depending on the specific method used by the operating system. As Joel stated RTEMS is a single address space or processes and will not support the Unix </span></div><div><span class="Apple-style-span" style="font-size: 16px; ">>(ELF) shared library model. It adds overhead for no gain.
 Given this I am not sure I understand your sentence. For example have you built shared RTEMS libraries (the tools will let you do this) and static libraries and are you attempting to mix the results ?</span></div><div><span class="Apple-style-span" style="font-size: 16px; "><br></span></div><div>I will try.<br><blockquote style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Chris Johns <chrisj@rtems.org><br><b><span style="font-weight: bold;">To:</span></b> Oleg Moroz <oleg_moroz@yahoo.com><br><b><span style="font-weight:
 bold;">Cc:</span></b> Rtems <rtems-users@rtems.org><br><b><span style="font-weight: bold;">Sent:</span></b> Monday, September 26, 2011 2:48 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: Отв.: Shared library link<br></font><br>On 24/09/11 4:01 PM, Oleg Moroz wrote:<br>> Okay. The reason why i want extract functions from shared or static<br>> library is dynamical achange parts of code.<br><br>In the traditional definition dynamic and static libraries are not the same type of code. They can varying depending on the specific method used by the operating system. As Joel stated RTEMS is a single address space or processes and will not support the Unix (ELF) shared library model. It adds overhead for no gain. Given this I am not sure I understand your sentence. For example have you built shared RTEMS libraries (the tools will let you do this) and static libraries and are you attempting to mix the results ?<br><br>> Now i
 have small app than<br>> can parse elf file and extract machine code of ever Task (or another<br>> functions).<br><br>I suggest you take a look at:<br><br> <a href="http://www.rtems.org/ftp/pub/rtems/people/chrisj/rtl/" target="_blank">http://www.rtems.org/ftp/pub/rtems/people/chrisj/rtl/</a><br><br>I have a host based linker in development. I thought I had a copy on the server but I do not. I will upload a version soon.<br><br>The path I have taken to create a runtime link editor in RTEMS that can load ELF relocatable object files directly or from archive files and resolve any external symbols as well as export any suitable symbols. This is all via the dlopen call. I have an RTEMS linker in development which handles the dependence resolution providing a suitable meta-data format. This project is still in development.<br><br>Note, this RTEMS project uses waf so check the README.<br><br>> Problem is what the addresses of all functions in
 the<br>> recompiled project (with some bug fixes or functionality added) are not<br>> the same with original project.<br><br>The object files are relocatable. You need a link editor to locate the object files and fix up the addresses.<br><br>> I must fix it manually, but this is the<br>> easiest way to make an error. I think than i can create the library with<br>> all functions. and addresses of that funcs are constant.<br><br>What happens when the size of the code changes ?<br><br>> after this i<br>> could link it with my extracted updated task. extract task again,<br>> and overwrite it on working RTEMS. Maybe linker or compiler has some<br>> command switch? Something like - Ttext=0x40100000<br><br>Sorry, but I do not understand this.<br><br>Chris<br><br><br></div></div></blockquote></div></div></body></html>