Hi,

This is really gross. Please put the comment about two phase parsing inline
and install as a workaround.
TIA,
Bernhard
On May 26, 2011 6:28 PM, "Bernd Schmidt" <[email protected]> wrote:
> Alan Davis discovered a problem using shared libraries with textrel
> symbols on nommu (C6X). He writes:
>
> "I think I've found a bug in the dynamic loader's dynamic DSBT index
> assignment. When I try to execute a program that has a textrel DSO, it
> fails to load. The telltale line in the LD_DEBUG output is:
>
> _dl_get_ready_to_run:779: file=''; needed by './a.out'
>
> The corresponding DT_NEEDED entry has 'libc.so.0', but here the filename
> is empty. This is what is happening in _dl_elf_shared_library():
>
> First, map all segments according to their permissions. Text gets
> initially mapped read-only.
>
> Then, parse the dynamic information. The dynamic table is in RW but some
> of the tags may point to RO. For example, DT_NEEDED points to a string
> in .dynstr which is in RO. These pointers get computed according to the
> loadmap from the original mapping.
>
> Then, in response to a DT_TEXTREL tag, the RO segment gets remapped,
> thereby invaliding anything that points to it, in particular certain
> dynamic tags such as DT_NEEDED.
>
> I validated this by applying the following patch, which re-parses the
> dynamic info after the remapping so as to re-compute any invalid
> pointers. There are perhaps better solutions; perhaps split the tag
> parsing into two passes, the first of which scans only for DT_TEXTREL
> and then the rest can happen after remapping."
>
>
> I've looked over the patch and it looks good to me. Ok to apply?
>
>
> Bernd
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to