[GSOC2013] Dynamic object file loading
Peng Fan
van.freenix at gmail.com
Tue Apr 23 01:59:19 UTC 2013
Hi,
I have tested x.rap on Tiny6410 board. It works now.
The patch is listed in https://gist.github.com/MrVan/5440197
There is something wrong when using rtems arm gcc for s3c6410.
Gcc always generates undefined instructions for s3c6410.I do not know
why.
I may post it on user list.
The test is based on 4.10 not 4.11 for the gcc reson.
what I added is mainly:
1. Modify the current PC24 reloaction, add CALL and JUMP24.
In elf for arm, It says PC24 is Deprecated.
2. Modify the rtems_rtl_symbol_global_add function, because when "rap
ld ./x.rap",
It tells "can not find global symbols". To arm, the symbol in
rtld-gsyms.c needs align, so I add some code for this.
I will try to add other relocation types.Thanks.
Regards,
Peng.
2013/4/22 Gedare Bloom <gedare at rtems.org>
> Administrative note: I made your google doc private and shared it
> explicitly with Chris (and a handful of others).
>
Thanks very much.
>
> On Sun, Apr 21, 2013 at 11:45 PM, Chris Johns <chrisj at rtems.org> wrote:
> > Peng Fan wrote:
> >>
> >>
> >> I add the following code to ignore ARM.attributes and ARM.exidx sections
> >> which are contained in xa.c x-long.*.c and rtld.prelink. Not sure
> whether
> >> this is right or not, but when compling rtl target, all is passed. This
> >> may looks not a good way.
> >
> >
> > I have not looked into the best way to add this support. I suspect
> updating
> > elftoolchain is the best solution but I am not sure how.
> >
> >> diff --git a/elftoolchain/libelf/elf_data.c
> >> b/elftoolchain/libelf/elf_data.c
> >> index 5ac6453..a6e17ae 100644
> >> --- a/elftoolchain/libelf/elf_data.c
> >> +++ b/elftoolchain/libelf/elf_data.c
> >> @@ -87,9 +87,20 @@ elf_getdata(Elf_Scn *s, Elf_Data *d)
> >> return (NULL);
> >> }
> >> +if (sh_type == 0x70000003 || sh_type == 0x70000001) {
> >> +if ((d = _libelf_allocate_data(s)) == NULL)
> >>
> >> +return (NULL);
> >> +d->d_buf = 0;
> >> +d->d_size = 0;
> >> +return (d);
> >>
> >> +}
> >> + //printf("freenix %x %x\n", (sh_type), ELF_T_FIRST);
> >> +
> >>
> >> Now, I am trying to make the rtld run on my Tiny6410 board. It does run,
> >> but rap load ./x.rap fails. Error msg is:
> >> rtl: reloc unknown: sym = 0, type = 29, offset = 0x4, contents =
> >> 0xeafffffe
> >> error: loading: (22) .text: Unsupported relocation type 29 in non-PLT
> >> relocations
> >>
> >> Type 29 in elf for arm is R_TYPE_JUMP24 which is not supported in
> >> rtl-target side, thus error occurs. I am trying to add this to target
> >> side.
> >
> >
> > Excellent. This now the real task.
> >
> >>
> >> I have finished a proposal draft. It is here
> >>
> >> <
> https://docs.google.com/document/d/1HBkRU7_kUOvoiCQWTUxQ151kvX--3x_E7r0rTerxYbo/edit?usp=sharing
> >.
> >>
> >> You can edit it. Hope you can give me some suggestions. On the target
> >> side, I know the main work that I should done is in rtl-mdreloc-arm.c,
> >> but on the host side, It seems all have been done. Thnnks.
> >
> >
> > This is just a part of the project. The ARM relocation may not be
> enough. I
> > will think about this.
> >
> >
> > Chris
> > _______________________________________________
> > rtems-devel mailing list
> > rtems-devel at rtems.org
> > http://www.rtems.org/mailman/listinfo/rtems-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130423/7fce9291/attachment-0001.html>
More information about the devel
mailing list