1999-05-03 15:29:11 +08:00
|
|
|
/* BFD support for the NEC V850 processor
|
2017-01-02 11:36:43 +08:00
|
|
|
Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
2002-08-29 14:49:35 +08:00
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
2002-08-29 14:49:35 +08:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-07-03 22:26:43 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-08-29 14:49:35 +08:00
|
|
|
(at your option) any later version.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
2002-08-29 14:49:35 +08:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
2002-08-29 14:49:35 +08:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2007-07-03 22:26:43 +08:00
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
#include "sysdep.h"
|
2007-04-26 22:47:00 +08:00
|
|
|
#include "bfd.h"
|
1999-05-03 15:29:11 +08:00
|
|
|
#include "libbfd.h"
|
2001-09-19 13:33:36 +08:00
|
|
|
#include "safe-ctype.h"
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
#define N(number, print, default, next) \
|
Fix v850 bfd arch info printable names
Currently, it's not possible to manually set some of the v850 archs in
gdb:
(gdb) set architecture v850<TAB>
v850 (using old gcc ABI)
v850-rh850
v850e
v850e (using old gcc ABI)
v850e1
[...]
(gdb) set architecture v850 (using old gcc ABI)
Ambiguous item "v850 (using old gcc ABI)".
The problem is that "set architecture" is a GDB "enum command", and
GDB only considers an enum value to be the string up until the first
space. So writing "v850 (using old gcc ABI)" is the same as writing
"v850", and then that's not an unambiguous arch printable name prefix.
v850 is actually the only arch that has spaces in its printable name.
One can conveniently see that with e.g.:
(gdb) set max-completions unlimited
(gdb) complete set architecture
...
Rather than hack GDB into accepting this somehow, make v850 arch
printable names more like the printable names of the other archs, and
put the abi variant in the "machine" part, after a ':'.
We now get:
(gdb) set architecture v850<TAB>
v850:old-gcc-abi
v850:rh850
v850e
v850e1
v850e1:old-gcc-abi
v850e2
v850e2:old-gcc-abi
[...]
And now "set architecture v850:old-gcc-abi" works as expected.
I ran the binutils/gas/ld testsuites, and found no regressions. I
don't have a cross compiler handy, but I ran the gdb tests anyway,
which covers at least some snoke testing.
I think that the OUTPUT_ARCH in ld/scripttempl/v850.sc may have got
broken with the previous 2012 change, since I hacked v850_rh850.sc to
output "v850" and ld failed to grok it. I think it only works if the
old GCC ABI is the configured v850 default ABI. That's now fixed by
changing to use explicit v850:old-gcc-abi.
Also, this actually "fixes" an existing GDB test, which isn't likewise
expecting spaces in arch names, when GDB is configured for
--target=v850:
(gdb) FAIL: gdb.xml/tdesc-arch.exp: read valid architectures
bfd/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>
* cpu-v850.c (N): Append ":old-gcc-abi" instead of " (using old
gcc ABI)" to printable name.
* cpu-v850_rh850.c (bfd_v850_rh850_arch): Use "v850:rh850" instead
of "v850-rh850" as printable name.
ld/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>
* scripttempl/v850.sc: Use "v850:old-gcc-abi" as OUTPUT_ARCH.
* scripttempl/v850_rh850.sc: Use "v850:rh850" as OUTPUT_ARCH.
2016-03-09 23:43:13 +08:00
|
|
|
{ 32, 32, 8, bfd_arch_v850, number, "v850", print ":old-gcc-abi", 2, default, \
|
2012-02-01 01:54:39 +08:00
|
|
|
bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next }
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
#define NEXT NULL
|
|
|
|
|
2000-11-17 04:48:09 +08:00
|
|
|
static const bfd_arch_info_type arch_info_struct[] =
|
1999-05-03 15:29:11 +08:00
|
|
|
{
|
2013-01-24 19:14:05 +08:00
|
|
|
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]),
|
2010-07-23 22:52:54 +08:00
|
|
|
N (bfd_mach_v850e, "v850e", FALSE, NULL)
|
1999-05-03 15:29:11 +08:00
|
|
|
};
|
|
|
|
|
2001-08-13 18:06:11 +08:00
|
|
|
#undef NEXT
|
|
|
|
#define NEXT & arch_info_struct[0]
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
const bfd_arch_info_type bfd_v850_arch =
|
2002-11-30 16:39:46 +08:00
|
|
|
N (bfd_mach_v850, "v850", TRUE, NEXT);
|