* MAINTAINERS: Change my e-mail address.
[deliverable/binutils-gdb.git] / bfd / elf32-v850.c
index e41d0c0d7c4288f31eb7c1e42ba1c5cf52339855..0dc6542b2d64d3f674e203de5b4d33e8c6e7f1b5 100644 (file)
@@ -1877,6 +1877,9 @@ v850_elf_object_p (abfd)
     case E_V850E_ARCH:
       bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850e);
       break;
+    case E_V850E1_ARCH:
+      bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850e1);
+      break;
     }
   return TRUE;
 }
@@ -1895,6 +1898,7 @@ v850_elf_final_write_processing (abfd, linker)
     default:
     case bfd_mach_v850:  val = E_V850_ARCH; break;
     case bfd_mach_v850e: val = E_V850E_ARCH; break;
+    case bfd_mach_v850e1: val = E_V850E1_ARCH;  break;
     }
 
   elf_elfheader (abfd)->e_flags &=~ EF_V850_ARCH;
@@ -1960,8 +1964,24 @@ v850_elf_merge_private_bfd_data (ibfd, obfd)
 
   if ((in_flags & EF_V850_ARCH) != (out_flags & EF_V850_ARCH)
       && (in_flags & EF_V850_ARCH) != E_V850_ARCH)
-    _bfd_error_handler (_("%s: Architecture mismatch with previous modules"),
-                       bfd_archive_filename (ibfd));
+    {
+      /* Allow v850e1 binaries to be linked with v850e binaries.
+        Set the output binary to v850e.  */
+      if ((in_flags & EF_V850_ARCH) == E_V850E1_ARCH
+         && (out_flags & EF_V850_ARCH) == E_V850E_ARCH)
+       return TRUE;
+
+      if ((in_flags & EF_V850_ARCH) == E_V850E_ARCH
+         && (out_flags & EF_V850_ARCH) == E_V850E1_ARCH)
+       {
+         elf_elfheader (obfd)->e_flags =
+           ((out_flags & ~ EF_V850_ARCH) | E_V850E_ARCH);
+         return TRUE;
+       }
+
+      _bfd_error_handler (_("%s: Architecture mismatch with previous modules"),
+                         bfd_archive_filename (ibfd));
+    }
 
   return TRUE;
 }
@@ -1987,6 +2007,7 @@ v850_elf_print_private_bfd_data (abfd, ptr)
     default:
     case E_V850_ARCH: fprintf (file, _("v850 architecture")); break;
     case E_V850E_ARCH:  fprintf (file, _("v850e architecture")); break;
+    case E_V850E1_ARCH: fprintf (file, _("v850e1 architecture")); break;
     }
 
   fputc ('\n', file);
@@ -3139,6 +3160,38 @@ v850_elf_relax_section (abfd, sec, link_info, again)
   result = FALSE;
   goto finish;
 }
+
+static struct bfd_elf_special_section const v850_elf_special_sections[]=
+{
+  { ".sdata",          0,      NULL,   0,
+    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL },
+  { ".rosdata",                0,      NULL,   0,
+    SHT_PROGBITS,      SHF_ALLOC + SHF_V850_GPREL },
+  { ".sbss",           0,      NULL,   0,
+    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL },
+  { ".scommon",                0,      NULL,   0,
+    SHT_V850_SCOMMON,  SHF_ALLOC + SHF_WRITE + SHF_V850_GPREL },
+  { ".tdata",          0,      NULL,   0,
+    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL },
+  { ".tbss",           0,      NULL,   0,
+    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_V850_EPREL },
+  { ".tcommon",                0,      NULL,   0,
+    SHT_V850_TCOMMON,  SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL },
+  { ".zdata",          0,      NULL,   0,
+    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL },
+  { ".rozdata",                0,      NULL,   0,
+    SHT_PROGBITS,      SHF_ALLOC + SHF_V850_R0REL },
+  { ".zbss",           0,      NULL,   0,
+    SHT_NOBITS,                SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL },
+  { ".zcommon",                0,      NULL,   0,
+    SHT_V850_ZCOMMON,  SHF_ALLOC + SHF_WRITE + SHF_V850_R0REL },
+  { ".call_table_data",        0,      NULL,   0,
+    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE },
+  { ".call_table_text",        0,      NULL,   0,
+    SHT_PROGBITS,      SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR },
+  { NULL,              0,      NULL,   0,
+    0,                 0 }
+};
 \f
 #define TARGET_LITTLE_SYM                      bfd_elf32_v850_vec
 #define TARGET_LITTLE_NAME                     "elf32-v850"
@@ -3162,6 +3215,7 @@ v850_elf_relax_section (abfd, sec, link_info, again)
 #define elf_backend_fake_sections              v850_elf_fake_sections
 #define elf_backend_gc_mark_hook                v850_elf_gc_mark_hook
 #define elf_backend_gc_sweep_hook               v850_elf_gc_sweep_hook
+#define elf_backend_special_sections           v850_elf_special_sections
 
 #define elf_backend_can_gc_sections 1
 #define elf_backend_rela_normal 1
This page took 0.024679 seconds and 4 git commands to generate.