This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Fix the array access for BFD_RELOC_386_IRELATIVE


Hi,

I checked in this patch to fix the array access for BFD_RELOC_386_IRELATIVE.


H.J.
---
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5a28cb4..4d0f3e0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-i386.c (elf_i386_reloc_type_lookup): Fix the out of bound
+	array access for BFD_RELOC_386_IRELATIVE.
+
 2011-04-11  Bernd Schmidt  <bernds@codesourcery.com>
 
 	* elf32-tic6x.c (elf32_tic6x_check_relocs): Initialize pc_count field.
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 1896881..8934d27 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -324,7 +324,7 @@ elf_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 
     case BFD_RELOC_386_IRELATIVE:
       TRACE ("BFD_RELOC_386_IRELATIVE");
-      return &elf_howto_table[R_386_IRELATIVE];
+      return &elf_howto_table[R_386_IRELATIVE - R_386_tls_offset];
 
     case BFD_RELOC_VTABLE_INHERIT:
       TRACE ("BFD_RELOC_VTABLE_INHERIT");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]