summaryrefslogtreecommitdiff
path: root/sim/common
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
commit40050a1a69afed2fd1a0fbeea87cd27209df7815 (patch)
tree12dbdebad660be7cc5e613ed255afc6e2932e174 /sim/common
parent4dff893de0e67aa54b47e9b781e9eef1a5a719b3 (diff)
downloadgdb-40050a1a69afed2fd1a0fbeea87cd27209df7815.tar.gz
* sim-config.c (sim_config): Recognize when a bfd has unspecified
endian information.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog3
-rw-r--r--sim/common/sim-config.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index ded6547406c..e35faf57ca6 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,8 @@
2004-11-16 Hans-Peter Nilsson <hp@axis.com>
+ * sim-config.c (sim_config): Recognize when a bfd has unspecified
+ endian information.
+
* Make-common.in (sim-load.o): Depend on $(sim_main_headers) and
$(remote_sim_h) too.
(sim_main_headers): Add sim-utils.h.
diff --git a/sim/common/sim-config.c b/sim/common/sim-config.c
index 6fe7b16429d..87a38fe7e6f 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))