support 16 sect-diffs for mach-o
[deliverable/binutils-gdb.git] / bfd / coff-x86_64.c
index 4d500fe7cd5da5b9e49d6bf06a1b5bfea82bd537..4f00b78d413d3a3bd8c37c51fb71392a10eff10b 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD back-end for AMD 64 COFF files.
-   Copyright 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+   Copyright 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -192,7 +193,8 @@ coff_amd64_reloc (bfd *abfd,
 static bfd_boolean
 in_reloc_p (bfd *abfd ATTRIBUTE_UNUSED, reloc_howto_type *howto)
 {
-  return ! howto->pc_relative && howto->type != R_AMD64_IMAGEBASE;
+  return ! howto->pc_relative && howto->type != R_AMD64_IMAGEBASE
+        && howto->type != R_AMD64_SECREL;
 }
 #endif /* COFF_WITH_PE */
 
@@ -545,7 +547,7 @@ coff_amd64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
 {
   reloc_howto_type *howto;
 
-  if (rel->r_type > ARRAY_SIZE (howto_table))
+  if (rel->r_type >= ARRAY_SIZE (howto_table))
     {
       bfd_set_error (bfd_error_bad_value);
       return NULL;
@@ -555,10 +557,10 @@ coff_amd64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
 #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
+  if (rel->r_type >= R_AMD64_PCRLONG_1 && rel->r_type <= R_AMD64_PCRLONG_5)
+    {
+      *addendp -= (bfd_vma)(rel->r_type - R_AMD64_PCRLONG);
+      rel->r_type = R_AMD64_PCRLONG;
     }
 #endif
 
@@ -617,7 +619,8 @@ coff_amd64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
     {
       bfd_vma osect_vma;
 
-      if (h && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak))
+      if (h && (h->root.type == bfd_link_hash_defined
+               || h->root.type == bfd_link_hash_defweak))
        osect_vma = h->root.u.def.section->output_section->vma;
       else
        {
@@ -761,6 +764,7 @@ const bfd_target
 #endif
   '/',                         /* Ar_pad_char.  */
   15,                          /* Ar_max_namelen.  */
+  0,                           /* match priority.  */
 
   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
This page took 0.023644 seconds and 4 git commands to generate.