diff options
author | Pedro Alves <palves@redhat.com> | 2016-03-09 15:43:13 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-03-09 15:43:13 +0000 |
commit | 4b05e0a74b3fb21b56e821423b8a334e4be9cfe7 (patch) | |
tree | c0fd337ea463971c210e56b805c7efdaeafebd1a /ld | |
parent | 26c62da040fb9d602da269a3bdffdea13a4367c7 (diff) | |
download | gdb-4b05e0a74b3fb21b56e821423b8a334e4be9cfe7.zip gdb-4b05e0a74b3fb21b56e821423b8a334e4be9cfe7.tar.gz gdb-4b05e0a74b3fb21b56e821423b8a334e4be9cfe7.tar.bz2 |
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.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/scripttempl/v850.sc | 2 | ||||
-rw-r--r-- | ld/scripttempl/v850_rh850.sc | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 8776e4c..f29a3ab 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +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-08 H.J. Lu <hongjiu.lu@intel.com> PR ld/19789 diff --git a/ld/scripttempl/v850.sc b/ld/scripttempl/v850.sc index e338bf1..cf7cd20 100644 --- a/ld/scripttempl/v850.sc +++ b/ld/scripttempl/v850.sc @@ -13,7 +13,7 @@ cat << EOF OUTPUT_FORMAT("elf32-v850", "elf32-v850", "elf32-v850") -OUTPUT_ARCH(v850) +OUTPUT_ARCH(v850:old-gcc-abi) ${RELOCATING+ENTRY(_start)} SEARCH_DIR(.); EXTERN(__ctbp __ep __gp); diff --git a/ld/scripttempl/v850_rh850.sc b/ld/scripttempl/v850_rh850.sc index 06e5243..a44b9b5 100644 --- a/ld/scripttempl/v850_rh850.sc +++ b/ld/scripttempl/v850_rh850.sc @@ -13,7 +13,7 @@ cat << EOF OUTPUT_FORMAT("elf32-v850-rh850", "elf32-v850-rh850", "elf32-v850-rh850") -OUTPUT_ARCH(v850-rh850) +OUTPUT_ARCH(v850:rh850) ${RELOCATING+ENTRY(_start)} SEARCH_DIR(.); EXTERN(__ctbp __ep __gp); |