[PATCH] readelf and DT_RUNPATH

John Reiser jreiser@bitwagon.com
Thu Oct 22 17:26:00 GMT 2009


On 10/22/2009 08:25 AM, Thomas Cougnard wrote:
> When processing the dynamic section and encountering a DT_RUNPATH
> entry, the following code (readelf.c:6383)
>         case DT_RUNPATH :
>           dynamic_info[entry->d_tag] = entry->d_un.d_val;
>
> corrupts version_info, since entry->d_tag is 29 and dynamic_info is
>
> static bfd_vma dynamic_info[DT_JMPREL + 1];

> with DT_JMPREL equals to 23.
 > Proposed:
> -static bfd_vma dynamic_info[DT_JMPREL + 1];
> +static bfd_vma dynamic_info[DT_RUNPATH + 1];

The binutils mailing list just had a kerfluffle about DT_ENCODING:
    http://sourceware.org/ml/binutils/2009-10/msg00362.html

A better fix for DT_RUNPATH vs. readelf.c:6368 is:
 > -static bfd_vma dynamic_info[DT_JMPREL + 1];
 > +static bfd_vma dynamic_info[DT_ENCODING];

-- 



More information about the Binutils mailing list