daily update
[deliverable/binutils-gdb.git] / bfd / elf32-mep.c
index e5d33caa5cd173f85c6b5dc57cfffb7923be30e9..f356fd06ffe0c2010a10f2b091ddf4bb7b059fce 100644 (file)
@@ -1,6 +1,6 @@
 /* MeP-specific support for 32-bit ELF.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+   2010, 2011, 2012 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -154,13 +154,14 @@ mep_reloc_type_lookup
 
     default:
       /* Pacify gcc -Wall.  */
-      fprintf (stderr, "mep: no reloc for code %d\n", code);
+      (*_bfd_error_handler) (_("mep: no reloc for code %d"), code);
       return NULL;
     }
 
   if (mep_elf_howto_table[type].type != type)
     {
-      fprintf (stderr, "MeP: howto %d has type %d\n", type, mep_elf_howto_table[type].type);
+      (*_bfd_error_handler) (_("MeP: howto %d has type %d"),
+                            type, mep_elf_howto_table[type].type);
       abort ();
     }
 
@@ -499,32 +500,19 @@ mep_elf_relocate_section
          name = h->root.root.string;
        }
 
-      if (sec != NULL && elf_discarded_section (sec))
-       {
-         /* For relocs against symbols from removed linkonce sections,
-            or sections discarded by a linker script, we just want the
-            section contents zeroed.  Avoid any special processing.  */
-         _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
-         rel->r_info = 0;
-         rel->r_addend = 0;
-         continue;
-       }
+      if (sec != NULL && discarded_section (sec))
+       RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+                                        rel, 1, relend, howto, 0, contents);
 
       if (info->relocatable)
        continue;
 
-      switch (r_type)
-       {
-       case R_RELC:
-         bfd_elf_perform_complex_relocation (input_bfd, input_section,
-                                             contents, rel, relocation);
-         continue;
-
-       default:
-         r = mep_final_link_relocate (howto, input_bfd, input_section,
-                                        contents, rel, relocation);
-         break;
-       }
+      if (r_type == R_RELC)
+       r = bfd_elf_perform_complex_relocation (input_bfd, input_section,
+                                               contents, rel, relocation);
+      else
+       r = mep_final_link_relocate (howto, input_bfd, input_section,
+                                    contents, rel, relocation);
 
       if (r != bfd_reloc_ok)
        {
@@ -618,7 +606,7 @@ mep_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
   flagword old_flags, new_flags;
   flagword old_partial, new_partial;
 
-  /* Check if we have the same endianess.  */
+  /* Check if we have the same endianness.  */
   if (_bfd_generic_verify_endian_match (ibfd, obfd) == FALSE)
     return FALSE;
 
@@ -690,8 +678,7 @@ static const char * config_names[] =
 {
   "basic"
   /* start-mepcfgtool */
-  ,"simple"
-  ,"fmax"
+  ,"default"
   /* end-mepcfgtool */
 };
 
@@ -712,7 +699,7 @@ mep_elf_print_private_bfd_data (bfd * abfd, void * ptr)
   _bfd_elf_print_private_bfd_data (abfd, ptr);
 
   flags = elf_elfheader (abfd)->e_flags;
-  fprintf (file, _("private flags = 0x%lx"), (long)flags);
+  fprintf (file, _("private flags = 0x%lx"), (unsigned long) flags);
 
   partial_flags = (flags & EF_MEP_CPU_MASK) >> 24;
   if (partial_flags < ARRAY_SIZE (core_names))
@@ -738,6 +725,7 @@ elf32_mep_machine (bfd * abfd)
     case EF_MEP_CPU_C2: return bfd_mach_mep;
     case EF_MEP_CPU_C3: return bfd_mach_mep;
     case EF_MEP_CPU_C4: return bfd_mach_mep;
+    case EF_MEP_CPU_C5: return bfd_mach_mep_c5;
     case EF_MEP_CPU_H1: return bfd_mach_mep_h1;
     }
 
This page took 0.024197 seconds and 4 git commands to generate.