aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-10-21 19:37:15 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-10-21 19:37:15 +0000
commit9892017203958346ddb7920e8c4678d8c1640775 (patch)
treeee3cc095f4bd2c5c3438c1bbeac6574b09621e60 /bfd/elf64-x86-64.c
parent6cda5a20820e95cf01d510f2478cd4b992cf416b (diff)
downloadgdb-9892017203958346ddb7920e8c4678d8c1640775.zip
gdb-9892017203958346ddb7920e8c4678d8c1640775.tar.gz
gdb-9892017203958346ddb7920e8c4678d8c1640775.tar.bz2
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/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 645e5a2..2206dd4 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3161,6 +3161,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
{
Elf_Internal_Rela outrel;
asection *sreloc;
+ bfd_boolean relocate;
/* Need a dynamic relocation to get the real function
address. */
@@ -3180,15 +3181,15 @@ elf_x86_64_relocate_section (bfd *output_bfd,
|| info->executable)
{
/* This symbol is resolved locally. */
- outrel.r_info = htab->r_info (0, R_X86_64_IRELATIVE);
- outrel.r_addend = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
+ outrel.r_info = htab->r_info (0, R_X86_64_RELATIVE);
+ outrel.r_addend = relocation;
+ relocate = FALSE;
}
else
{
outrel.r_info = htab->r_info (h->dynindx, r_type);
outrel.r_addend = 0;
+ relocate = FALSE;
}
sreloc = htab->elf.irelifunc;
@@ -3199,7 +3200,8 @@ elf_x86_64_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_X86_64_PC32: