Commit 885afe7b authored by Alan Modra's avatar Alan Modra

* as.h (as_perror): Delete declaration.

	* gdbinit.in (as_perror): Delete breakpoint.
	* messages.c (as_perror): Delete function.
	* doc/internals.texi: Remove as_perror description.
	* listing.c (listing_print: Don't use as_perror.
	* output-file.c (output_file_create, output_file_close): Likewise.
	* symbols.c (symbol_create, symbol_clone): Likewise.
	* write.c (write_contents): Likewise.
	* config/obj-som.c (obj_som_version, obj_som_copyright): Likewise.
	* config/tc-tic54x.c (tic54x_mlib): Likewise.
parent 3aeeedbb
2006-09-22 Alan Modra <amodra@bigpond.net.au>
* as.h (as_perror): Delete declaration.
* gdbinit.in (as_perror): Delete breakpoint.
* messages.c (as_perror): Delete function.
* doc/internals.texi: Remove as_perror description.
* listing.c (listing_print: Don't use as_perror.
* output-file.c (output_file_create, output_file_close): Likewise.
* symbols.c (symbol_create, symbol_clone): Likewise.
* write.c (write_contents): Likewise.
* config/obj-som.c (obj_som_version, obj_som_copyright): Likewise.
* config/tc-tic54x.c (tic54x_mlib): Likewise.
2006-09-22 Alan Modra <amodra@bigpond.net.au>
* config/tc-ppc.c (md_section_align): Don't round up address for ELF.
......
/* as.h - global header file
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
......@@ -544,7 +544,6 @@ void cond_finish_check (int);
void cond_exit_macro (int);
int seen_at_least_1_file (void);
void app_pop (char *);
void as_perror (const char *, const char *);
void as_where (char **, unsigned int *);
void bump_line_counters (void);
void do_scrub_begin (int);
......
/* SOM object file format.
Copyright 1993, 1994, 1998, 2000, 2002, 2003, 2004, 2005
Copyright 1993, 1994, 1998, 2000, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
......@@ -150,12 +150,9 @@ obj_som_version (int unused ATTRIBUTE_UNUSED)
version_seen = 1;
if (!bfd_som_attach_aux_hdr (stdoutput, VERSION_AUX_ID, version))
{
bfd_perror (stdoutput->filename);
as_perror (_("FATAL: Attaching version header %s"),
stdoutput->filename);
exit (EXIT_FAILURE);
}
as_fatal (_("attaching version header %s: %s"),
stdoutput->filename, bfd_errmsg (bfd_get_error ()));
*input_line_pointer = c;
demand_empty_rest_of_line ();
}
......@@ -195,12 +192,9 @@ obj_som_copyright (int unused ATTRIBUTE_UNUSED)
copyright_seen = 1;
if (!bfd_som_attach_aux_hdr (stdoutput, COPYRIGHT_AUX_ID, copyright))
{
bfd_perror (stdoutput->filename);
as_perror (_("FATAL: Attaching copyright header %s"),
stdoutput->filename);
exit (EXIT_FAILURE);
}
as_fatal (_("attaching copyright header %s: %s"),
stdoutput->filename, bfd_errmsg (bfd_get_error ()));
*input_line_pointer = c;
demand_empty_rest_of_line ();
}
......
......@@ -2512,8 +2512,8 @@ tic54x_mlib (ignore)
abfd = bfd_openr (path, NULL);
if (!abfd)
{
as_bad (_("Can't open macro library file '%s' for reading."), path);
as_perror ("%s", path);
as_bad (_("can't open macro library file '%s' for reading: %s"),
path, bfd_errmsg (bfd_get_error ()));
ignore_rest_of_line ();
return;
}
......
\input texinfo
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
@c 2001, 2002, 2003, 2004, 2005
@c 2001, 2002, 2003, 2004, 2005, 2006
@c Free Software Foundation, Inc.
@setfilename internals.info
@node Top
......@@ -1844,10 +1844,6 @@ Returns non-zero if any warnings or errors, respectively, have been printed
during this invocation.
@end deftypefun
@deftypefun @{@} void as_perror (const char *@var{gripe}, const char *@var{filename})
Displays a BFD or system error, then clears the error status.
@end deftypefun
@deftypefun @{@} void as_tsktsk (const char *@var{format}, ...)
@deftypefunx @{@} void as_warn (const char *@var{format}, ...)
@deftypefunx @{@} void as_bad (const char *@var{format}, ...)
......
......@@ -6,7 +6,6 @@ break as_warn_where
break as_bad
break as_bad_where
break as_fatal
break as_perror
break as_assert
break as_abort
......
/* listing.c - maintain assembly listings
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2005
2001, 2002, 2003, 2005, 2006
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
......@@ -1076,8 +1076,7 @@ listing_print (char *name)
using_stdout = 0;
else
{
bfd_set_error (bfd_error_system_call);
as_perror (_("can't open list file: %s"), name);
as_warn (_("can't open %s: %s"), name, xstrerror (errno));
list_file = stdout;
using_stdout = 1;
}
......@@ -1095,10 +1094,7 @@ listing_print (char *name)
if (! using_stdout)
{
if (fclose (list_file) == EOF)
{
bfd_set_error (bfd_error_system_call);
as_perror (_("error closing list file: %s"), name);
}
as_warn (_("can't close %s: %s"), name, xstrerror (errno));
}
if (last_open_file)
......
/* messages.c - error reporter -
Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
2003, 2004, 2005
2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
......@@ -116,24 +116,6 @@ as_show_where (void)
fprintf (stderr, "%s:%u: ", file, line);
}
/* Like perror(3), but with more info. */
void
as_perror (const char *gripe, /* Unpunctuated error theme. */
const char *filename)
{
const char *errtxt;
int saved_errno = errno;
as_show_where ();
fprintf (stderr, gripe, filename);
errno = saved_errno;
errtxt = bfd_errmsg (bfd_get_error ());
fprintf (stderr, ": %s\n", errtxt);
errno = 0;
bfd_set_error (bfd_error_no_error);
}
/* Send to stderr a string as a warning, and locate warning
in input file(s).
Please only use this for when we have some recovery action.
......
......@@ -36,11 +36,12 @@ output_file_create (char *name)
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);
bfd_error_type err = bfd_get_error ();
if (err == bfd_error_invalid_target)
as_fatal (_("selected target format '%s' unknown"), TARGET_FORMAT);
else
as_perror (_("FATAL: can't create %s"), name);
exit (EXIT_FAILURE);
as_fatal (_("can't create %s: %s"), name, bfd_errmsg (err));
}
bfd_set_format (stdoutput, bfd_object);
......@@ -53,11 +54,8 @@ void
output_file_close (char *filename)
{
/* Close the bfd. */
if (bfd_close (stdoutput) == 0)
{
bfd_perror (filename);
as_perror (_("FATAL: can't close %s\n"), filename);
exit (EXIT_FAILURE);
}
if (!bfd_close (stdoutput))
as_fatal (_("can't close %s: %s"), filename,
bfd_errmsg (bfd_get_error ()));
stdoutput = NULL; /* Trust nobody! */
}
/* symbols.c -symbol table-
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
......@@ -144,7 +144,7 @@ symbol_create (const char *name, /* It is copied, the caller can destroy/modify.
symbolP->bsym = bfd_make_empty_symbol (stdoutput);
if (symbolP->bsym == NULL)
as_perror ("%s", "bfd_make_empty_symbol");
as_fatal ("bfd_make_empty_symbol: %s", bfd_errmsg (bfd_get_error ()));
symbolP->bsym->udata.p = (PTR) symbolP;
S_SET_NAME (symbolP, preserved_copy_of_name);
......@@ -570,7 +570,7 @@ symbol_clone (symbolS *orgsymP, int replace)
*newsymP = *orgsymP;
bsymnew = bfd_make_empty_symbol (bfd_asymbol_bfd (bsymorg));
if (bsymnew == NULL)
as_perror ("%s", "bfd_make_empty_symbol");
as_fatal ("bfd_make_empty_symbol: %s", bfd_errmsg (bfd_get_error ()));
newsymP->bsym = bsymnew;
bsymnew->name = bsymorg->name;
bsymnew->flags = bsymorg->flags;
......
......@@ -1014,11 +1014,8 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
f->fr_literal, (file_ptr) offset,
(bfd_size_type) f->fr_fix);
if (!x)
{
bfd_perror (stdoutput->filename);
as_perror (_("FATAL: Can't write %s"), stdoutput->filename);
exit (EXIT_FAILURE);
}
as_fatal (_("can't write %s: %s"), stdoutput->filename,
bfd_errmsg (bfd_get_error ()));
offset += f->fr_fix;
}
fill_literal = f->fr_literal + f->fr_fix;
......@@ -1038,12 +1035,8 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
(file_ptr) offset,
(bfd_size_type) fill_size);
if (!x)
{
bfd_perror (stdoutput->filename);
as_perror (_("FATAL: Can't write %s"),
stdoutput->filename);
exit (EXIT_FAILURE);
}
as_fatal (_("can't write %s: %s"), stdoutput->filename,
bfd_errmsg (bfd_get_error ()));
offset += fill_size;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment