From 2a750708dccb3e29e7e4c346debd89194f3e4748 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 11 Apr 2011 18:27:23 +0000 Subject: [PATCH] Fix the array access for BFD_RELOC_386_IRELATIVE. 2011-04-11 H.J. Lu * elf32-i386.c (elf_i386_reloc_type_lookup): Fix the out of bound array access for BFD_RELOC_386_IRELATIVE. --- bfd/ChangeLog | 5 +++++ bfd/elf32-i386.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5a28cb4b7bb..4d0f3e0daa3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2011-04-11 H.J. Lu + + * 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 * elf32-tic6x.c (elf32_tic6x_check_relocs): Initialize pc_count field. diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 189688126ff..8934d277864 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"); -- 2.30.2