This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
GAS: Catch attempts to create a file with an unknown target format.
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 06 Jul 2004 17:50:03 +0100
- Subject: GAS: Catch attempts to create a file with an unknown target format.
Hi Guys,
I am applying the small patch below to slightly modify the
output_file_create() function. The problem was that if the
TARGET_FORMAT macro selected an unsupported format the error
message produced would just say "Invalid bfd target" without
specifying what the target was.
The patch fixes this so that in the case where bfd_openw() returns
bfd_error_invalid_target the bogus target format is actually
reported.
Cheers
Nick
gas/ChangeLog
2004-07-06 Nick Clifton <nickc@redhat.com>
* output-file.c (output_file_create): Report the target format
chosen when bfd_openw reports that it is invalid.
Index: gas/output-file.c
===================================================================
RCS file: /cvs/src/src/gas/output-file.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 output-file.c
*** gas/output-file.c 19 Dec 2003 15:23:41 -0000 1.8
--- gas/output-file.c 6 Jul 2004 16:08:41 -0000
*************** output_file_create (char *name)
*** 48,54 ****
else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT)))
{
! as_perror (_("FATAL: can't create %s"), name);
exit (EXIT_FAILURE);
}
--- 48,57 ----
else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT)))
{
! if (bfd_get_error () == bfd_error_invalid_target)
! as_perror (_("Selected target format '%s' unknown"), TARGET_FORMAT);
! else
! as_perror (_("FATAL: can't create %s"), name);
exit (EXIT_FAILURE);
}