diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-02-10 19:33:52 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-02-10 19:33:52 -0800 |
commit | 32875eb1f3b928dfe63c5752e8152a9dc09928f3 (patch) | |
tree | 7d780b230e36bc7b2ba73551017f69067fa2c7d2 /bfd | |
parent | cd7c1b9a7e11b20916ac0aa0f776d35897ebd47b (diff) | |
download | gdb-32875eb1f3b928dfe63c5752e8152a9dc09928f3.zip gdb-32875eb1f3b928dfe63c5752e8152a9dc09928f3.tar.gz gdb-32875eb1f3b928dfe63c5752e8152a9dc09928f3.tar.bz2 |
Mask off the least significant bit in GOT offset
The least significant bit in GOT offset is to record whether we have
initialized the GOT entry in R_386_GOT32 processing. We need to mask
it off for R_386_GOT32X.
PR ld/19601
* elf32-i386.c (elf_i386_relocate_section): Mask off the least
significant bit in GOT offset for R_386_GOT32X.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 40739c8..017bbc1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2016-02-10 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/19601 + * elf32-i386.c (elf_i386_relocate_section): Mask off the least + significant bit in GOT offset for R_386_GOT32X. + 2016-02-10 Nick Clifton <nickc@redhat.com> PR 19405 diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index ccd0135..a8951d8 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -4016,10 +4016,12 @@ elf_i386_relocate_section (bfd *output_bfd, /* It is relative to .got.plt section. */ if (h->got.offset != (bfd_vma) -1) - /* Use GOT entry. */ + /* Use GOT entry. Mask off the least significant bit in + GOT offset which may be set by R_386_GOT32 processing + below. */ relocation = (htab->elf.sgot->output_section->vma + htab->elf.sgot->output_offset - + h->got.offset - offplt); + + (h->got.offset & ~1) - offplt); else /* Use GOTPLT entry. */ relocation = (h->plt.offset / plt_entry_size - 1 + 3) * 4; |