This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] readelf and DT_RUNPATH
- From: John Reiser <jreiser at bitwagon dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Thomas Cougnard <thomas dot cougnard at gmail dot com>
- Date: Thu, 22 Oct 2009 10:25:36 -0700
- Subject: Re: [PATCH] readelf and DT_RUNPATH
- References: <7adad57e0910220825k6e5ace48oe21d6ebf79ef3df9@mail.gmail.com>
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];
--