From 9a0789ec7d034bb1035cf559381c624f8a50734e Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 6 Sep 2004 17:24:32 +0000 Subject: [PATCH] (elf_link_add_object_symbols): Set the error code to bfd_error_wrong_format when the input format does not match the output format. --- bfd/ChangeLog | 6 ++++++ bfd/elflink.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index dfb5c46505e..60c00692662 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2004-09-06 Nick Clifton + + * elflink.c (elf_link_add_object_symbols): Set the error code to + bfd_error_wrong_format when the input format does not match the + output format. + 2004-09-06 Alan Modra * elf64-ppc.c (is_ppc64_target): New function, extracted from.. diff --git a/bfd/elflink.c b/bfd/elflink.c index 6ccc08c751b..e82a8e318b5 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -2940,7 +2940,10 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) || !is_elf_hash_table (hash_table) || hash_table->root.creator != abfd->xvec) { - bfd_set_error (bfd_error_invalid_operation); + if (info->relocatable) + bfd_set_error (bfd_error_invalid_operation); + else + bfd_set_error (bfd_error_wrong_format); goto error_return; } }