]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix the array access for BFD_RELOC_386_IRELATIVE.
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 11 Apr 2011 18:27:23 +0000 (18:27 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 11 Apr 2011 18:27:23 +0000 (18:27 +0000)
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.

bfd/ChangeLog
bfd/elf32-i386.c

index 5a28cb4b7bb082bd34cb521effcebf10b7665f8c..4d0f3e0daa3140529f74311656877a64ce55900a 100644 (file)
@@ -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.
index 189688126ff198aedd527c70bcce26d7823a9b1d..8934d2778643c4f4a91ff0f43a072c87dce6ce74 100644 (file)
@@ -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");