]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
cris: bfd: Default selected target to the configured target
authorHans-Peter Nilsson <hp@axis.com>
Wed, 8 Oct 2025 02:58:13 +0000 (04:58 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Wed, 8 Oct 2025 03:44:48 +0000 (05:44 +0200)
commitc1a7d039587befeb01b5e13e23ef2e8ddc4df34f
tree16c7dea0a458f2f7a6a24e7a7876ca1155adb1d0
parent2f280ee0b1526050a2cd43045dd9e804c5ab03db
cris: bfd: Default selected target to the configured target

Whether targ_defvec is set to the best match for the configured target
or some of the other supported targets usually doesn't matter, as the
actual target being used, usually is set by some other mechanism, like
an input object file.

In some situations it matters though: it might be confusing to see
--help output not showing the configured target first in the list of
supported targets.  Also, some corner cases risk running into bugs like
PR33485, for cris-elf and cris-linux because cris_aout_vec is the
default target where instead the bug-free behavior of
cris_elf32_us_vec or cris_elf32_vec would be expected.

The test just verifies that the target list emitted for the --help
option has the expected target first.

bfd:

* config.bfd <cris-*-* | crisv32-*-*>: Split into <cris-*-*aout*>,
<cris-*-linux-* | crisv32-*-linux-*>, <cris-*-* | crisv32-*-*> cases
respectively setting targ_defvec per the target instead of always
cris_aout_vec.

binutils:

* testsuite/binutils-all/cris: New directory intended for
tests focused on behavior of the binutils programs, not the assembler
or linker.
* testsuite/binutils-all/cris/cris.exp: New file with run_dump_test
loop.
testsuite/binutils-all/cris/tgt-a.d,
testsuite/binutils-all/cris/tgt-e.d,
testsuite/binutils-all/cris/tgt-l.d: New tests.

Co-authored-by: Maciej W. Rozycki <macro@redhat.com>
bfd/config.bfd
binutils/testsuite/binutils-all/cris/cris.exp [new file with mode: 0644]
binutils/testsuite/binutils-all/cris/nop.s [new file with mode: 0644]
binutils/testsuite/binutils-all/cris/tgt-a.d [new file with mode: 0644]
binutils/testsuite/binutils-all/cris/tgt-e.d [new file with mode: 0644]
binutils/testsuite/binutils-all/cris/tgt-l.d [new file with mode: 0644]