(elf_link_add_object_symbols): Set the error code to bfd_error_wrong_format when
authorNick Clifton <nickc@redhat.com>
Mon, 6 Sep 2004 17:24:32 +0000 (17:24 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 6 Sep 2004 17:24:32 +0000 (17:24 +0000)
the input format does not match the output format.

bfd/ChangeLog
bfd/elflink.c

index dfb5c46505ec237427a3de3d9f996cf0af3173ce..60c00692662d634c56f29f291670ed6a60b21c00 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-06  Nick Clifton  <nickc@redhat.com>
+
+       * 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  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (is_ppc64_target): New function, extracted from..
index 6ccc08c751bf89d321f3234b9505af3404ccf7be..e82a8e318b5fe316bd25950b11e31f642a24be2e 100644 (file)
@@ -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;
        }
     }