better error messages

Nathan Sidwell nathan@codesourcery.com
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
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: all.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20070727/3d40da05/attachment.ksh>


More information about the Binutils mailing list