aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-x86_64.c
diff options
context:
space:
mode:
authorAwson <kyrab@mail.ru>2016-09-26 16:16:25 +0100
committerNick Clifton <nickc@redhat.com>2016-09-26 16:16:25 +0100
commit384f7503344b1d07561f801ced7493858cde6164 (patch)
treec5bd65aac6f050b151ac05fc678f5576bb56154d /bfd/coff-x86_64.c
parent2b848ebdbb2d1f856c7525ed4d6efaf6fe70de81 (diff)
downloadgdb-384f7503344b1d07561f801ced7493858cde6164.zip
gdb-384f7503344b1d07561f801ced7493858cde6164.tar.gz
gdb-384f7503344b1d07561f801ced7493858cde6164.tar.bz2
Fix the calculation of AMD64_PCRQUAD relocations.
PR ld/17955 * coff-x86_64.c (coff_amd64_rtype_to_howto): Use an 8 byte offset for R_AMD64_PCRQUAD relocations.
Diffstat (limited to 'bfd/coff-x86_64.c')
-rw-r--r--bfd/coff-x86_64.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c
index 398bc48..d92e03d 100644
--- a/bfd/coff-x86_64.c
+++ b/bfd/coff-x86_64.c
@@ -614,7 +614,12 @@ coff_amd64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
#if defined(COFF_WITH_PE)
if (howto->pc_relative)
{
- *addendp -= 4;
+#ifndef DONT_EXTEND_AMD64
+ if (rel->r_type == R_AMD64_PCRQUAD)
+ *addendp -= 8;
+ else
+#endif
+ *addendp -= 4;
/* If the symbol is defined, then the generic code is going to
add back the symbol value in order to cancel out an