2009-10-23 Kai Tietz <kai.tietz@onevision.com>
authorKai Tietz <kai.tietz@onevision.com>
Fri, 23 Oct 2009 11:30:25 +0000 (11:30 +0000)
committerKai Tietz <kai.tietz@onevision.com>
Fri, 23 Oct 2009 11:30:25 +0000 (11:30 +0000)
        * coff-x86_64.c (coff_amd64_rtype_to_howto): Subtract offset
        of R_AMD64_PCRLONG_<X> relocations from addend.

bfd/ChangeLog
bfd/coff-x86_64.c

index 6fabb76285157717c4eb4526ee4a505e610b8d0f..35a295a801044327fd3c5487b6901e162892692a 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-23  Kai Tietz  <kai.tietz@onevision.com>
+
+       * coff-x86_64.c (coff_amd64_rtype_to_howto): Subtract offset
+       of R_AMD64_PCRLONG_<X> relocations from addend.
+
 2009-10-23  Alan Modra  <amodra@bigpond.net.au>
 
        * plugin.c: Produce empty object if not BFD_SUPPORTS_PLUGINS.
index ecce9f40c8d94a60dcb5cb70a6e344add7ea0db9..08ada5a6c19d83c5560dd2db3da37c9bb3cb2915 100644 (file)
@@ -550,16 +550,16 @@ coff_amd64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
       bfd_set_error (bfd_error_bad_value);
       return NULL;
     }
-  if (rel->r_type >= R_AMD64_PCRLONG_1 && rel->r_type <= R_AMD64_PCRLONG_5)
-    {
-      rel->r_vaddr += (bfd_vma)(rel->r_type-R_AMD64_PCRLONG);
-      rel->r_type = R_AMD64_PCRLONG;
-    }
   howto = howto_table + rel->r_type;
 
 #if defined(COFF_WITH_PE)
   /* Cancel out code in _bfd_coff_generic_relocate_section.  */
   *addendp = 0;
+  if (rel->r_type >= R_AMD64_PCRLONG_1 && rel->r_type <= R_AMD64_PCRLONG_5)\r
+    {\r
+      *addendp -= (bfd_vma)(rel->r_type - R_AMD64_PCRLONG);\r
+      rel->r_type = R_AMD64_PCRLONG;\r
+    }
 #endif
 
   if (howto->pc_relative)