This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] readelf and DT_RUNPATH
- From: Thomas Cougnard <thomas dot cougnard at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Thomas Cougnard <thomas dot cougnard at gmail dot com>
- Date: Thu, 22 Oct 2009 17:25:08 +0200
- Subject: [PATCH] readelf and DT_RUNPATH
Hi,
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];
static bfd_vma dynamic_info_DT_GNU_HASH;
static bfd_vma version_info[16];
with DT_JMPREL equals to 23
This patch should fix it.
Thanks
Thomas
[Please CC me]
--- binutils-orig/binutils/readelf.c 2009-10-16 12:05:06.000000000 +0200
+++ binutils/binutils/readelf.c 2009-10-22 15:30:01.000000000 +0200
@@ -165,7 +165,7 @@
static unsigned long dynamic_syminfo_offset;
static unsigned int dynamic_syminfo_nent;
static char program_interpreter[PATH_MAX];
-static bfd_vma dynamic_info[DT_JMPREL + 1];
+static bfd_vma dynamic_info[DT_RUNPATH + 1];
static bfd_vma dynamic_info_DT_GNU_HASH;
static bfd_vma version_info[16];
static Elf_Internal_Ehdr elf_header;