Skip to content

Commit

Permalink
Add support for V850E3V5 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
nickclifton committed Jan 24, 2013
1 parent d749946 commit 78c8d46
Show file tree
Hide file tree
Showing 20 changed files with 1,512 additions and 350 deletions.
8 changes: 8 additions & 0 deletions bfd/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2013-01-24 Nick Clifton <nickc@redhat.com>

* archures.c: Add bfd_mach_v850e3v5.
* bfd-in2.h: Regenerate.
* cpu-v850.c: Add entries for v850e2v5 and v850e3v5.
* cpu-v850_rh850.c: Likewise.
* elf32-v850.c: Add support for v850e3v5 architecture.

2013-01-23 Markos Chandras <markos.chandras@imgtec.com>

* elf32-metag.c: Error on HIADDR16/LOADDR16 in shared link.
Expand Down
1 change: 1 addition & 0 deletions bfd/archures.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ DESCRIPTION
.#define bfd_mach_v850e1 '1'
.#define bfd_mach_v850e2 0x4532
.#define bfd_mach_v850e2v3 0x45325633
.#define bfd_mach_v850e3v5 0x45335635 {* ('E'|'3'|'V'|'5') *}
. bfd_arch_arc, {* ARC Cores *}
.#define bfd_mach_arc_5 5
.#define bfd_mach_arc_6 6
Expand Down
1 change: 1 addition & 0 deletions bfd/bfd-in2.h
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,7 @@ enum bfd_architecture
#define bfd_mach_v850e1 '1'
#define bfd_mach_v850e2 0x4532
#define bfd_mach_v850e2v3 0x45325633
#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5') */
bfd_arch_arc, /* ARC Cores */
#define bfd_mach_arc_5 5
#define bfd_mach_arc_6 6
Expand Down
11 changes: 6 additions & 5 deletions bfd/cpu-v850.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* BFD support for the NEC V850 processor
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2007,
2010, 2012 Free Software Foundation, Inc.
Copyright 1996-2013 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
Expand Down Expand Up @@ -32,9 +31,11 @@

static const bfd_arch_info_type arch_info_struct[] =
{
N (bfd_mach_v850e2v3, "v850e2v3", FALSE, & arch_info_struct[1]),
N (bfd_mach_v850e2, "v850e2", FALSE, & arch_info_struct[2]),
N (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[3]),
N (bfd_mach_v850e3v5, "v850e3v5", FALSE, & arch_info_struct[1]),
N (bfd_mach_v850e3v5, "v850e2v4", FALSE, & arch_info_struct[2]),
N (bfd_mach_v850e2v3, "v850e2v3", FALSE, & arch_info_struct[3]),
N (bfd_mach_v850e2, "v850e2", FALSE, & arch_info_struct[4]),
N (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[5]),
N (bfd_mach_v850e, "v850e", FALSE, NULL)
};

Expand Down
10 changes: 6 additions & 4 deletions bfd/cpu-v850_rh850.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* BFD support for the NEC V850 processor with the RH850 ABI.
Copyright 2012 Free Software Foundation, Inc.
Copyright 2012-2013 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
Expand Down Expand Up @@ -29,9 +29,11 @@

static const bfd_arch_info_type arch_info_struct[] =
{
R (bfd_mach_v850e2v3, "v850e2v3", FALSE, & arch_info_struct[1]),
R (bfd_mach_v850e2, "v850e2", FALSE, & arch_info_struct[2]),
R (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[3]),
R (bfd_mach_v850e3v5, "v850e3v5", FALSE, & arch_info_struct[1]),
R (bfd_mach_v850e3v5, "v850e2v4", FALSE, & arch_info_struct[2]),
R (bfd_mach_v850e2v3, "v850e2v3", FALSE, & arch_info_struct[3]),
R (bfd_mach_v850e2, "v850e2", FALSE, & arch_info_struct[4]),
R (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[5]),
R (bfd_mach_v850e, "v850e", FALSE, NULL)
};

