[GSOC2013] Dynamic object file loading

Chris Johns chrisj at rtems.org
Mon Apr 22 03:45:28 UTC 2013


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



More information about the devel mailing list