[GSOC2013] Dynamic object file loading

Peng Fan van.freenix at gmail.com
Thu Apr 18 09:09:59 UTC 2013


Hi,

2013/4/17 Chris Johns <chrisj at rtems.org>

> Peng Fan wrote:
>
>> Hi Chris,
>>
>> I have encounter a few problems in running "rtld".
>> When I use sparc-rtems4.11-run to run rtld, it showes "shell: open input
>> /shell-init failed: No such file or directory". I look insight into the
>> code, and find that
>> there is a fs-root.tar is compiled into "rtld". I do not know how to
>> resove this.
>>
>> when using higher version gcc/g++(4.7.1), rtems-host compilation
>> failed,but lower
>> verison gcc/g++(4.3) is ok.
>>
>>
> There are symbols in main.c that understand the tar file. Is something
> wrong with them ?
>
>
 I looked insight into the code and found that
 the fs-root.tar is untared by setup_rootfs->Untar_FromMemory.
 Is it becasue the tar version on my host pc does not match Untar_* in
RTEMS?
 I follow the compilation log to clarify how waf works and how fs-root.tar
is compiled into rtld.look at the following:
1. shell-init libx.a -> fs-root.tar -> fs-root-tarfile.o
2. init.c.5.o main.c.5.o fs-root-tarfile.o -lrtl -> rtld.prelink
3. nm rtld.prelink -> rtld-gsyms.c
4. init.c main.c rtld-gsyms.c xa.c x-long-name...-in-archive.c
  -> x.rap
5. shell-init libx.a x.rap -> fs-root.tar -> fs-root-tarfile.o
6. init.c.10.o main.c.10.o fs-root-tarfile.o  rtld-gsyms.10.o -lrtl -> rtld
I also objdump the code to see if any address is wrong, but all is ok.
Now what I doubt is only verison mismatch.

A question that I want your answer, is the rtld.prelink only used for
generating rtld-gsymcs.c? I think it is, but not sure.

Thanks.

>
>  In the wiki page, it says "The RTL Host project builds the RTEMS Linker
>> (rtems-ld) and the RTL project builds an RTEMS application that runs on
>> the i386 and SPARC processors". when using "waf configure
>> --prefix=/opt/rtems-4.11/ --rtems-arch=sparc", it works.But when using
>> "waf configure --prefix=/opt/rtems-4.11/ --rtems-arch=arm",
>>   it shows "could not find any architectures".
>>
>
> Fantastic. I think this is worth a GSoC proposal. :)


When modified the rtems.py with "d.endswith('-rtems*eabi*' + version)", the
configuration passed. But waf failed when generating x.rap using rtems-ld.
It tells "error: libelf:elf_getdata: .ARM.attributes(xa.c.8.o): Invalid
section descriptor"
I may dig into rtl-host code to figure out why and this may be part of the
work that I should focus on



>
>
 Howerver, the rtl-target code includes such files
>>   rtl-mdreloc-arm/m68k/powerpc/**i3868/nios2/sparc.c with mips missed, I
>> do not know
>>   whether these architectures all have been implemented.
>>
>
> I have only tested i386 and sparc and a while ago m68k. The other need
> work to be implemented.
>
>
>  Hope you can give me some advice on this and Which arch support would you
>> suggest me to work on? Thanks.
>>
>
> The project need work to implement more architectures. I am traveling at
> the moment and will be back later in the week. A proposal to work on these
> other archs would be welcome.


I want to implement arm support first. If time permits, I will implement
mips too.
Now I can not evaluate the workload whether I can finish one, two or more.
I am preparing the proposal and it'll be finished soon.
Thanks.

>
>
> Chris
>

Regards,
Peng.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130418/7d3e0203/attachment-0001.html>


More information about the devel mailing list