aboutsummaryrefslogtreecommitdiff
path: root/bfd/libbfd.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-05-22 18:44:02 +0000
committerNick Clifton <nickc@redhat.com>2000-05-22 18:44:02 +0000
commit1fe494a57221726e49417427cbb2cde8516d9a6f (patch)
treeacf2cbc468dc985ce4ca78f0fc38b94dd58f40c9 /bfd/libbfd.c
parent0ab71ce35ae2c5ef6dfa88af81d5b45b00ec6c7a (diff)
downloadgdb-1fe494a57221726e49417427cbb2cde8516d9a6f.zip
gdb-1fe494a57221726e49417427cbb2cde8516d9a6f.tar.gz
gdb-1fe494a57221726e49417427cbb2cde8516d9a6f.tar.bz2
Use bfd_generic_verify_endian_match() and fix it to only check when endianness
is known.
Diffstat (limited to 'bfd/libbfd.c')
-rw-r--r--bfd/libbfd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index 881af73..1bc0f33 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -1306,13 +1306,17 @@ _bfd_generic_verify_endian_match (ibfd, obfd)
bfd *obfd;
{
if (ibfd->xvec->byteorder != obfd->xvec->byteorder
+ && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
&& obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
{
- (*_bfd_error_handler)
- ("%s: compiled for a %s endian system and target is %s endian",
- bfd_get_filename (ibfd),
- bfd_big_endian (ibfd) ? "big" : "little",
- bfd_big_endian (obfd) ? "big" : "little");
+ const char *msg;
+
+ if (bfd_big_endian (ibfd))
+ msg = _("%s: compiled for a big endian system and target is little endian");
+ else
+ msg = _("%s: compiled for a little endian system and target is big endian");
+
+ (*_bfd_error_handler) (msg, bfd_get_filename (ibfd));
bfd_set_error (bfd_error_wrong_format);
return false;