aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-config.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2004-11-16 07:16:57 +0000
committerHans-Peter Nilsson <hp@axis.com>2004-11-16 07:16:57 +0000
commit1d72487d99618e5da91697cdf8058d34bbb79812 (patch)
treed75014749318ef6d65adcf9d1de5a6ff7b30efe0 /sim/common/sim-config.c
parent5eba45c188c6689bdef1edebd525829aaeab040b (diff)
downloadgdb-1d72487d99618e5da91697cdf8058d34bbb79812.zip
gdb-1d72487d99618e5da91697cdf8058d34bbb79812.tar.gz
gdb-1d72487d99618e5da91697cdf8058d34bbb79812.tar.bz2
* sim-config.c (sim_config): Recognize when a bfd has unspecified
endian information.
Diffstat (limited to 'sim/common/sim-config.c')
-rw-r--r--sim/common/sim-config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sim/common/sim-config.c b/sim/common/sim-config.c
index 6fe7b16..87a38fe 100644
--- a/sim/common/sim-config.c
+++ b/sim/common/sim-config.c
@@ -146,7 +146,11 @@ sim_config (SIM_DESC sd)
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
/* extract all relevant information */
- if (STATE_PROG_BFD (sd) == NULL)
+ if (STATE_PROG_BFD (sd) == NULL
+ /* If we have a binary input file (presumably with specified
+ "--architecture"), it'll have no endianness. */
+ || (!bfd_little_endian (STATE_PROG_BFD (sd))
+ && !bfd_big_endian (STATE_PROG_BFD (sd))))
prefered_target_byte_order = 0;
else
prefered_target_byte_order = (bfd_little_endian(STATE_PROG_BFD (sd))