summaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-10-21 19:37:13 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-10-21 19:37:13 +0000
commit6114d4171bd5378fdcc829ab3ca0eac74ceb6df5 (patch)
tree1496277b4728268b4ebc53a37fde4f5eb360e7db /bfd/elf32-i386.c
parentc5556b8ae170c519a645949031644a31ee9cea11 (diff)
downloadbinutils-redhat-6114d4171bd5378fdcc829ab3ca0eac74ceb6df5.tar.gz
Replace IRELATIVE relocations with RELATIVE in .rel.dyn.
bfd/ 2011-10-21 H.J. Lu <hongjiu.lu@intel.com> PR ld/13302 * elf32-i386.c (elf_i386_relocate_section): Replace R_386_IRELATIVE with R_386_RELATIVE. * elf64-x86-64.c (elf_x86_64_relocate_section): Replace R_X86_64_IRELATIVE with R_X86_64_RELATIVE. ld/testsuite/ 2011-10-21 H.J. Lu <hongjiu.lu@intel.com> PR ld/13302 * ld-i386/i386.exp: Run pr13302. * ld-i386/pr13302.d: New. * ld-i386/pr13302.s: Likewise. * ld-x86-64/pr13082-5b.d: Updated. * ld-x86-64/pr13082-6a.d: Likewise. * ld-x86-64/pr13082-6b.d: Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 01c0669595..d1873051b4 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -3257,6 +3257,7 @@ elf_i386_relocate_section (bfd *output_bfd,
bfd_byte *loc;
asection *sreloc;
bfd_vma offset;
+ bfd_boolean relocate;
/* Need a dynamic relocation to get the real function
adddress. */
@@ -3277,15 +3278,14 @@ elf_i386_relocate_section (bfd *output_bfd,
|| info->executable)
{
/* This symbol is resolved locally. */
- outrel.r_info = ELF32_R_INFO (0, R_386_IRELATIVE);
- bfd_put_32 (output_bfd,
- (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset),
- contents + offset);
+ outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE);
+ relocate = TRUE;
}
else
- outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ {
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ relocate = FALSE;
+ }
sreloc = htab->elf.irelifunc;
loc = sreloc->contents;
@@ -3298,7 +3298,8 @@ elf_i386_relocate_section (bfd *output_bfd,
we need to include the symbol value so that it
becomes an addend for the dynamic reloc. For an
internal symbol, we have updated addend. */
- continue;
+ if (! relocate)
+ continue;
}
/* FALLTHROUGH */
case R_386_PC32: