better error messages

Nathan Sidwell
Fri Jul 27 16:03:00 GMT 2007

I had a bogus ELF file, to which objcopy just said:
	objcopy:tmp.o: File truncated
which was somewhat uninformative.  the problem was said file had a section with 
CONTENTS that extended beyond the end of the file.  One had to look carefully to 
find that though.

This patch adds a new bfd_nonfatal_message function, which produces more 
informative messages naming the bfd and the section, where applicable.  I've 
updated the calls in objcopy to use this new function, in preference to 
bfd_nonfatal (which should be deprecated, IMHO).

Now one gets
	objcopy:tmp.o[.physMem]: File truncated
which clues you in a bit more.  I chose [] to name the section, but I'm not 
wedded to it.

tested on arm-eabi, ok?

Nathan Sidwell    ::   ::         CodeSourcery    ::

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: all.diff
URL: <>

More information about the Binutils mailing list