This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Have elf_link_add_object_symbols return bfd_error_wrong_format


Hi Guys,

  I am applying the small patch below to make
  elf_link_add_object_symbols() return the error code
  bfd_error_wrong_format instead of bfd_error_invalid_operation when
  it encounters an input file in the wrong format.

  This was causing me some headaches trying to understand why a link
  command line was not  working when all it would say was that the
  operation was invalid.

Cheers
  Nick

bfd/ChangeLog
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.

Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.99
diff -c -3 -p -r1.99 elflink.c
*** bfd/elflink.c	3 Sep 2004 17:15:34 -0000	1.99
--- bfd/elflink.c	6 Sep 2004 17:20:26 -0000
*************** elf_link_add_object_symbols (bfd *abfd, 
*** 2940,2946 ****
  	  || !is_elf_hash_table (hash_table)
  	  || hash_table->root.creator != abfd->xvec)
  	{
! 	  bfd_set_error (bfd_error_invalid_operation);
  	  goto error_return;
  	}
      }
--- 2940,2949 ----
  	  || !is_elf_hash_table (hash_table)
  	  || hash_table->root.creator != abfd->xvec)
  	{
! 	  if (info->relocatable)
! 	    bfd_set_error (bfd_error_invalid_operation);
! 	  else
! 	    bfd_set_error (bfd_error_wrong_format);
  	  goto error_return;
  	}
      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]