Expand Down
23 changes: 19 additions & 4 deletions bfd/elf32-v850.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* V850-specific support for 32-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Copyright 1996-2013 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
Expand Down Expand Up @@ -2340,7 +2338,8 @@ v850_elf_object_p (bfd *abfd)
{
case EM_V800:
arch = bfd_arch_v850_rh850;
mach = bfd_mach_v850e2v3;
mach = (elf_elfheader (abfd)->e_flags & EF_V800_850E3)
? bfd_mach_v850e3v5 : bfd_mach_v850e2v3;
break;

case EM_CYGNUS_V850:
Expand All @@ -2354,6 +2353,7 @@ v850_elf_object_p (bfd *abfd)
case E_V850E1_ARCH: mach = bfd_mach_v850e1; break;
case E_V850E2_ARCH: mach = bfd_mach_v850e2; break;
case E_V850E2V3_ARCH: mach = bfd_mach_v850e2v3; break;
case E_V850E3V5_ARCH: mach = bfd_mach_v850e3v5; break;
}
break;

Expand All @@ -2376,6 +2376,8 @@ v850_elf_final_write_processing (bfd *abfd,
{
case bfd_arch_v850_rh850:
val = EF_RH850_ABI;
if (bfd_get_mach (abfd) == bfd_mach_v850e3v5)
val |= EF_V800_850E3;
elf_elfheader (abfd)->e_flags |= val;
break;

Expand All @@ -2388,6 +2390,7 @@ v850_elf_final_write_processing (bfd *abfd,
case bfd_mach_v850e1: val = E_V850E1_ARCH; break;
case bfd_mach_v850e2: val = E_V850E2_ARCH; break;
case bfd_mach_v850e2v3: val = E_V850E2V3_ARCH; break;
case bfd_mach_v850e3v5: val = E_V850E3V5_ARCH; break;
}
elf_elfheader (abfd)->e_flags &=~ EF_V850_ARCH;
elf_elfheader (abfd)->e_flags |= val;
Expand Down Expand Up @@ -2507,6 +2510,17 @@ v850_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
return TRUE;
}

if (( (in_flags & EF_V850_ARCH) == E_V850_ARCH
|| (in_flags & EF_V850_ARCH) == E_V850E_ARCH
|| (in_flags & EF_V850_ARCH) == E_V850E2_ARCH
|| (in_flags & EF_V850_ARCH) == E_V850E2V3_ARCH)
&& (out_flags & EF_V850_ARCH) == E_V850E3V5_ARCH)
{
elf_elfheader (obfd)->e_flags =
((out_flags & ~ EF_V850_ARCH) | E_V850E3V5_ARCH);
return TRUE;
}

_bfd_error_handler (_("%B: Architecture mismatch with previous modules"),
ibfd);
}
Expand Down Expand Up @@ -2550,6 +2564,7 @@ v850_elf_print_private_bfd_data (bfd *abfd, void * ptr)
case E_V850E1_ARCH: fprintf (file, _("v850e1 architecture")); break;
case E_V850E2_ARCH: fprintf (file, _("v850e2 architecture")); break;
case E_V850E2V3_ARCH: fprintf (file, _("v850e2v3 architecture")); break;
case E_V850E3V5_ARCH: fprintf (file, _("v850e3v5 architecture")); break;
}
}

Expand Down
4 changes: 4 additions & 0 deletions binutils/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2013-01-24 Nick Clifton <nickc@redhat.com>

* readelf.c (get_machine_flags): Decode E_V850E3V5_ARCH.

2013-01-23 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>

* readelf.c: Add strings for NT_S390_LAST_BREAK and
Expand Down
5 changes: 4 additions & 1 deletion binutils/readelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2476,6 +2476,9 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
case EM_CYGNUS_V850:
switch (e_flags & EF_V850_ARCH)
{
case E_V850E3V5_ARCH:
strcat (buf, ", v850e3v5");
break;
case E_V850E2V3_ARCH:
strcat (buf, ", v850e2v3");
break;
Expand Down Expand Up @@ -10323,8 +10326,8 @@ is_16bit_abs_reloc (unsigned int reloc_type)
case EM_M32C_OLD:
case EM_M32C:
return reloc_type == 1; /* R_M32C_16 */
case EM_MSP430_OLD:
case EM_MSP430:
case EM_MSP430_OLD:
return reloc_type == 5; /* R_MSP430_16_BYTE. */
case EM_ALTERA_NIOS2:
case EM_NIOS32:
Expand Down
5 changes: 5 additions & 0 deletions gas/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2013-01-24 Nick Clifton <nickc@redhat.com>

* config/tc-v850.c: Add support for e3v5 architecture.
* doc/c-v850.texi: Mention new support.

2013-01-23 Nick Clifton <nickc@redhat.com>

PR gas/15039
Expand Down
Loading

0 comments on commit 78c8d46

Please sign in to comment.