error.
(_bfd_default_error_handler): Likewise.
* elf.c (print_segment_map): Likewise.
* libbfd.c (warn_deprecated): Likewise.
* som.c (som_sizeof_headers): No need to do so here.
* coff-i860.c: Replace use of printf for error messages with
_bfd_error_handler.
* coff-ppc.c: Likewise.
* coff-sh.c: Likewise.
* elf32-bfin.c: Likewise.
* elf32-dlx.c: Likewise.
* elf32-mep.c: Likewise.
* elf32-v850.c: Likewise.
* mach-o.c: Likewise.
* pef.c: Likewise.
+2011-01-14 Alan Modra <amodra@gmail.com>
+
+ * bfd.c (bfd_perror): Flush stdout before and stderr after printing
+ error.
+ (_bfd_default_error_handler): Likewise.
+ * elf.c (print_segment_map): Likewise.
+ * libbfd.c (warn_deprecated): Likewise.
+ * som.c (som_sizeof_headers): No need to do so here.
+ * coff-i860.c: Replace use of printf for error messages with
+ _bfd_error_handler.
+ * coff-ppc.c: Likewise.
+ * coff-sh.c: Likewise.
+ * elf32-bfin.c: Likewise.
+ * elf32-dlx.c: Likewise.
+ * elf32-mep.c: Likewise.
+ * elf32-v850.c: Likewise.
+ * mach-o.c: Likewise.
+ * pef.c: Likewise.
+
2011-01-13 H.J. Lu <hongjiu.lu@intel.com>
* elf64-x86-64.c (elf_x86_64_link_hash_table): Remove
/* Generic BFD library interface and support routines.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Cygnus Support.
void
bfd_perror (const char *message)
{
+ fflush (stdout);
if (message == NULL || *message == '\0')
fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ()));
else
fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_get_error ()));
+ fflush (stderr);
}
/*
va_end (ap);
putc ('\n', stderr);
+ fflush (stderr);
}
/* This is a function pointer to the routine which should handle BFD
/* BFD back-end for Intel i860 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in coff-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995
char **error_message ATTRIBUTE_UNUSED)
{
reloc_howto_type *howto = reloc_entry->howto;
- fprintf (stderr, _("Relocation `%s' not yet implemented\n"), howto->name);
+ (*_bfd_error_handler) (_("relocation `%s' not yet implemented"), howto->name);
return bfd_reloc_notsupported;
}
/* BFD back-end for PowerPC Microsoft Portable Executable files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16;
break;
default:
- fprintf (stderr,
- _("Warning: Unsupported reloc %s [%d] used -- it may not work.\n"),
- ppc_coff_howto_table[r_type].name,
- r_type);
+ (*_bfd_error_handler) (_("warning: unsupported reloc %s [%d] used -- it may not work"),
+ ppc_coff_howto_table[r_type].name,
+ r_type);
howto = ppc_coff_howto_table + r_type;
break;
}
howto = ppc_coff_howto_table + r_type;
break;
default:
- fprintf (stderr,
- _("Warning: Unsupported reloc %s [%d] used -- it may not work.\n"),
- ppc_coff_howto_table[r_type].name,
- r_type);
+ (*_bfd_error_handler) (_("warning: unsupported reloc %s [%d] used -- it may not work"),
+ ppc_coff_howto_table[r_type].name,
+ r_type);
howto = ppc_coff_howto_table + r_type;
break;
}
/* BFD back-end for Renesas Super-H COFF binaries.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
+ Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
if (sh_reloc_map[i].bfd_reloc_val == code)
return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val];
- fprintf (stderr, "SH Error: unknown reloc type %d\n", code);
+ (*_bfd_error_handler) (_("SH Error: unknown reloc type %d"), code);
return NULL;
}
/* ELF executable support for BFD.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
(unsigned int) m->p_type);
pt = buf;
}
+ fflush (stdout);
fprintf (stderr, "%s:", pt);
for (j = 0; j < m->count; j++)
fprintf (stderr, " %s", m->sections [j]->name);
putc ('\n',stderr);
+ fflush (stderr);
}
static bfd_boolean
/* ADI Blackfin BFD support for 32-bit ELF.
- Copyright 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* if rightshift is 1 and the number odd, return error. */
if (howto->rightshift && (relocation & 0x01))
{
- fprintf(stderr, "relocation should be even number\n");
+ (*_bfd_error_handler) (_("relocation should be even number"));
return bfd_reloc_overflow;
}
/* If rightshift is 1 and the number odd, return error. */
if (howto->rightshift && (relocation & 0x01))
{
- fprintf(stderr, "relocation should be even number\n");
+ (*_bfd_error_handler) (_("relocation should be even number"));
return bfd_reloc_overflow;
}
&& (info->symbolic
|| h->dynindx == -1 || h->forced_local) && h->def_regular)
{
- fprintf(stderr, "*** check this relocation %s\n", __FUNCTION__);
+ (*_bfd_error_handler) (_("*** check this relocation %s"),
+ __FUNCTION__);
rela.r_info = ELF32_R_INFO (0, R_BFIN_PCREL24);
rela.r_addend = bfd_get_signed_32 (output_bfd,
(sgot->contents
/* DLX specific support for 32-bit ELF
- Copyright 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2011
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* Can not support a long jump to sections other then .text. */
if (strcmp (input_section->name, symbol->section->output_section->name) != 0)
{
- fprintf (stderr,
- "BFD Link Error: branch (PC rel16) to section (%s) not supported\n",
- symbol->section->output_section->name);
+ (*_bfd_error_handler) (_("BFD Link Error: branch (PC rel16) to section (%s) not supported"),
+ symbol->section->output_section->name);
return bfd_reloc_undefined;
}
/* Can not support a long jump to sections other then .text */
if (strcmp (input_section->name, symbol->section->output_section->name) != 0)
{
- fprintf (stderr,
- "BFD Link Error: jump (PC rel26) to section (%s) not supported\n",
- symbol->section->output_section->name);
+ (*_bfd_error_handler) (_("BFD Link Error: jump (PC rel26) to section (%s) not supported"),
+ symbol->section->output_section->name);
return bfd_reloc_undefined;
}
/* MeP-specific support for 32-bit ELF.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010, 2011 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
default:
/* Pacify gcc -Wall. */
- fprintf (stderr, "mep: no reloc for code %d\n", code);
+ (*_bfd_error_handler) (_("mep: no reloc for code %d"), code);
return NULL;
}
if (mep_elf_howto_table[type].type != type)
{
- fprintf (stderr, "MeP: howto %d has type %d\n", type, mep_elf_howto_table[type].type);
+ (*_bfd_error_handler) (_("MeP: howto %d has type %d"),
+ type, mep_elf_howto_table[type].type);
abort ();
}
/* V850-specific support for 32-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
}
else
{
- fprintf (stderr, _("FAILED to find previous HI16 reloc\n"));
+ (*_bfd_error_handler) (_("FAILED to find previous HI16 reloc"));
return FALSE;
}
}
/* Assorted BFD support routines, only used internally.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+ 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Cygnus Support.
if (~(size_t) func & ~mask)
{
+ fflush (stdout);
/* Note: separate sentences in order to allow
for translation into other languages. */
if (func)
what, file, line, func);
else
fprintf (stderr, _("Deprecated %s called\n"), what);
+ fflush (stderr);
mask |= ~(size_t) func;
}
}
/* Mach-O support for BFD.
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010
+ 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
if (bfd_mach_o_read_symtab_symbols (abfd) != 0)
{
- fprintf (stderr,
- "bfd_mach_o_canonicalize_symtab: unable to load symbols\n");
+ (*_bfd_error_handler) (_("bfd_mach_o_canonicalize_symtab: unable to load symbols"));
return 0;
}
case BFD_MACH_O_LC_SUB_FRAMEWORK:
break;
default:
- fprintf (stderr,
- "unable to write unknown load command 0x%lx\n",
- (unsigned long) cur->type);
+ (*_bfd_error_handler) (_("unable to write unknown load command 0x%lx"),
+ (unsigned long) cur->type);
return FALSE;
}
}
if (bfd_seek (abfd, symoff, SEEK_SET) != 0
|| bfd_bread ((void *) buf, symwidth, abfd) != symwidth)
{
- fprintf (stderr, "bfd_mach_o_read_symtab_symbol: unable to read %d bytes at %lu\n",
- symwidth, (unsigned long) symoff);
+ (*_bfd_error_handler) (_("bfd_mach_o_read_symtab_symbol: unable to read %d bytes at %lu"),
+ symwidth, (unsigned long) symoff);
return -1;
}
if (stroff >= sym->strsize)
{
- fprintf (stderr, "bfd_mach_o_read_symtab_symbol: symbol name out of range (%lu >= %lu)\n",
- (unsigned long) stroff, (unsigned long) sym->strsize);
+ (*_bfd_error_handler) (_("bfd_mach_o_read_symtab_symbol: symbol name out of range (%lu >= %lu)"),
+ (unsigned long) stroff,
+ (unsigned long) sym->strsize);
return -1;
}
/* Mach-O uses 0 to mean "no section"; not an error. */
if (section != 0)
{
- fprintf (stderr, "bfd_mach_o_read_symtab_symbol: "
- "symbol \"%s\" specified invalid section %d (max %lu): setting to undefined\n",
- s->symbol.name, section, mdata->nsects);
+ (*_bfd_error_handler) (_("bfd_mach_o_read_symtab_symbol: "
+ "symbol \"%s\" specified invalid section %d (max %lu): setting to undefined"),
+ s->symbol.name, section, mdata->nsects);
}
s->symbol.section = bfd_und_section_ptr;
}
break;
case BFD_MACH_O_N_INDR:
- fprintf (stderr, "bfd_mach_o_read_symtab_symbol: "
- "symbol \"%s\" is unsupported 'indirect' reference: setting to undefined\n",
- s->symbol.name);
+ (*_bfd_error_handler) (_("bfd_mach_o_read_symtab_symbol: "
+ "symbol \"%s\" is unsupported 'indirect' reference: setting to undefined"),
+ s->symbol.name);
s->symbol.section = bfd_und_section_ptr;
break;
default:
- fprintf (stderr, "bfd_mach_o_read_symtab_symbol: "
- "symbol \"%s\" specified invalid type field 0x%x: setting to undefined\n",
- s->symbol.name, symtype);
+ (*_bfd_error_handler) (_("bfd_mach_o_read_symtab_symbol: "
+ "symbol \"%s\" specified invalid type field 0x%x: setting to undefined"),
+ s->symbol.name, symtype);
s->symbol.section = bfd_und_section_ptr;
break;
}
if (sym->symbols == NULL)
{
- fprintf (stderr, "bfd_mach_o_read_symtab_symbols: unable to allocate memory for symbols\n");
+ (*_bfd_error_handler) (_("bfd_mach_o_read_symtab_symbols: unable to allocate memory for symbols"));
return -1;
}
if (bfd_seek (abfd, isymoff, SEEK_SET) != 0
|| bfd_bread ((void *) buf, 4, abfd) != 4)
{
- fprintf (stderr, "bfd_mach_o_read_dysymtab_symbol: unable to read %lu bytes at %lu\n",
- (unsigned long) 4, isymoff);
+ (*_bfd_error_handler) (_("bfd_mach_o_read_dysymtab_symbol: unable to read %lu bytes at %lu"),
+ (unsigned long) 4, isymoff);
return -1;
}
sym_index = bfd_h_get_32 (abfd, buf);
return -1;
break;
default:
- fprintf (stderr, "unable to read unknown load command 0x%lx\n",
- (unsigned long) command->type);
+ (*_bfd_error_handler) (_("unable to read unknown load command 0x%lx"),
+ (unsigned long) command->type);
break;
}
&cputype, &cpusubtype);
if (cputype == bfd_arch_unknown)
{
- fprintf (stderr, "bfd_mach_o_scan: unknown architecture 0x%lx/0x%lx\n",
- header->cputype, header->cpusubtype);
+ (*_bfd_error_handler) (_("bfd_mach_o_scan: unknown architecture 0x%lx/0x%lx"),
+ header->cputype, header->cpusubtype);
return -1;
}
if (! (header.byteorder == BFD_ENDIAN_BIG
|| header.byteorder == BFD_ENDIAN_LITTLE))
{
- fprintf (stderr, "unknown header byte-order value 0x%lx\n",
- (unsigned long) header.byteorder);
+ (*_bfd_error_handler) (_("unknown header byte-order value 0x%lx"),
+ (unsigned long) header.byteorder);
goto wrong;
}
/* PEF support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2011 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
bfd_pef_convert_architecture (header->architecture, &cputype, &cpusubtype);
if (cputype == bfd_arch_unknown)
{
- fprintf (stderr, "bfd_pef_scan: unknown architecture 0x%lx\n",
- header->architecture);
+ (*_bfd_error_handler) (_("bfd_pef_scan: unknown architecture 0x%lx"),
+ header->architecture);
return -1;
}
bfd_set_arch_mach (abfd, cputype, cpusubtype);
/* bfd back-end for HP PA-RISC SOM objects.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
(*_bfd_error_handler) (_("som_sizeof_headers unimplemented"));
- fflush (stderr);
abort ();
return 0;
}