Improve verbose message
[deliverable/binutils-gdb.git] / bfd / elf32-mcore.c
index 0f78002dcfe70e4ceb0a33629569c9a616fb88ea..99e9c73596e6a9b75da947294ffdb26455c60bf2 100644 (file)
@@ -1,4 +1,4 @@
-/* Motorolla MCore specific support for 32-bit ELF
+/* Motorola MCore specific support for 32-bit ELF
    Copyright 1994, 1995, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -57,16 +57,16 @@ static reloc_howto_type mcore_elf_howto_raw[] =
   HOWTO (R_MCORE_NONE,         /* type */
         0,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        1,                     /* bitsize */
-        true,                  /* pc_relative */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_bitfield,  /* complain_on_overflow */
-        mcore_elf_unsupported_reloc, /* special_function */
+        NULL,                  /* special_function */
         "R_MCORE_NONE",        /* name */
         false,                 /* partial_inplace */
         0,                     /* src_mask */
         0,                     /* dst_mask */
-        true),                 /* pcrel_offset */
+        false),                /* pcrel_offset */
 
   /* A standard 32 bit relocation.  */
   HOWTO (R_MCORE_ADDR32,       /* type */
@@ -209,7 +209,7 @@ static reloc_howto_type mcore_elf_howto_raw[] =
         true,                  /* partial_inplace */
         0xffffffff,            /* src_mask */
         0xffffffff,            /* dst_mask */
-        true)                  /* pcrel_offset */
+        false)                 /* pcrel_offset */
 };
 
 #ifndef NUM_ELEM
@@ -237,7 +237,7 @@ mcore_elf_howto_init ()
 \f
 static reloc_howto_type *
 mcore_elf_reloc_type_lookup (abfd, code)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type code;
 {
   enum elf_mcore_reloc_type mcore_reloc = R_MCORE_NONE;
@@ -267,7 +267,7 @@ mcore_elf_reloc_type_lookup (abfd, code)
 /* Set the howto pointer for a RCE ELF reloc.  */
 static void
 mcore_elf_info_to_howto (abfd, cache_ptr, dst)
-     bfd * abfd;
+     bfd * abfd ATTRIBUTE_UNUSED;
      arelent * cache_ptr;
      Elf32_Internal_Rela * dst;
 {
@@ -320,21 +320,10 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd)
 {
   flagword old_flags;
   flagword new_flags;
-  boolean error;
 
   /* Check if we have the same endianess */
-  if (   ibfd->xvec->byteorder != obfd->xvec->byteorder
-      && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
-    {
-      (*_bfd_error_handler)
-       (_("%s: compiled for a %s endian system and target is %s endian.\n"),
-        bfd_get_filename (ibfd),
-         bfd_big_endian (ibfd) ? "big" : "little",
-         bfd_big_endian (obfd) ? "big" : "little");
-
-      bfd_set_error (bfd_error_wrong_format);
-      return false;
-    }
+  if (_bfd_generic_verify_endian_match (ibfd, obfd) == false)
+    return false;
 
   if (   bfd_get_flavour (ibfd) != bfd_target_elf_flavour
       || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@@ -350,7 +339,11 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd)
     }
   else if (new_flags == old_flags)     /* Compatible flags are ok */
     ;
-  
+  else
+    {
+      /* FIXME */
+    }
+
   return true;
 }
 
@@ -363,11 +356,11 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
                           output_bfd, error_message)
      bfd * abfd;
      arelent * reloc_entry;
-     asymbol * symbol;
-     PTR data;
-     asection * input_section;
-     bfd * output_bfd;
-     char ** error_message;
+     asymbol * symbol ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     asection * input_section ATTRIBUTE_UNUSED;
+     bfd * output_bfd ATTRIBUTE_UNUSED;
+     char ** error_message ATTRIBUTE_UNUSED;
 {
   BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
   
@@ -412,7 +405,7 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
 static boolean
 mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                          contents, relocs, local_syms, local_sections)
-     bfd * output_bfd;
+     bfd * output_bfd ATTRIBUTE_UNUSED;
      struct bfd_link_info * info;
      bfd * input_bfd;
      asection * input_section;
@@ -426,7 +419,6 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   Elf_Internal_Rela *           rel = relocs;
   Elf_Internal_Rela *           relend = relocs + input_section->reloc_count;
   boolean ret = true;
-  long insn;
 
 #ifdef DEBUG
   fprintf (stderr,
@@ -452,7 +444,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
       Elf_Internal_Sym *           sym = (Elf_Internal_Sym *) 0;
       unsigned long                r_symndx;
       struct elf_link_hash_entry * h = (struct elf_link_hash_entry *) 0;
-      unsigned short               oldinst;
+      unsigned short               oldinst = 0;
       
       /* Unknown relocation handling */
       if ((unsigned) r_type >= (unsigned) R_MCORE_max
@@ -530,13 +522,14 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared)
+         else if (info->shared
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
              if (! ((*info->callbacks->undefined_symbol)
                        (info, h->root.root.string, input_bfd,
-                        input_section, rel->r_offset)))
+                        input_section, rel->r_offset, true)))
                return false;
 
              ret = false;
@@ -621,7 +614,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 static asection *
 mcore_elf_gc_mark_hook (abfd, info, rel, h, sym)
      bfd *                        abfd;
-     struct bfd_link_info *       info;
+     struct bfd_link_info *       info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *          rel;
      struct elf_link_hash_entry * h;
      Elf_Internal_Sym *           sym;
@@ -643,6 +636,9 @@ mcore_elf_gc_mark_hook (abfd, info, rel, h, sym)
              
            case bfd_link_hash_common:
              return h->root.u.c.p->section;
+
+           default:
+             break;
            }
        }
     }
@@ -664,10 +660,10 @@ mcore_elf_gc_mark_hook (abfd, info, rel, h, sym)
 
 static boolean
 mcore_elf_gc_sweep_hook (abfd, info, sec, relocs)
-     bfd *                     abfd;
-     struct bfd_link_info *    info;
-     asection *                sec;
-     const Elf_Internal_Rela * relocs;
+     bfd *                     abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *    info ATTRIBUTE_UNUSED;
+     asection *                sec ATTRIBUTE_UNUSED;
+     const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED;
 {
   return true;
 }
This page took 0.036324 seconds and 4 git commands to generate.