* configure.tgt: Set targ_emul to arm_wince_pe for ARM Windows CE targets.
[deliverable/binutils-gdb.git] / bfd / elf64-mips.c
index 7f0bb12e670149eee7d9df7e06ce7c4651830662..09d13e862fff33f4c7cca46861ab1ea2de66484b 100644 (file)
@@ -112,8 +112,6 @@ static bfd_reloc_status_type mips_elf64_gprel32_reloc
   (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
 static bfd_reloc_status_type mips_elf64_shift6_reloc
   (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-static bfd_reloc_status_type mips16_jump_reloc
-  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
 static bfd_reloc_status_type mips16_gprel_reloc
   (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
 static bfd_boolean mips_elf64_assign_gp
@@ -299,9 +297,11 @@ static reloc_howto_type mips_elf64_howto_table_rel[] =
         0x0000ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
-  /* 16 bit PC relative reference.  */
+  /* 16 bit PC relative reference.  Note that the ABI document has a typo
+     and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
+     We do the right thing here.  */
   HOWTO (R_MIPS_PC16,          /* type */
-        0,                     /* rightshift */
+        2,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         16,                    /* bitsize */
         TRUE,                  /* pc_relative */
@@ -948,9 +948,11 @@ static reloc_howto_type mips_elf64_howto_table_rela[] =
         0x0000ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
-  /* 16 bit PC relative reference.  */
+  /* 16 bit PC relative reference.  Note that the ABI document has a typo
+     and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
+     We do the right thing here.  */
   HOWTO (R_MIPS_PC16,          /* type */
-        0,                     /* rightshift */
+        2,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         16,                    /* bitsize */
         TRUE,                  /* pc_relative */
@@ -1434,7 +1436,7 @@ static reloc_howto_type mips16_elf64_howto_table_rel[] =
                                /* This needs complex overflow
                                   detection, because the upper four
                                   bits must match the PC.  */
-        mips16_jump_reloc,     /* special_function */
+        _bfd_mips_elf_generic_reloc, /* special_function */
         "R_MIPS16_26",         /* name */
         TRUE,                  /* partial_inplace */
         0x3ffffff,             /* src_mask */
@@ -1506,7 +1508,7 @@ static reloc_howto_type mips16_elf64_howto_table_rela[] =
                                /* This needs complex overflow
                                   detection, because the upper four
                                   bits must match the PC.  */
-        mips16_jump_reloc,     /* special_function */
+        _bfd_mips_elf_generic_reloc, /* special_function */
         "R_MIPS16_26",         /* name */
         FALSE,                 /* partial_inplace */
         0x3ffffff,             /* src_mask */
@@ -2040,37 +2042,6 @@ mips_elf64_shift6_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
                                      error_message);
 }
 
-/* Handle a mips16 jump.  */
-
-static bfd_reloc_status_type
-mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry,
-                  asymbol *symbol, void *data ATTRIBUTE_UNUSED,
-                  asection *input_section, bfd *output_bfd,
-                  char **error_message ATTRIBUTE_UNUSED)
-{
-  if (output_bfd != NULL
-      && (symbol->flags & BSF_SECTION_SYM) == 0
-      && (! reloc_entry->howto->partial_inplace
-         || reloc_entry->addend == 0))
-    {
-      reloc_entry->address += input_section->output_offset;
-      return bfd_reloc_ok;
-    }
-
-  /* FIXME.  */
-  {
-    static bfd_boolean warned;
-
-    if (! warned)
-      (*_bfd_error_handler)
-       (_("Linking mips16 objects into %s format is not supported"),
-        bfd_get_target (input_section->output_section->owner));
-    warned = TRUE;
-  }
-
-  return bfd_reloc_undefined;
-}
-
 /* Handle a mips16 GP relative reloc.  */
 
 static bfd_reloc_status_type
@@ -2133,7 +2104,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
   /* There is no BFD reloc for R_MIPS_REL32.  */
   { BFD_RELOC_64, R_MIPS_64 },
   { BFD_RELOC_CTOR, R_MIPS_64 },
-  { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
+  { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
   { BFD_RELOC_HI16_S, R_MIPS_HI16 },
   { BFD_RELOC_LO16, R_MIPS_LO16 },
   { BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
@@ -2217,8 +2188,6 @@ bfd_elf64_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
       return &elf_mips_gnu_vtinherit_howto;
     case BFD_RELOC_VTABLE_ENTRY:
       return &elf_mips_gnu_vtentry_howto;
-    case BFD_RELOC_16_PCREL_S2:
-      return &elf_mips_gnu_rela16_s2;
     default:
       bfd_set_error (bfd_error_bad_value);
       return NULL;
@@ -3057,6 +3026,8 @@ const struct elf_size_info mips_elf64_size_info =
 #define elf_backend_create_dynamic_sections \
                                _bfd_mips_elf_create_dynamic_sections
 #define elf_backend_check_relocs       _bfd_mips_elf_check_relocs
+#define elf_backend_merge_symbol_attribute \
+                               _bfd_mips_elf_merge_symbol_attribute
 #define elf_backend_adjust_dynamic_symbol \
                                _bfd_mips_elf_adjust_dynamic_symbol
 #define elf_backend_always_size_sections \
@@ -3150,10 +3121,8 @@ extern bfd_boolean bfd_elf64_archive_write_armap
 #define TARGET_BIG_SYM                 bfd_elf64_bigmips_vec
 #define TARGET_BIG_NAME                        "elf64-bigmips"
 
-/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses
-   a value of 0x1000, and we are compatible.
-   FIXME: How does this affect NewABI?  */
-#define ELF_MAXPAGESIZE                        0x1000
+#define ELF_MAXPAGESIZE                        0x10000
+#define ELF_COMMONPAGESIZE             0x1000
 
 #include "elf64-target.h"
 
@@ -3164,15 +3133,15 @@ extern bfd_boolean bfd_elf64_archive_write_armap
 #undef TARGET_BIG_NAME
 
 #undef ELF_MAXPAGESIZE
+#undef ELF_COMMONPAGESIZE
 
 #define TARGET_LITTLE_SYM              bfd_elf64_tradlittlemips_vec
 #define TARGET_LITTLE_NAME             "elf64-tradlittlemips"
 #define TARGET_BIG_SYM                 bfd_elf64_tradbigmips_vec
 #define TARGET_BIG_NAME                        "elf64-tradbigmips"
 
-/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
-   page sizes of up to that limit, so we need to respect it.  */
 #define ELF_MAXPAGESIZE                        0x10000
+#define ELF_COMMONPAGESIZE             0x1000
 #define elf64_bed                      elf64_tradbed
 
 /* Include the target file again for this target.  */
This page took 0.031016 seconds and 4 git commands to generate.