Bug 13471 - out-of-range indexing error in elf_howto_table[ R_386_IRELATIVE]
Summary: out-of-range indexing error in elf_howto_table[ R_386_IRELATIVE]
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-02 23:37 UTC by mib.bugzilla
Modified: 2011-12-16 15:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mib.bugzilla 2011-12-02 23:37:02 UTC
I'm using the Intel compiler to compile binutils and it discovered an out-of-bounds indexing error at line #326 of elf32-i386.c

Here's the code that's presently there:

    case BFD_RELOC_386_TLS_DESC:
      TRACE ("BFD_RELOC_386_TLS_DESC");
      return &elf_howto_table[R_386_TLS_DESC - R_386_tls_offset];

    case BFD_RELOC_386_IRELATIVE:
      TRACE ("BFD_RELOC_386_IRELATIVE");
      return &elf_howto_table[R_386_IRELATIVE];  /* Bounds error on this line */

    case BFD_RELOC_VTABLE_INHERIT:
      TRACE ("BFD_RELOC_VTABLE_INHERIT");
      return &elf_howto_table[R_386_GNU_VTINHERIT - R_386_vt_offset];


Since there are gaps in the elf_howto_table, the R_386_IRELATIVE index needs an offset.

Thanks!

--Melanie
Comment 1 H.J. Lu 2011-12-16 15:27:11 UTC
Fixed by:

http://sourceware.org/ml/binutils/2011-04/msg00165.html