summaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-03-09 16:28:35 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-03-09 16:28:35 +0000
commit18dd5dfe04c739a5e1da8f53c394f45851349049 (patch)
treeb75a32a19b585b9de424e40a4eb3be00a2199303 /bfd/elf32-i386.c
parent76700df8547a1dc7a7a064f2be39f5b855f3089b (diff)
downloadbinutils-redhat-18dd5dfe04c739a5e1da8f53c394f45851349049.tar.gz
Restore R_386_IRELATIVE and R_X86_64_IRELATIVE
bfd/ 2012-03-09 H.J. Lu <hongjiu.lu@intel.com> PR ld/13817 * bfd/elf32-i386.c (elf_i386_relocate_section): Restore R_386_IRELATIVE. * * elf64-x86-64.c (elf_x86_64_relocate_section): Restore R_X86_64_IRELATIVE. ld/testsuite/ 2012-03-09 H.J. Lu <hongjiu.lu@intel.com> PR ld/13817 * ld-i386/pr13302.d: Updated. * ld-x86-64/pr13082-5b.d: Likewise. * 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, 8 insertions, 9 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index d1873051b4..01c0669595 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -3257,7 +3257,6 @@ 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. */
@@ -3278,14 +3277,15 @@ elf_i386_relocate_section (bfd *output_bfd,
|| info->executable)
{
/* This symbol is resolved locally. */
- outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE);
- relocate = TRUE;
+ 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);
}
else
- {
- outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
- relocate = FALSE;
- }
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
sreloc = htab->elf.irelifunc;
loc = sreloc->contents;
@@ -3298,8 +3298,7 @@ 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. */
- if (! relocate)
- continue;
+ continue;
}
/* FALLTHROUGH */
case R_386_PC32: