PR22374 testcase, function pointer references in .data
[deliverable/binutils-gdb.git] / bfd / coff-x86_64.c
index 9d7c845e6e678ad2c18935ba291a72ff33dac678..de22822e7b2720d5243199b20e755bacd5b05094 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for AMD 64 COFF files.
-   Copyright (C) 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 2006-2017 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -182,9 +182,9 @@ coff_amd64_reloc (bfd *abfd,
 
        case 4:
          {
-           long long x = bfd_get_64 (abfd, addr);
+           bfd_uint64_t x = bfd_get_64 (abfd, addr);
            DOIT (x);
-           bfd_put_64 (abfd, (bfd_vma) x, addr);
+           bfd_put_64 (abfd, x, addr);
          }
          break;
 
@@ -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
This page took 0.023697 seconds and 4 git commands to generate.