[GSoC] Final report for RTEMS Runtime Loader

Peng Fan van.freenix at gmail.com
Mon Sep 23 02:15:33 UTC 2013


Hi, All:

This is the Final report of RTEMS Runtime Loader.

The objective of this project is to provide dynamic object file support for
more architectures based on the current RTL framework.And extending RTL
linker to collect object files from archives into a new archive and
implement a new tool to convert elf archives to rap archives.There are also
two additional tasks, one is providing GDB support for dynamically loaded
object files on target, the other is providing Python support for RTL.

The code repositories are at
https://github.com/MrVan/gsoc2013-rtl.git
https://github.com/MrVan/gsoc2013-rtl-host.git
https://github.com/MrVan/gdb.git
The python rtems repository will be created in the near future.

*Finished tasks:*
1. Implemented different archs support for RTL,such as
ARM/PPC/MIPS/BFIN/H8300/LM32/MOXIE/V850/M32R and added more reloc and
testcases for SPARC/I386/M68k

2. Added new options for rtems-ld to make it support collect object files
from elf archive into a new elf archive.The added options are --rap-strip,
--runtime-lib, --one-file. --rap-strip means not to include file details in
the final rap file. The default value for --rap-strip is true, the option
is for GDB.--runtime-lib means the collected object files from elf archive
should be placed into the file following the option --runtime-lib.
--one-file means all the collected object files will be merged into the
final rap file.

3. Implemented a new tool named `rtems-ra`, which is used to automatically
manage rap archive file. For example:`rtems-ra --lib 3 --lib-path testcase
--output-path ./ --no-stdlibs --cc /opt/rtems4.11/bin/arm-rtems4.11-gcc`
-Wl,-Bstatic`. This command will use lib3.a in testcase directory, and
convert it to lib3.ra in the current directory. The tool also provides
common functions in `ar`, such as replace, add, delete object file in
archive file.

*Additional tasks:*
1. GDB task:A basic implementation has been finished. But it needs more
work to make it perfect.The key part of this task is to implement the
protocal between GDB and RTL. And you should also have the knowlege of how
GDB works.The target implementation is mainly in rtl-debugger.c. The GDB
side is mainly in solib-rtems.c.

2. Python task: Now Python and RTL are merged together, and it can execute
simple python script, but this is not the final objective. It is still
under heavy hacking.

*Remaining work:*
1. Large RAP file: To large rap file, there maybe overflow for near jump.
How to convert near jump/call to far jump/call? As far as I know, linux ko
is compiled using`-mlong-calls`,but to rtems, it is different. If a `.c`
file reference a symbol in libm.a/libc.a which are not compiled with
long-call support, the rap file will not be loaded because it does not
support converting near jump to far jump when encounting instruction
`overflow`.

*Future work:*
1. GDB part: RT_ADD,RT_DELETE,RT_CONSISTENT of r_state in r_debug are
omitted in the current implementation. I am not definitely sure whether
this is ok, but it works. This needs further reviewing.

2. Python part: To convert Python executable into rap file or merge the
python parser into RTL. This part is still in developing.

Welcome comments.

Thanks,
Peng.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130923/a09b03ee/attachment.html>


More information about the devel mailing list