aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-03-09 16:28:38 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-03-09 16:28:38 +0000
commit56b8aada47fa75b378cfa821857730d4e3400318 (patch)
tree075cc5b3032a9ba7ac977fd639c66e83f2a2fa33 /bfd/elf32-i386.c
parent05b8a7895afd8252854ff3b2892090b63b4d8d36 (diff)
downloadgdb-56b8aada47fa75b378cfa821857730d4e3400318.zip
gdb-56b8aada47fa75b378cfa821857730d4e3400318.tar.gz
gdb-56b8aada47fa75b378cfa821857730d4e3400318.tar.bz2
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 d187305..01c0669 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: