* bfd.c (_bfd_default_error_handler): Handle %A and %B.
	(bfd_archive_filename, bfd_get_section_ident): Delete.
	* ecofflink.c (bfd_ecoff_debug_accumulate_other): Don't call
	bfd_archive_filename.
	* elflink.c (elf_link_input_bfd): Don't use callbacks->error_handler
	to warn about symbols in discarded sections.  Use _bfd_error_handler.
	* aout-adobe.c (aout_adobe_callback): See below.
	* aout-cris.c (swap_ext_reloc_in): ..
	* coff-arm.c (find_thumb_glue, find_arm_glue,
	coff_arm_relocate_section, bfd_arm_process_before_allocation,
	coff_arm_merge_private_bfd_data, _bfd_coff_arm_set_private_flags,
	coff_arm_copy_private_bfd_data): ..
	* coff-i860.c (i860_reloc_processing): ..
	* coff-mcore.c (mcore_coff_unsupported_reloc,
	coff_mcore_relocate_section): ..
	* coff-ppc.c (coff_ppc_relocate_section): ..
	* coff-rs6000.c (xcoff_create_csect_from_smclas
	* coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
	sh_swap_insns, sh_relocate_section): ..
	* coff-tic54x.c (tic54x_reloc_processing): ..
	* coff-tic80.c (coff_tic80_relocate_section): ..
	* coff64-rs6000.c (xcoff64_create_csect_from_smclas): ..
	* coffcode.h (styp_to_sec_flags, coff_slurp_line_table,
	coff_slurp_symbol_table, coff_classify_symbol,
	coff_slurp_reloc_table): ..
	* coffgen.c (_bfd_coff_read_string_table): ..
	* cofflink.c (coff_link_add_symbols, _bfd_coff_link_input_bfd,
	_bfd_coff_generic_relocate_section): ..
	* cpu-arm.c (bfd_arm_merge_machines): ..
	* cpu-sh.c (sh_merge_bfd_arch): ..
	* elf-hppa.h (elf_hppa_relocate_section): ..
	* elf.c (bfd_elf_string_from_elf_section, setup_group,
	_bfd_elf_setup_group_pointers, bfd_section_from_shdr,
	assign_section_numbers, _bfd_elf_symbol_from_bfd_symbol,
	copy_private_bfd_data, _bfd_elf_validate_reloc): ..
	* elf32-arm.h (find_thumb_glue, find_arm_glue,
	bfd_elf32_arm_process_before_allocation, elf32_thumb_to_arm_stub,
	elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate,
	elf32_arm_relocate_section, elf32_arm_set_private_flags,
	elf32_arm_copy_private_bfd_data, elf32_arm_merge_private_bfd_data): ..
	* elf32-cris.c (cris_elf_relocate_section, cris_elf_check_relocs,
	cris_elf_merge_private_bfd_data
	* elf32-frv.c (elf32_frv_relocate_section, elf32_frv_check_relocs): ..
	* elf32-gen.c (elf32_generic_link_add_symbols): ..
	* elf32-hppa.c (hppa_add_stub, hppa_build_one_stub,
	elf32_hppa_check_relocs, get_local_syms, final_link_relocate,
	elf32_hppa_relocate_section): ..
	* elf32-i370.c (i370_elf_merge_private_bfd_data,
	i370_elf_check_relocs, i370_elf_relocate_section): ..
	* elf32-i386.c (elf_i386_info_to_howto_rel, elf_i386_check_relocs,
	elf_i386_relocate_section): ..
	* elf32-m32r.c (m32r_elf_relocate_section,
	m32r_elf_merge_private_bfd_data): ..
	* elf32-m68hc1x.c (m68hc12_add_stub,
	_bfd_m68hc11_elf_merge_private_bfd_data): ..
	* elf32-m68k.c (elf_m68k_relocate_section): ..
	* elf32-mcore.c (mcore_elf_unsupported_reloc,
	mcore_elf_relocate_section): ..
	* elf32-ppc.c (ppc_elf_merge_private_bfd_data, bad_shared_reloc,
	ppc_elf_check_relocs, ppc_elf_relocate_section,
	ppc_elf_begin_write_processing): ..
	* elf32-s390.c (elf_s390_check_relocs, invalid_tls_insn,
	elf_s390_relocate_section): ..
	* elf32-sh-symbian.c (sh_symbian_import_as,
	sh_symbian_process_embedded_commands,
	sh_symbian_relocate_section): ..
	* elf32-sh.c (sh_elf_relax_section, sh_elf_relax_delete_bytes,
	sh_elf_swap_insns, sh_elf_relocate_section, sh_elf_check_relocs,
	sh_elf_merge_private_data): ..
	* elf32-sparc.c (elf32_sparc_check_relocs,
	elf32_sparc_relocate_section,
	elf32_sparc_merge_private_bfd_data): ..
	* elf32-v850.c (v850_elf_check_relocs,
	v850_elf_merge_private_bfd_data): ..
	* elf32-xtensa.c (elf_xtensa_check_relocs,
	elf_xtensa_relocate_section, elf_xtensa_merge_private_bfd_data): ..
	* elf64-alpha.c (elf64_alpha_relax_with_lituse,
	elf64_alpha_relax_got_load, elf64_alpha_size_got_sections,
	elf64_alpha_relocate_section_r, elf64_alpha_relocate_section): ..
	* elf64-gen.c (elf64_generic_link_add_symbols): ..
	* elf64-ppc.c (ppc64_elf_merge_private_bfd_data, ppc_add_stub,
	ppc64_elf_check_relocs, ppc64_elf_edit_opd,
	ppc64_elf_relocate_section): ..
	* elf64-s390.c (elf_s390_check_relocs, invalid_tls_insn,
	elf_s390_relocate_section): ..
	* elf64-sh64.c (sh_elf64_relocate_section): ..
	* elf64-sparc.c (sparc64_elf_check_relocs,
	sparc64_elf_add_symbol_hook, sparc64_elf_relocate_section,
	sparc64_elf_merge_private_bfd_data): ..
	* elf64-x86-64.c (elf64_x86_64_check_relocs,
	elf64_x86_64_relocate_section): ..
	* elflink.c (_bfd_elf_add_default_symbol,
	_bfd_elf_link_assign_sym_version, elf_link_read_relocs_from_section,
	_bfd_elf_link_output_relocs, elf_link_add_object_symbols,
	bfd_elf_size_dynamic_sections, elf_link_output_extsym,
	elf_get_linked_section_vma, elf_fixup_link_order,
	bfd_elf_final_link, bfd_elf_gc_record_vtinherit,
	bfd_elf_gc_record_vtinherit, _bfd_elf_section_already_linked): ..
	* elfxx-ia64.c (elfNN_ia64_relax_section,
	elfNN_ia64_relocate_section, elfNN_ia64_merge_private_bfd_data): ..
	* elfxx-mips.c (mips_elf_perform_relocation,
	_bfd_mips_elf_check_relocs,
	_bfd_mips_elf_merge_private_bfd_data): ..
	* ieee.c (ieee_slurp_external_symbols): ..
	* ihex.c (ihex_bad_byte, ihex_scan, ihex_read_section): ..
	* libbfd.c (_bfd_generic_verify_endian_match): ..
	* linker.c (_bfd_generic_link_add_one_symbol,
	_bfd_generic_section_already_linked): ..
	* pdp11.c (translate_to_native_sym_flags): ..
	* pe-mips.c (coff_pe_mips_relocate_section): ..
	* peicode.h (pe_ILF_build_a_bfd): ..
	* srec.c (srec_bad_byte): ..
	* stabs.c (_bfd_link_section_stabs): ..
	* xcofflink.c (xcoff_link_add_symbols, xcoff_link_input_bfd): ..
	Replace all uses of bfd_archive_filename and bfd_get_section_ident
	with corresponding %B and %A in _bfd_error_handler format string.
	Replace occurrences of "fprintf (stderr," with _bfd_error_handler
	calls to use %A and %B.  Fix "against symbol .. from section" and
	similar error messages.  Combine multiple _bfd_error_handler calls
	where they were separated due to bfd_archive_filename deficiencies.
	* bfd-in2.h: Regenerate.
include/
	* bfdlink.h (struct bfd_link_callbacks): Remove "error_handler".
	(LD_DEFINITION_IN_DISCARDED_SECTION): Delete.
ld/
	* ldmain.c (link_callbacks): Remove "error_handler".
	* ldmisc.c: Include elf-bfd.h.
	(vfinfo): Sort comment.  Handle %A.  Use %A instead of
	bfd_get_section_indent.
	(error_handler): Delete.
	* ldmisc.h (error_handler): Delete declaration.
This commit is contained in:
Alan Modra 2004-08-13 03:16:01 +00:00
parent 1bd654d82c
commit d003868ea7
66 changed files with 1113 additions and 1170 deletions

View file

@ -1,3 +1,127 @@
2004-08-13 Alan Modra <amodra@bigpond.net.au>
* bfd.c (_bfd_default_error_handler): Handle %A and %B.
(bfd_archive_filename, bfd_get_section_ident): Delete.
* ecofflink.c (bfd_ecoff_debug_accumulate_other): Don't call
bfd_archive_filename.
* elflink.c (elf_link_input_bfd): Don't use callbacks->error_handler
to warn about symbols in discarded sections. Use _bfd_error_handler.
* aout-adobe.c (aout_adobe_callback): See below.
* aout-cris.c (swap_ext_reloc_in): ..
* coff-arm.c (find_thumb_glue, find_arm_glue,
coff_arm_relocate_section, bfd_arm_process_before_allocation,
coff_arm_merge_private_bfd_data, _bfd_coff_arm_set_private_flags,
coff_arm_copy_private_bfd_data): ..
* coff-i860.c (i860_reloc_processing): ..
* coff-mcore.c (mcore_coff_unsupported_reloc,
coff_mcore_relocate_section): ..
* coff-ppc.c (coff_ppc_relocate_section): ..
* coff-rs6000.c (xcoff_create_csect_from_smclas
* coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
sh_swap_insns, sh_relocate_section): ..
* coff-tic54x.c (tic54x_reloc_processing): ..
* coff-tic80.c (coff_tic80_relocate_section): ..
* coff64-rs6000.c (xcoff64_create_csect_from_smclas): ..
* coffcode.h (styp_to_sec_flags, coff_slurp_line_table,
coff_slurp_symbol_table, coff_classify_symbol,
coff_slurp_reloc_table): ..
* coffgen.c (_bfd_coff_read_string_table): ..
* cofflink.c (coff_link_add_symbols, _bfd_coff_link_input_bfd,
_bfd_coff_generic_relocate_section): ..
* cpu-arm.c (bfd_arm_merge_machines): ..
* cpu-sh.c (sh_merge_bfd_arch): ..
* elf-hppa.h (elf_hppa_relocate_section): ..
* elf.c (bfd_elf_string_from_elf_section, setup_group,
_bfd_elf_setup_group_pointers, bfd_section_from_shdr,
assign_section_numbers, _bfd_elf_symbol_from_bfd_symbol,
copy_private_bfd_data, _bfd_elf_validate_reloc): ..
* elf32-arm.h (find_thumb_glue, find_arm_glue,
bfd_elf32_arm_process_before_allocation, elf32_thumb_to_arm_stub,
elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate,
elf32_arm_relocate_section, elf32_arm_set_private_flags,
elf32_arm_copy_private_bfd_data, elf32_arm_merge_private_bfd_data): ..
* elf32-cris.c (cris_elf_relocate_section, cris_elf_check_relocs,
cris_elf_merge_private_bfd_data
* elf32-frv.c (elf32_frv_relocate_section, elf32_frv_check_relocs): ..
* elf32-gen.c (elf32_generic_link_add_symbols): ..
* elf32-hppa.c (hppa_add_stub, hppa_build_one_stub,
elf32_hppa_check_relocs, get_local_syms, final_link_relocate,
elf32_hppa_relocate_section): ..
* elf32-i370.c (i370_elf_merge_private_bfd_data,
i370_elf_check_relocs, i370_elf_relocate_section): ..
* elf32-i386.c (elf_i386_info_to_howto_rel, elf_i386_check_relocs,
elf_i386_relocate_section): ..
* elf32-m32r.c (m32r_elf_relocate_section,
m32r_elf_merge_private_bfd_data): ..
* elf32-m68hc1x.c (m68hc12_add_stub,
_bfd_m68hc11_elf_merge_private_bfd_data): ..
* elf32-m68k.c (elf_m68k_relocate_section): ..
* elf32-mcore.c (mcore_elf_unsupported_reloc,
mcore_elf_relocate_section): ..
* elf32-ppc.c (ppc_elf_merge_private_bfd_data, bad_shared_reloc,
ppc_elf_check_relocs, ppc_elf_relocate_section,
ppc_elf_begin_write_processing): ..
* elf32-s390.c (elf_s390_check_relocs, invalid_tls_insn,
elf_s390_relocate_section): ..
* elf32-sh-symbian.c (sh_symbian_import_as,
sh_symbian_process_embedded_commands,
sh_symbian_relocate_section): ..
* elf32-sh.c (sh_elf_relax_section, sh_elf_relax_delete_bytes,
sh_elf_swap_insns, sh_elf_relocate_section, sh_elf_check_relocs,
sh_elf_merge_private_data): ..
* elf32-sparc.c (elf32_sparc_check_relocs,
elf32_sparc_relocate_section,
elf32_sparc_merge_private_bfd_data): ..
* elf32-v850.c (v850_elf_check_relocs,
v850_elf_merge_private_bfd_data): ..
* elf32-xtensa.c (elf_xtensa_check_relocs,
elf_xtensa_relocate_section, elf_xtensa_merge_private_bfd_data): ..
* elf64-alpha.c (elf64_alpha_relax_with_lituse,
elf64_alpha_relax_got_load, elf64_alpha_size_got_sections,
elf64_alpha_relocate_section_r, elf64_alpha_relocate_section): ..
* elf64-gen.c (elf64_generic_link_add_symbols): ..
* elf64-ppc.c (ppc64_elf_merge_private_bfd_data, ppc_add_stub,
ppc64_elf_check_relocs, ppc64_elf_edit_opd,
ppc64_elf_relocate_section): ..
* elf64-s390.c (elf_s390_check_relocs, invalid_tls_insn,
elf_s390_relocate_section): ..
* elf64-sh64.c (sh_elf64_relocate_section): ..
* elf64-sparc.c (sparc64_elf_check_relocs,
sparc64_elf_add_symbol_hook, sparc64_elf_relocate_section,
sparc64_elf_merge_private_bfd_data): ..
* elf64-x86-64.c (elf64_x86_64_check_relocs,
elf64_x86_64_relocate_section): ..
* elflink.c (_bfd_elf_add_default_symbol,
_bfd_elf_link_assign_sym_version, elf_link_read_relocs_from_section,
_bfd_elf_link_output_relocs, elf_link_add_object_symbols,
bfd_elf_size_dynamic_sections, elf_link_output_extsym,
elf_get_linked_section_vma, elf_fixup_link_order,
bfd_elf_final_link, bfd_elf_gc_record_vtinherit,
bfd_elf_gc_record_vtinherit, _bfd_elf_section_already_linked): ..
* elfxx-ia64.c (elfNN_ia64_relax_section,
elfNN_ia64_relocate_section, elfNN_ia64_merge_private_bfd_data): ..
* elfxx-mips.c (mips_elf_perform_relocation,
_bfd_mips_elf_check_relocs,
_bfd_mips_elf_merge_private_bfd_data): ..
* ieee.c (ieee_slurp_external_symbols): ..
* ihex.c (ihex_bad_byte, ihex_scan, ihex_read_section): ..
* libbfd.c (_bfd_generic_verify_endian_match): ..
* linker.c (_bfd_generic_link_add_one_symbol,
_bfd_generic_section_already_linked): ..
* pdp11.c (translate_to_native_sym_flags): ..
* pe-mips.c (coff_pe_mips_relocate_section): ..
* peicode.h (pe_ILF_build_a_bfd): ..
* srec.c (srec_bad_byte): ..
* stabs.c (_bfd_link_section_stabs): ..
* xcofflink.c (xcoff_link_add_symbols, xcoff_link_input_bfd): ..
Replace all uses of bfd_archive_filename and bfd_get_section_ident
with corresponding %B and %A in _bfd_error_handler format string.
Replace occurrences of "fprintf (stderr," with _bfd_error_handler
calls to use %A and %B. Fix "against symbol .. from section" and
similar error messages. Combine multiple _bfd_error_handler calls
where they were separated due to bfd_archive_filename deficiencies.
* bfd-in2.h: Regenerate.
2004-08-12 H.J. Lu <hongjiu.lu@intel.com> 2004-08-12 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_relocate_section): Report unrecognized * elf32-i386.c (elf_i386_relocate_section): Report unrecognized

View file

@ -201,8 +201,8 @@ aout_adobe_callback (abfd)
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Unknown section type in a.out.adobe file: %x\n"), (_("%B: Unknown section type in a.out.adobe file: %x\n"),
bfd_archive_filename (abfd), ext->e_type[0]); abfd, ext->e_type[0]);
goto no_more_sections; goto no_more_sections;
} }

View file

@ -1,5 +1,5 @@
/* BFD backend for CRIS a.out binaries. /* BFD backend for CRIS a.out binaries.
Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Axis Communications AB. Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson. Written by Hans-Peter Nilsson.
@ -248,10 +248,10 @@ MY(swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
if (r_type > 2) if (r_type > 2)
{ {
(*_bfd_error_handler) (_("%s: Invalid relocation type imported: %d"), (*_bfd_error_handler) (_("%B: Invalid relocation type imported: %d"),
bfd_archive_filename (abfd), r_type); abfd, r_type);
bfd_set_error(bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
} }
cache_ptr->howto = howto_table_ext + r_type; cache_ptr->howto = howto_table_ext + r_type;
@ -259,8 +259,7 @@ MY(swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
if (r_extern && r_index > symcount) if (r_extern && r_index > symcount)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Bad relocation record imported: %d"), (_("%B: Bad relocation record imported: %d"), abfd, r_index);
bfd_archive_filename (abfd), r_index);
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);

View file

@ -2639,7 +2639,7 @@ field in the instruction. */
BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTOFF,
BFD_RELOC_ARM_GOTPC, BFD_RELOC_ARM_GOTPC,
/* PC-relative or absolute relocation depending on target. Used for /* Pc-relative or absolute relocation depending on target. Used for
entries in .init_array sections. */ entries in .init_array sections. */
BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_RELABS32,
@ -4001,8 +4001,6 @@ void bfd_set_error_program_name (const char *);
bfd_error_handler_type bfd_get_error_handler (void); bfd_error_handler_type bfd_get_error_handler (void);
const char *bfd_archive_filename (bfd *);
long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
long bfd_canonicalize_reloc long bfd_canonicalize_reloc
@ -4144,8 +4142,6 @@ void bfd_preserve_restore (bfd *, struct bfd_preserve *);
void bfd_preserve_finish (bfd *, struct bfd_preserve *); void bfd_preserve_finish (bfd *, struct bfd_preserve *);
char *bfd_get_section_ident (asection *sec);
/* Extracted from archive.c. */ /* Extracted from archive.c. */
symindex bfd_get_next_mapent symindex bfd_get_next_mapent
(bfd *abfd, symindex previous, carsym **sym); (bfd *abfd, symindex previous, carsym **sym);

234
bfd/bfd.c
View file

@ -406,23 +406,150 @@ CODE_FRAGMENT
static const char *_bfd_error_program_name; static const char *_bfd_error_program_name;
/* This is the default routine to handle BFD error messages. */ /* This is the default routine to handle BFD error messages.
Like fprintf (stderr, ...), but also handles some extra format specifiers.
%A section name from section. For group components, print group name too.
%B file name from bfd. For archive components, prints archive too.
*/
void void
_bfd_default_error_handler (const char *s, ...) _bfd_default_error_handler (const char *fmt, ...)
{ {
va_list p; va_list ap;
char *bufp;
const char *new_fmt, *p;
size_t avail = 1000;
char buf[1000];
if (_bfd_error_program_name != NULL) if (_bfd_error_program_name != NULL)
fprintf (stderr, "%s: ", _bfd_error_program_name); fprintf (stderr, "%s: ", _bfd_error_program_name);
else else
fprintf (stderr, "BFD: "); fprintf (stderr, "BFD: ");
va_start (p, s); va_start (ap, fmt);
vfprintf (stderr, s, p); new_fmt = fmt;
va_end (p); bufp = buf;
fprintf (stderr, "\n"); /* Reserve enough space for the existing format string. */
avail -= strlen (fmt) + 1;
if (avail > 1000)
abort ();
p = fmt;
while (*p != '\0')
{
char *q;
size_t len, extra, trim;
p = strchr (p, '%');
if (p == NULL || p[1] == '\0')
{
if (new_fmt == buf)
{
len = strlen (fmt);
memcpy (bufp, fmt, len + 1);
}
break;
}
if (p[1] == 'A' || p[1] == 'B')
{
len = p - fmt;
memcpy (bufp, fmt, len);
bufp += len;
fmt = p + 2;
new_fmt = buf;
/* If we run out of space, tough, you lose your ridiculously
long file or section name. It's not safe to try to alloc
memory here; We might be printing an out of memory message. */
if (avail == 0)
{
*bufp++ = '*';
*bufp++ = '*';
*bufp = '\0';
}
else
{
if (p[1] == 'B')
{
bfd *abfd = va_arg (ap, bfd *);
if (abfd->my_archive)
snprintf (bufp, avail, "%s(%s)",
abfd->my_archive->filename, abfd->filename);
else
snprintf (bufp, avail, "%s", abfd->filename);
}
else
{
asection *sec = va_arg (ap, asection *);
bfd *abfd = sec->owner;
const char *group = NULL;
struct coff_comdat_info *ci;
if (abfd != NULL
&& bfd_get_flavour (abfd) == bfd_target_elf_flavour
&& elf_next_in_group (sec) != NULL
&& (sec->flags & SEC_GROUP) == 0)
group = elf_group_name (sec);
else if (abfd != NULL
&& bfd_get_flavour (abfd) == bfd_target_coff_flavour
&& (ci = bfd_coff_get_comdat_section (sec->owner,
sec)) != NULL)
group = ci->name;
if (group != NULL)
snprintf (bufp, avail, "%s[%s]", sec->name, group);
else
snprintf (bufp, avail, "%s", sec->name);
}
len = strlen (bufp);
avail = avail - len + 2;
/* We need to replace any '%' we printed by "%%".
First count how many. */
q = bufp;
bufp += len;
extra = 0;
while ((q = strchr (q, '%')) != NULL)
{
++q;
++extra;
}
/* If there isn't room, trim off the end of the string. */
q = bufp;
bufp += extra;
if (extra > avail)
{
trim = extra - avail;
bufp -= trim;
do
{
if (*--q == '%')
--extra;
}
while (--trim != 0);
*q = '\0';
}
/* Now double all '%' chars, shuffling the string as we go. */
while (extra != 0)
{
while ((q[extra] = *q) != '%')
--q;
q[--extra] = '%';
--q;
}
}
}
p = p + 2;
}
vfprintf (stderr, new_fmt, ap);
va_end (ap);
putc ('\n', stderr);
} }
/* This is a function pointer to the routine which should handle BFD /* This is a function pointer to the routine which should handle BFD
@ -491,56 +618,6 @@ bfd_get_error_handler (void)
{ {
return _bfd_error_handler; return _bfd_error_handler;
} }
/*
FUNCTION
bfd_archive_filename
SYNOPSIS
const char *bfd_archive_filename (bfd *);
DESCRIPTION
For a BFD that is a component of an archive, returns a string
with both the archive name and file name. For other BFDs, just
returns the file name.
*/
const char *
bfd_archive_filename (bfd *abfd)
{
if (abfd == NULL)
return NULL;
if (abfd->my_archive)
{
static size_t curr = 0;
static char *buf;
size_t needed;
needed = (strlen (bfd_get_filename (abfd->my_archive))
+ strlen (bfd_get_filename (abfd)) + 3);
if (needed > curr)
{
if (curr)
free (buf);
curr = needed + (needed >> 1);
buf = bfd_malloc (curr);
/* If we can't malloc, fail safe by returning just the file
name. This function is only used when building error
messages. */
if (!buf)
{
curr = 0;
return bfd_get_filename (abfd);
}
}
sprintf (buf, "%s(%s)", bfd_get_filename (abfd->my_archive),
bfd_get_filename (abfd));
return buf;
}
else
return bfd_get_filename (abfd);
}
/* /*
SECTION SECTION
@ -1417,46 +1494,3 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve)
objalloc. */ objalloc. */
bfd_hash_table_free (&preserve->section_htab); bfd_hash_table_free (&preserve->section_htab);
} }
/*
FUNCTION
bfd_get_section_ident
SYNOPSIS
char *bfd_get_section_ident (asection *sec);
DESCRIPTION
This function returns "section name[group name]" in a malloced
buffer if @var{sec} is a member of an ELF section group and
returns NULL otherwise. The caller should free the non-NULL
return after use.
*/
char *
bfd_get_section_ident (asection *sec)
{
char *buf;
bfd_size_type nlen;
bfd_size_type glen;
if (sec->owner == NULL
|| bfd_get_flavour (sec->owner) != bfd_target_elf_flavour
|| elf_next_in_group (sec) == NULL
|| (sec->flags & SEC_GROUP) != 0)
return NULL;
nlen = strlen (sec->name);
glen = strlen (elf_group_name (sec));
buf = bfd_malloc (nlen + glen + 2 + 1);
if (buf != NULL)
{
strcpy (buf, sec->name);
buf [nlen] = '[';
strcpy (&buf [nlen + 1], elf_group_name (sec));
buf [nlen + 1 + glen] = ']';
buf [nlen + 1 + glen + 1] = '\0';
}
return buf;
}

View file

@ -1063,8 +1063,8 @@ find_thumb_glue (info, name, input_bfd)
if (myh == NULL) if (myh == NULL)
/* xgettext:c-format */ /* xgettext:c-format */
_bfd_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"), _bfd_error_handler (_("%B: unable to find THUMB glue '%s' for `%s'"),
bfd_archive_filename (input_bfd), tmp_name, name); input_bfd, tmp_name, name);
free (tmp_name); free (tmp_name);
@ -1093,8 +1093,8 @@ find_arm_glue (info, name, input_bfd)
if (myh == NULL) if (myh == NULL)
/* xgettext:c-format */ /* xgettext:c-format */
_bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"), _bfd_error_handler (_("%B: unable to find ARM glue '%s' for `%s'"),
bfd_archive_filename (input_bfd), tmp_name, name); input_bfd, tmp_name, name);
free (tmp_name); free (tmp_name);
@ -1395,16 +1395,11 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
if (h_sec->owner != NULL if (h_sec->owner != NULL
&& INTERWORK_SET (h_sec->owner) && INTERWORK_SET (h_sec->owner)
&& ! INTERWORK_FLAG (h_sec->owner)) && ! INTERWORK_FLAG (h_sec->owner))
{
_bfd_error_handler _bfd_error_handler
/* xgettext:c-format */ /* xgettext:c-format */
(_("%s(%s): warning: interworking not enabled."), (_("%B(%s): warning: interworking not enabled.\n"
bfd_archive_filename (h_sec->owner), name); " first occurrence: %B: arm call to thumb"),
_bfd_error_handler h_sec->owner, input_bfd, name);
/* xgettext:c-format */
(_(" first occurrence: %s: arm call to thumb"),
bfd_archive_filename (input_bfd));
}
--my_offset; --my_offset;
myh->root.u.def.value = my_offset; myh->root.u.def.value = my_offset;
@ -1490,18 +1485,12 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
&& INTERWORK_SET (h_sec->owner) && INTERWORK_SET (h_sec->owner)
&& ! INTERWORK_FLAG (h_sec->owner) && ! INTERWORK_FLAG (h_sec->owner)
&& ! globals->support_old_code) && ! globals->support_old_code)
{
_bfd_error_handler _bfd_error_handler
/* xgettext:c-format */ /* xgettext:c-format */
(_("%s(%s): warning: interworking not enabled."), (_("%B(%s): warning: interworking not enabled.\n"
bfd_archive_filename (h_sec->owner), name); " first occurrence: %B: thumb call to arm\n"
_bfd_error_handler " consider relinking with --support-old-code enabled"),
/* xgettext:c-format */ h_sec->owner, input_bfd, name);
(_(" first occurrence: %s: thumb call to arm"),
bfd_archive_filename (input_bfd));
_bfd_error_handler
(_(" consider relinking with --support-old-code enabled"));
}
-- my_offset; -- my_offset;
myh->root.u.def.value = my_offset; myh->root.u.def.value = my_offset;
@ -1795,10 +1784,8 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad reloc address 0x%lx in section `%s'"), (_("%B: bad reloc address 0x%lx in section `%A'"),
bfd_archive_filename (input_bfd), input_bfd, input_section, (unsigned long) rel->r_vaddr);
(unsigned long) rel->r_vaddr,
bfd_get_section_name (input_bfd, input_section));
return FALSE; return FALSE;
case bfd_reloc_overflow: case bfd_reloc_overflow:
{ {
@ -2139,8 +2126,8 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code)
/* If the index is outside of the range of our table, something has gone wrong. */ /* If the index is outside of the range of our table, something has gone wrong. */
if (symndx >= obj_conv_table_size (abfd)) if (symndx >= obj_conv_table_size (abfd))
{ {
_bfd_error_handler (_("%s: illegal symbol index in reloc: %d"), _bfd_error_handler (_("%B: illegal symbol index in reloc: %d"),
bfd_archive_filename (abfd), symndx); abfd, symndx);
continue; continue;
} }
@ -2272,9 +2259,10 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
{ {
_bfd_error_handler _bfd_error_handler
/* xgettext: c-format */ /* xgettext: c-format */
(_("ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d"), (_("ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"),
bfd_archive_filename (ibfd), APCS_26_FLAG (ibfd) ? 26 : 32, ibfd, obfd,
bfd_get_filename (obfd), APCS_26_FLAG (obfd) ? 26 : 32 APCS_26_FLAG (ibfd) ? 26 : 32,
APCS_26_FLAG (obfd) ? 26 : 32
); );
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
@ -2287,13 +2275,12 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
if (APCS_FLOAT_FLAG (ibfd)) if (APCS_FLOAT_FLAG (ibfd))
/* xgettext: c-format */ /* xgettext: c-format */
msg = _("ERROR: %s passes floats in float registers, whereas %s passes them in integer registers"); msg = _("ERROR: %B passes floats in float registers, whereas %B passes them in integer registers");
else else
/* xgettext: c-format */ /* xgettext: c-format */
msg = _("ERROR: %s passes floats in integer registers, whereas %s passes them in float registers"); msg = _("ERROR: %B passes floats in integer registers, whereas %B passes them in float registers");
_bfd_error_handler (msg, bfd_archive_filename (ibfd), _bfd_error_handler (msg, ibfd, obfd);
bfd_get_filename (obfd));
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return FALSE; return FALSE;
@ -2305,12 +2292,11 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
if (PIC_FLAG (ibfd)) if (PIC_FLAG (ibfd))
/* xgettext: c-format */ /* xgettext: c-format */
msg = _("ERROR: %s is compiled as position independent code, whereas target %s is absolute position"); msg = _("ERROR: %B is compiled as position independent code, whereas target %B is absolute position");
else else
/* xgettext: c-format */ /* xgettext: c-format */
msg = _("ERROR: %s is compiled as absolute position code, whereas target %s is position independent"); msg = _("ERROR: %B is compiled as absolute position code, whereas target %B is position independent");
_bfd_error_handler (msg, bfd_archive_filename (ibfd), _bfd_error_handler (msg, ibfd, obfd);
bfd_get_filename (obfd));
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return FALSE; return FALSE;
@ -2337,13 +2323,12 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
if (INTERWORK_FLAG (ibfd)) if (INTERWORK_FLAG (ibfd))
/* xgettext: c-format */ /* xgettext: c-format */
msg = _("Warning: %s supports interworking, whereas %s does not"); msg = _("Warning: %B supports interworking, whereas %B does not");
else else
/* xgettext: c-format */ /* xgettext: c-format */
msg = _("Warning: %s does not support interworking, whereas %s does"); msg = _("Warning: %B does not support interworking, whereas %B does");
_bfd_error_handler (msg, bfd_archive_filename (ibfd), _bfd_error_handler (msg, ibfd, obfd);
bfd_get_filename (obfd));
} }
} }
else else
@ -2438,12 +2423,12 @@ _bfd_coff_arm_set_private_flags (abfd, flags)
{ {
if (flag) if (flag)
/* xgettext: c-format */ /* xgettext: c-format */
_bfd_error_handler (_("Warning: Not setting interworking flag of %s since it has already been specified as non-interworking"), _bfd_error_handler (_("Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"),
bfd_archive_filename (abfd)); abfd);
else else
/* xgettext: c-format */ /* xgettext: c-format */
_bfd_error_handler (_("Warning: Clearing the interworking flag of %s due to outside request"), _bfd_error_handler (_("Warning: Clearing the interworking flag of %B due to outside request"),
bfd_archive_filename (abfd)); abfd);
flag = 0; flag = 0;
} }
@ -2502,9 +2487,8 @@ coff_arm_copy_private_bfd_data (src, dest)
{ {
/* xgettext:c-format */ /* xgettext:c-format */
_bfd_error_handler (("\ _bfd_error_handler (("\
Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it"), Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"),
bfd_get_filename (dest), dest, src);
bfd_archive_filename (src));
} }
SET_INTERWORK_FLAG (dest, 0); SET_INTERWORK_FLAG (dest, 0);

View file

@ -1,6 +1,6 @@
/* BFD back-end for Intel i860 COFF files. /* BFD back-end for Intel i860 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
Free Software Foundation, Inc. 2003, 2004 Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in coff-i386.c Created mostly by substituting "860" for "386" in coff-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995 Harry Dolan <dolan@ssd.intel.com>, October 1995
@ -607,8 +607,8 @@ i860_reloc_processing (arelent *cache_ptr, struct internal_reloc *dst,
if (dst->r_symndx < 0 || dst->r_symndx >= obj_conv_table_size (abfd)) if (dst->r_symndx < 0 || dst->r_symndx >= obj_conv_table_size (abfd))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: illegal symbol index %ld in relocs"), (_("%B: warning: illegal symbol index %ld in relocs"),
bfd_archive_filename (abfd), dst->r_symndx); abfd, dst->r_symndx);
cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL; ptr = NULL;
} }

View file

@ -1,5 +1,6 @@
/* BFD back-end for Motorola MCore COFF/PE /* BFD back-end for Motorola MCore COFF/PE
Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Copyright 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -284,8 +285,8 @@ mcore_coff_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
{ {
BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0); BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
_bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"), _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"),
bfd_archive_filename (abfd), abfd,
reloc_entry->howto->name, reloc_entry->howto->name,
reloc_entry->howto->type); reloc_entry->howto->type);
@ -399,8 +400,8 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
&& output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) && output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: compiled for a %s system and target is %s.\n"), (_("%B: compiled for a %s system and target is %s.\n"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_big_endian (input_bfd) ? _("big endian") : _("little endian"), bfd_big_endian (input_bfd) ? _("big endian") : _("little endian"),
bfd_big_endian (output_bfd) ? _("big endian") : _("little endian")); bfd_big_endian (output_bfd) ? _("big endian") : _("little endian"));
@ -506,19 +507,16 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
switch (r_type) switch (r_type)
{ {
default: default:
_bfd_error_handler (_("%s: unsupported relocation type 0x%02x"), _bfd_error_handler (_("%B: unsupported relocation type 0x%02x"),
bfd_archive_filename (input_bfd), r_type); input_bfd, r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
case IMAGE_REL_MCORE_ABSOLUTE: case IMAGE_REL_MCORE_ABSOLUTE:
fprintf (stderr, _bfd_error_handler
_("Warning: unsupported reloc %s <file %s, section %s>\n"), (_("Warning: unsupported reloc %s <file %B, section %A>\n"
howto->name, "sym %ld (%s), r_vaddr %ld (%lx)"),
bfd_archive_filename (input_bfd), input_bfd, input_section, howto->name,
input_section->name);
fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n",
rel->r_symndx, my_name, (long) rel->r_vaddr, rel->r_symndx, my_name, (long) rel->r_vaddr,
(unsigned long) rel->r_vaddr); (unsigned long) rel->r_vaddr);
break; break;

View file

@ -1188,8 +1188,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unsupported relocation type 0x%02x"), (_("%B: unsupported relocation type 0x%02x"), input_bfd, r_type);
bfd_archive_filename (input_bfd), r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
case IMAGE_REL_PPC_TOCREL16: case IMAGE_REL_PPC_TOCREL16:
@ -1278,8 +1277,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
if ((bfd_vma) our_toc_offset >= 65535) if ((bfd_vma) our_toc_offset >= 65535)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Relocation for %s of %lx exceeds Toc size limit"), (_("%B: Relocation for %s of %lx exceeds Toc size limit"),
bfd_archive_filename (input_bfd), name, input_bfd, name,
(unsigned long) our_toc_offset); (unsigned long) our_toc_offset);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
@ -1333,9 +1332,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
&& (bfd_vma) our_toc_offset > toc_section->size) && (bfd_vma) our_toc_offset > toc_section->size)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Relocation exceeds allocated TOC (%lx)"), (_("%B: Relocation exceeds allocated TOC (%lx)"),
bfd_archive_filename (input_bfd), input_bfd, (unsigned long) toc_section->size);
(unsigned long) toc_section->size);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -1387,13 +1385,10 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
else else
my_name = h->root.root.root.string; my_name = h->root.root.root.string;
fprintf (stderr, (*_bfd_error_handler)
_("Warning: unsupported reloc %s <file %s, section %s>\n"), (_("Warning: unsupported reloc %s <file %B, section %A>\n"
howto->name, "sym %ld (%s), r_vaddr %ld (%lx)"),
bfd_archive_filename(input_bfd), input_bfd, input_section, howto->name,
input_section->name);
fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n",
rel->r_symndx, my_name, (long) rel->r_vaddr, rel->r_symndx, my_name, (long) rel->r_vaddr,
(unsigned long) rel->r_vaddr); (unsigned long) rel->r_vaddr);
} }
@ -1409,8 +1404,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
my_name = h->root.root.root.string; my_name = h->root.root.root.string;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Out of order IMGLUE reloc for %s"), (_("%B: Out of order IMGLUE reloc for %s"), input_bfd, my_name);
bfd_archive_filename (input_bfd), my_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }

View file

@ -3611,8 +3611,8 @@ xcoff_create_csect_from_smclas (abfd, aux, symbol_name)
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: symbol `%s' has unrecognized smclas %d"), (_("%B: symbol `%s' has unrecognized smclas %d"),
bfd_archive_filename (abfd), symbol_name, aux->x_csect.x_smclas); abfd, symbol_name, aux->x_csect.x_smclas);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
} }

View file

@ -762,9 +762,8 @@ sh_relax_section (abfd, sec, link_info, again)
laddr += ((irel->r_offset & 0xffffffff) ^ 0x80000000) - 0x80000000; laddr += ((irel->r_offset & 0xffffffff) ^ 0x80000000) - 0x80000000;
if (laddr >= sec->size) if (laddr >= sec->size)
{ {
(*_bfd_error_handler) ("%s: 0x%lx: warning: bad R_SH_USES offset", (*_bfd_error_handler) ("%B: 0x%lx: warning: bad R_SH_USES offset",
bfd_archive_filename (abfd), abfd, (unsigned long) irel->r_vaddr);
(unsigned long) irel->r_vaddr);
continue; continue;
} }
insn = bfd_get_16 (abfd, contents + laddr); insn = bfd_get_16 (abfd, contents + laddr);
@ -773,8 +772,8 @@ sh_relax_section (abfd, sec, link_info, again)
if ((insn & 0xf000) != 0xd000) if ((insn & 0xf000) != 0xd000)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x", ("%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x",
bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr, insn)); abfd, (unsigned long) irel->r_vaddr, insn));
continue; continue;
} }
@ -790,8 +789,8 @@ sh_relax_section (abfd, sec, link_info, again)
if (paddr >= sec->size) if (paddr >= sec->size)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: 0x%lx: warning: bad R_SH_USES load offset", ("%B: 0x%lx: warning: bad R_SH_USES load offset",
bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr)); abfd, (unsigned long) irel->r_vaddr));
continue; continue;
} }
@ -814,8 +813,8 @@ sh_relax_section (abfd, sec, link_info, again)
if (irelfn >= irelend) if (irelfn >= irelend)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: 0x%lx: warning: could not find expected reloc", ("%B: 0x%lx: warning: could not find expected reloc",
bfd_archive_filename (abfd), (unsigned long) paddr)); abfd, (unsigned long) paddr));
continue; continue;
} }
@ -830,8 +829,8 @@ sh_relax_section (abfd, sec, link_info, again)
if (sym.n_scnum != 0 && sym.n_scnum != sec->target_index) if (sym.n_scnum != 0 && sym.n_scnum != sec->target_index)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: 0x%lx: warning: symbol in unexpected section", ("%B: 0x%lx: warning: symbol in unexpected section",
bfd_archive_filename (abfd), (unsigned long) paddr)); abfd, (unsigned long) paddr));
continue; continue;
} }
@ -955,8 +954,8 @@ sh_relax_section (abfd, sec, link_info, again)
if (irelcount >= irelend) if (irelcount >= irelend)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: 0x%lx: warning: could not find expected COUNT reloc", ("%B: 0x%lx: warning: could not find expected COUNT reloc",
bfd_archive_filename (abfd), (unsigned long) paddr)); abfd, (unsigned long) paddr));
continue; continue;
} }
@ -964,9 +963,8 @@ sh_relax_section (abfd, sec, link_info, again)
just deleted one. */ just deleted one. */
if (irelcount->r_offset == 0) if (irelcount->r_offset == 0)
{ {
((*_bfd_error_handler) ("%s: 0x%lx: warning: bad count", ((*_bfd_error_handler) ("%B: 0x%lx: warning: bad count",
bfd_archive_filename (abfd), abfd, (unsigned long) paddr));
(unsigned long) paddr));
continue; continue;
} }
@ -1337,8 +1335,8 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
if (overflow) if (overflow)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: 0x%lx: fatal: reloc overflow while relaxing", ("%B: 0x%lx: fatal: reloc overflow while relaxing",
bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr)); abfd, (unsigned long) irel->r_vaddr));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -1432,8 +1430,7 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
|| obj_raw_syments (abfd) != NULL) || obj_raw_syments (abfd) != NULL)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: fatal: generic symbols retrieved before relaxing", ("%B: fatal: generic symbols retrieved before relaxing", abfd));
bfd_archive_filename (abfd)));
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return FALSE; return FALSE;
} }
@ -2788,8 +2785,8 @@ sh_swap_insns (abfd, sec, relocs, contents, addr)
if (overflow) if (overflow)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: 0x%lx: fatal: reloc overflow while relaxing", ("%B: 0x%lx: fatal: reloc overflow while relaxing",
bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr)); abfd, (unsigned long) irel->r_vaddr));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -2852,8 +2849,8 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
|| (unsigned long) symndx >= obj_raw_syment_count (input_bfd)) || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: illegal symbol index %ld in relocs", ("%B: illegal symbol index %ld in relocs",
bfd_archive_filename (input_bfd), symndx); input_bfd, symndx);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }

View file

@ -1,5 +1,6 @@
/* BFD back-end for TMS320C54X coff binaries. /* BFD back-end for TMS320C54X coff binaries.
Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Copyright 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by Timothy Wall (twall@cygnus.com) Contributed by Timothy Wall (twall@cygnus.com)
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -363,8 +364,8 @@ tic54x_reloc_processing (relent, reloc, symbols, abfd, section)
if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd)) if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: illegal symbol index %ld in relocs"), (_("%B: warning: illegal symbol index %ld in relocs"),
bfd_archive_filename (abfd), reloc->r_symndx); abfd, reloc->r_symndx);
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL; ptr = NULL;
} }

View file

@ -684,10 +684,8 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad reloc address 0x%lx in section `%s'"), (_("%B: bad reloc address 0x%lx in section `%A'"),
bfd_archive_filename (input_bfd), input_bfd, input_section, (unsigned long) rel->r_vaddr);
(unsigned long) rel->r_vaddr,
bfd_get_section_name (input_bfd, input_section));
return FALSE; return FALSE;
case bfd_reloc_overflow: case bfd_reloc_overflow:
{ {

View file

@ -2104,8 +2104,8 @@ xcoff64_create_csect_from_smclas (abfd, aux, symbol_name)
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: symbol `%s' has unrecognized smclas %d"), (_("%B: symbol `%s' has unrecognized smclas %d"),
bfd_archive_filename (abfd), symbol_name, aux->x_csect.x_smclas); abfd, symbol_name, aux->x_csect.x_smclas);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
} }

View file

@ -1071,8 +1071,8 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
/* Generate a warning message rather using the 'unhandled' /* Generate a warning message rather using the 'unhandled'
variable as this will allow some .sys files generate by variable as this will allow some .sys files generate by
other toolchains to be processed. See bugzilla issue 196. */ other toolchains to be processed. See bugzilla issue 196. */
_bfd_error_handler (_("%s: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"), _bfd_error_handler (_("%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"),
bfd_archive_filename (abfd), name); abfd, name);
#endif #endif
break; break;
case IMAGE_SCN_MEM_EXECUTE: case IMAGE_SCN_MEM_EXECUTE:
@ -1127,8 +1127,8 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
if (unhandled != NULL) if (unhandled != NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s (%s): Section flag %s (0x%x) ignored"), (_("%B (%s): Section flag %s (0x%x) ignored"),
bfd_archive_filename (abfd), name, unhandled, flag); abfd, name, unhandled, flag);
result = FALSE; result = FALSE;
} }
} }
@ -4445,8 +4445,7 @@ coff_slurp_line_table (abfd, asect)
if (native_lineno == NULL) if (native_lineno == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: line number table read failed"), (_("%B: warning: line number table read failed"), abfd);
bfd_archive_filename (abfd));
return FALSE; return FALSE;
} }
amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent); amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent);
@ -4478,8 +4477,8 @@ coff_slurp_line_table (abfd, asect)
|| (bfd_vma) symndx >= obj_raw_syment_count (abfd)) || (bfd_vma) symndx >= obj_raw_syment_count (abfd))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: illegal symbol index %ld in line numbers"), (_("%B: warning: illegal symbol index %ld in line numbers"),
bfd_archive_filename (abfd), dst.l_addr.l_symndx); abfd, dst.l_addr.l_symndx);
symndx = 0; symndx = 0;
warned = TRUE; warned = TRUE;
} }
@ -4492,9 +4491,8 @@ coff_slurp_line_table (abfd, asect)
if (sym->lineno != NULL && ! warned) if (sym->lineno != NULL && ! warned)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: duplicate line number information for `%s'"), (_("%B: warning: duplicate line number information for `%s'"),
bfd_archive_filename (abfd), abfd, bfd_asymbol_name (&sym->symbol));
bfd_asymbol_name (&sym->symbol));
} }
sym->lineno = cache_ptr; sym->lineno = cache_ptr;
} }
@ -4848,8 +4846,8 @@ coff_slurp_symbol_table (abfd)
case C_HIDDEN: /* Ext symbol in dmert public lib. */ case C_HIDDEN: /* Ext symbol in dmert public lib. */
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Unrecognized storage class %d for %s symbol `%s'"), (_("%B: Unrecognized storage class %d for %s symbol `%s'"),
bfd_archive_filename (abfd), src->u.syment.n_sclass, abfd, src->u.syment.n_sclass,
dst->symbol.section->name, dst->symbol.name); dst->symbol.section->name, dst->symbol.name);
dst->symbol.flags = BSF_DEBUGGING; dst->symbol.flags = BSF_DEBUGGING;
dst->symbol.value = (src->u.syment.n_value); dst->symbol.value = (src->u.syment.n_value);
@ -4981,9 +4979,8 @@ coff_classify_symbol (abfd, syment)
char buf[SYMNMLEN + 1]; char buf[SYMNMLEN + 1];
(*_bfd_error_handler) (*_bfd_error_handler)
(_("warning: %s: local symbol `%s' has no section"), (_("warning: %B: local symbol `%s' has no section"),
bfd_archive_filename (abfd), abfd, _bfd_coff_internal_syment_name (abfd, syment, buf));
_bfd_coff_internal_syment_name (abfd, syment, buf));
} }
return COFF_SYMBOL_LOCAL; return COFF_SYMBOL_LOCAL;
@ -5088,8 +5085,8 @@ coff_slurp_reloc_table (abfd, asect, symbols)
if (dst.r_symndx < 0 || dst.r_symndx >= obj_conv_table_size (abfd)) if (dst.r_symndx < 0 || dst.r_symndx >= obj_conv_table_size (abfd))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: illegal symbol index %ld in relocs"), (_("%B: warning: illegal symbol index %ld in relocs"),
bfd_archive_filename (abfd), dst.r_symndx); abfd, dst.r_symndx);
cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL; ptr = NULL;
} }
@ -5126,8 +5123,8 @@ coff_slurp_reloc_table (abfd, asect, symbols)
if (cache_ptr->howto == NULL) if (cache_ptr->howto == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: illegal relocation type %d at address 0x%lx"), (_("%B: illegal relocation type %d at address 0x%lx"),
bfd_archive_filename (abfd), dst.r_type, (long) dst.r_vaddr); abfd, dst.r_type, (long) dst.r_vaddr);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }

View file

@ -1663,8 +1663,7 @@ _bfd_coff_read_string_table (abfd)
if (strsize < STRING_SIZE_SIZE) if (strsize < STRING_SIZE_SIZE)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad string table size %lu"), bfd_archive_filename (abfd), (_("%B: bad string table size %lu"), abfd, (unsigned long) strsize);
(unsigned long) strsize);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return NULL; return NULL;
} }

View file

@ -503,9 +503,8 @@ coff_link_add_symbols (bfd *abfd,
&& (BTYPE ((*sym_hash)->type) == T_NULL && (BTYPE ((*sym_hash)->type) == T_NULL
|| BTYPE (sym.n_type) == T_NULL))) || BTYPE (sym.n_type) == T_NULL)))
(*_bfd_error_handler) (*_bfd_error_handler)
(_("Warning: type of symbol `%s' changed from %d to %d in %s"), (_("Warning: type of symbol `%s' changed from %d to %d in %B"),
name, (*sym_hash)->type, sym.n_type, abfd, name, (*sym_hash)->type, sym.n_type);
bfd_archive_filename (abfd));
/* We don't want to change from a meaningful /* We don't want to change from a meaningful
base type to a null one, but if we know base type to a null one, but if we know
@ -2291,10 +2290,9 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd)
if ((o->flags & SEC_RELOC) != 0 if ((o->flags & SEC_RELOC) != 0
&& o->reloc_count != 0) && o->reloc_count != 0)
{ {
((*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocs in section `%s', but it has no contents"), (_("%B: relocs in section `%A', but it has no contents"),
bfd_archive_filename (input_bfd), input_bfd, o);
bfd_get_section_name (input_bfd, o)));
bfd_set_error (bfd_error_no_contents); bfd_set_error (bfd_error_no_contents);
return FALSE; return FALSE;
} }
@ -2861,8 +2859,7 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
|| (unsigned long) symndx >= obj_raw_syment_count (input_bfd)) || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: illegal symbol index %ld in relocs", ("%B: illegal symbol index %ld in relocs", input_bfd, symndx);
bfd_archive_filename (input_bfd), symndx);
return FALSE; return FALSE;
} }
else else
@ -3007,10 +3004,8 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
break; break;
case bfd_reloc_outofrange: case bfd_reloc_outofrange:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad reloc address 0x%lx in section `%s'"), (_("%B: bad reloc address 0x%lx in section `%A'"),
bfd_archive_filename (input_bfd), input_bfd, input_section, (unsigned long) rel->r_vaddr);
(unsigned long) rel->r_vaddr,
bfd_get_section_name (input_bfd, input_section));
return FALSE; return FALSE;
case bfd_reloc_overflow: case bfd_reloc_overflow:
{ {

View file

@ -195,9 +195,8 @@ bfd_arm_merge_machines (ibfd, obfd)
&& (out == bfd_mach_arm_XScale || out == bfd_mach_arm_iWMMXt)) && (out == bfd_mach_arm_XScale || out == bfd_mach_arm_iWMMXt))
{ {
_bfd_error_handler (_("\ _bfd_error_handler (_("\
ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"), ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return FALSE; return FALSE;
} }
@ -205,9 +204,8 @@ ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"),
&& (in == bfd_mach_arm_XScale || in == bfd_mach_arm_iWMMXt)) && (in == bfd_mach_arm_XScale || in == bfd_mach_arm_iWMMXt))
{ {
_bfd_error_handler (_("\ _bfd_error_handler (_("\
ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"), ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
bfd_archive_filename (obfd), obfd, ibfd);
bfd_get_filename (ibfd));
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return FALSE; return FALSE;
} }

View file

@ -434,8 +434,8 @@ sh_merge_bfd_arch (bfd *ibfd, bfd *obfd)
if (!SH_VALID_CO_ARCH_SET (merged_arch)) if (!SH_VALID_CO_ARCH_SET (merged_arch))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: uses %s instructions while previous modules use %s instructions", ("%B: uses %s instructions while previous modules use %s instructions",
bfd_archive_filename (ibfd), ibfd,
SH_ARCH_SET_HAS_DSP (new_arch) ? "dsp" : "floating point", SH_ARCH_SET_HAS_DSP (new_arch) ? "dsp" : "floating point",
SH_ARCH_SET_HAS_DSP (new_arch) ? "floating point" : "dsp"); SH_ARCH_SET_HAS_DSP (new_arch) ? "floating point" : "dsp");
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);

View file

@ -1,5 +1,5 @@
/* Routines to link ECOFF debugging information. /* Routines to link ECOFF debugging information.
Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003 Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>. Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
@ -1154,7 +1154,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
fdr.issBase = output_symhdr->issMax; fdr.issBase = output_symhdr->issMax;
fdr.cbSs = 0; fdr.cbSs = 0;
fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr, fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr,
bfd_archive_filename (input_bfd)); input_bfd->filename);
if (fdr.rss == -1) if (fdr.rss == -1)
return FALSE; return FALSE;
fdr.isymBase = output_symhdr->isymMax; fdr.isymBase = output_symhdr->isymMax;

View file

@ -1399,9 +1399,8 @@ elf_hppa_relocate_section (bfd *output_bfd,
if (sym_sec->output_section == NULL && dyn_h == NULL) if (sym_sec->output_section == NULL && dyn_h == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), (_("%B(%A): warning: unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), h->root.root.string, input_bfd, input_section, h->root.root.string);
bfd_get_section_name (input_bfd, input_section));
relocation = 0; relocation = 0;
} }
else if (sym_sec->output_section) else if (sym_sec->output_section)
@ -1426,9 +1425,8 @@ elf_hppa_relocate_section (bfd *output_bfd,
if (dyn_h == NULL) if (dyn_h == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), (_("%B(%A): warning: unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), h->root.root.string, input_bfd, input_section, h->root.root.string);
bfd_get_section_name (input_bfd, input_section));
} }
relocation = 0; relocation = 0;
} }
@ -1442,9 +1440,8 @@ elf_hppa_relocate_section (bfd *output_bfd,
if (dyn_h == NULL) if (dyn_h == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), (_("%B(%A): warning: unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), h->root.root.string, input_bfd, input_section, h->root.root.string);
bfd_get_section_name (input_bfd, input_section));
} }
relocation = 0; relocation = 0;
} }

View file

@ -292,8 +292,8 @@ bfd_elf_string_from_elf_section (bfd *abfd,
if (strindex >= hdr->sh_size) if (strindex >= hdr->sh_size)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: invalid string offset %u >= %lu for section `%s'"), (_("%B: invalid string offset %u >= %lu for section `%s'"),
bfd_archive_filename (abfd), strindex, (unsigned long) hdr->sh_size, abfd, strindex, (unsigned long) hdr->sh_size,
((shindex == elf_elfheader(abfd)->e_shstrndx ((shindex == elf_elfheader(abfd)->e_shstrndx
&& strindex == hdr->sh_name) && strindex == hdr->sh_name)
? ".shstrtab" ? ".shstrtab"
@ -535,8 +535,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
if (idx >= shnum) if (idx >= shnum)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: invalid SHT_GROUP entry"), (_("%B: invalid SHT_GROUP entry"), abfd));
bfd_archive_filename (abfd)));
idx = 0; idx = 0;
} }
dest->shdr = elf_elfsections (abfd)[idx]; dest->shdr = elf_elfsections (abfd)[idx];
@ -606,8 +605,8 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
if (elf_group_name (newsect) == NULL) if (elf_group_name (newsect) == NULL)
{ {
(*_bfd_error_handler) (_("%s: no group info for section %s"), (*_bfd_error_handler) (_("%B: no group info for section %A"),
bfd_archive_filename (abfd), newsect->name); abfd, newsect);
} }
return TRUE; return TRUE;
} }
@ -643,8 +642,8 @@ _bfd_elf_setup_group_pointers (bfd *abfd)
{ {
/* There are some unknown sections in the group. */ /* There are some unknown sections in the group. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unknown [%d] section `%s' in group [%s]"), (_("%B: unknown [%d] section `%s' in group [%s]"),
bfd_archive_filename (abfd), abfd,
(unsigned int) idx->shdr->sh_type, (unsigned int) idx->shdr->sh_type,
elf_string_from_elf_strtab (abfd, idx->shdr->sh_name), elf_string_from_elf_strtab (abfd, idx->shdr->sh_name),
shdr->bfd_section->name); shdr->bfd_section->name);
@ -1904,8 +1903,8 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
|| hdr->sh_link >= num_sec) || hdr->sh_link >= num_sec)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: invalid link %lu for reloc section %s (index %u)"), (_("%B: invalid link %lu for reloc section %s (index %u)"),
bfd_archive_filename (abfd), hdr->sh_link, name, shindex)); abfd, hdr->sh_link, name, shindex));
return _bfd_elf_make_section_from_shdr (abfd, hdr, name); return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
} }
@ -2895,15 +2894,9 @@ assign_section_numbers (bfd *abfd)
const struct elf_backend_data *bed const struct elf_backend_data *bed
= get_elf_backend_data (abfd); = get_elf_backend_data (abfd);
if (bed->link_order_error_handler) if (bed->link_order_error_handler)
{
char *name = bfd_get_section_ident (s);
bed->link_order_error_handler bed->link_order_error_handler
(_("%s: warning: sh_link not set for section `%s'"), (_("%B: warning: sh_link not set for section `%S'"),
bfd_archive_filename (abfd), abfd, s);
name ? name : s->name);
if (name)
free (name);
}
} }
else else
{ {
@ -4791,8 +4784,8 @@ _bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr)
/* This case can occur when using --strip-symbol on a symbol /* This case can occur when using --strip-symbol on a symbol
which is used in a relocation entry. */ which is used in a relocation entry. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: symbol `%s' required but not present"), (_("%B: symbol `%s' required but not present"),
bfd_archive_filename (abfd), bfd_asymbol_name (asym_ptr)); abfd, bfd_asymbol_name (asym_ptr));
bfd_set_error (bfd_error_no_symbols); bfd_set_error (bfd_error_no_symbols);
return -1; return -1;
} }
@ -5079,8 +5072,8 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
a warning is produced. */ a warning is produced. */
if (segment->p_type == PT_LOAD) if (segment->p_type == PT_LOAD)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: Empty loadable segment detected, is this intentional ?\n"), (_("%B: warning: Empty loadable segment detected, is this intentional ?\n"),
bfd_archive_filename (ibfd)); ibfd);
map->count = 0; map->count = 0;
*pointer_to_map = map; *pointer_to_map = map;
@ -6503,8 +6496,8 @@ _bfd_elf_validate_reloc (bfd *abfd, arelent *areloc)
fail: fail:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unsupported relocation type %s"), (_("%B: unsupported relocation type %s"),
bfd_archive_filename (abfd), areloc->howto->name); abfd, areloc->howto->name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }

View file

@ -486,8 +486,8 @@ find_thumb_glue (link_info, name, input_bfd)
if (hash == NULL) if (hash == NULL)
/* xgettext:c-format */ /* xgettext:c-format */
(*_bfd_error_handler) (_("%s: unable to find THUMB glue '%s' for `%s'"), (*_bfd_error_handler) (_("%B: unable to find THUMB glue '%s' for `%s'"),
bfd_archive_filename (input_bfd), tmp_name, name); input_bfd, tmp_name, name);
free (tmp_name); free (tmp_name);
@ -521,8 +521,8 @@ find_arm_glue (link_info, name, input_bfd)
if (myh == NULL) if (myh == NULL)
/* xgettext:c-format */ /* xgettext:c-format */
(*_bfd_error_handler) (_("%s: unable to find ARM glue '%s' for `%s'"), (*_bfd_error_handler) (_("%B: unable to find ARM glue '%s' for `%s'"),
bfd_archive_filename (input_bfd), tmp_name, name); input_bfd, tmp_name, name);
free (tmp_name); free (tmp_name);
@ -863,9 +863,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info,
globals->no_pipeline_knowledge = no_pipeline_knowledge; globals->no_pipeline_knowledge = no_pipeline_knowledge;
if (byteswap_code && !bfd_big_endian (abfd)) if (byteswap_code && !bfd_big_endian (abfd))
{ {
_bfd_error_handler ( _bfd_error_handler (_("%B: BE8 images only valid in big-endian mode."),
_("%s: BE8 images only valid in big-endian mode."), abfd);
bfd_archive_filename (abfd));
return FALSE; return FALSE;
} }
globals->byteswap_code = byteswap_code; globals->byteswap_code = byteswap_code;
@ -1090,11 +1089,9 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section,
&& !INTERWORK_FLAG (sym_sec->owner)) && !INTERWORK_FLAG (sym_sec->owner))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s): warning: interworking not enabled."), (_("%B(%s): warning: interworking not enabled.\n"
bfd_archive_filename (sym_sec->owner), name); " first occurrence: %B: thumb call to arm"),
(*_bfd_error_handler) sym_sec->owner, input_bfd, name);
(_(" first occurrence: %s: thumb call to arm"),
bfd_archive_filename (input_bfd));
return FALSE; return FALSE;
} }
@ -1197,11 +1194,9 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section,
&& !INTERWORK_FLAG (sym_sec->owner)) && !INTERWORK_FLAG (sym_sec->owner))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s): warning: interworking not enabled."), (_("%B(%s): warning: interworking not enabled.\n"
bfd_archive_filename (sym_sec->owner), name); " first occurrence: %B: arm call to thumb"),
(*_bfd_error_handler) sym_sec->owner, input_bfd, name);
(_(" first occurrence: %s: arm call to thumb"),
bfd_archive_filename (input_bfd));
} }
--my_offset; --my_offset;
@ -1445,9 +1440,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
/* FIXME: Should we translate the instruction into a BL /* FIXME: Should we translate the instruction into a BL
instruction instead ? */ instruction instead ? */
if (sym_flags != STT_ARM_TFUNC) if (sym_flags != STT_ARM_TFUNC)
(*_bfd_error_handler) (_("\ (*_bfd_error_handler)
%s: Warning: Arm BLX instruction targets Arm function '%s'."), (_("\%B: Warning: Arm BLX instruction targets Arm function '%s'."),
bfd_archive_filename (input_bfd), input_bfd,
h ? h->root.root.string : "(local)"); h ? h->root.root.string : "(local)");
} }
else else
@ -1641,9 +1636,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
/* FIXME: Should we translate the instruction into a BL /* FIXME: Should we translate the instruction into a BL
instruction instead ? */ instruction instead ? */
if (sym_flags == STT_ARM_TFUNC) if (sym_flags == STT_ARM_TFUNC)
(*_bfd_error_handler) (_("\ (*_bfd_error_handler)
%s: Warning: Thumb BLX instruction targets thumb function '%s'."), (_("%B: Warning: Thumb BLX instruction targets thumb function '%s'."),
bfd_archive_filename (input_bfd), input_bfd,
h ? h->root.root.string : "(local)"); h ? h->root.root.string : "(local)");
} }
else else
@ -2136,9 +2131,8 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
if (howto->rightshift) if (howto->rightshift)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"), (_("%B(%A+0x%lx): %s relocation against SEC_MERGE section"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, howto->name); (long) rel->r_offset, howto->name);
return FALSE; return FALSE;
} }
@ -2225,11 +2219,10 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
default: default:
if (unresolved_reloc) if (unresolved_reloc)
_bfd_error_handler _bfd_error_handler
(_("%s: warning: unresolvable relocation %d against symbol `%s' from %s section"), (_("%B(%A): warning: unresolvable relocation %d against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
r_type, r_type,
h->root.root.string, h->root.root.string);
bfd_get_section_name (input_bfd, input_section));
break; break;
} }
} }
@ -2339,13 +2332,13 @@ elf32_arm_set_private_flags (abfd, flags)
if (EF_ARM_EABI_VERSION (flags) == EF_ARM_EABI_UNKNOWN) if (EF_ARM_EABI_VERSION (flags) == EF_ARM_EABI_UNKNOWN)
{ {
if (flags & EF_ARM_INTERWORK) if (flags & EF_ARM_INTERWORK)
(*_bfd_error_handler) (_("\ (*_bfd_error_handler)
Warning: Not setting interworking flag of %s since it has already been specified as non-interworking"), (_("Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"),
bfd_archive_filename (abfd)); abfd);
else else
_bfd_error_handler (_("\ _bfd_error_handler
Warning: Clearing the interworking flag of %s due to outside request"), (_("Warning: Clearing the interworking flag of %B due to outside request"),
bfd_archive_filename (abfd)); abfd);
} }
} }
else else
@ -2391,10 +2384,9 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd)
if ((in_flags & EF_ARM_INTERWORK) != (out_flags & EF_ARM_INTERWORK)) if ((in_flags & EF_ARM_INTERWORK) != (out_flags & EF_ARM_INTERWORK))
{ {
if (out_flags & EF_ARM_INTERWORK) if (out_flags & EF_ARM_INTERWORK)
_bfd_error_handler (_("\ _bfd_error_handler
Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it"), (_("Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"),
bfd_get_filename (obfd), obfd, ibfd);
bfd_archive_filename (ibfd));
in_flags &= ~EF_ARM_INTERWORK; in_flags &= ~EF_ARM_INTERWORK;
} }
@ -2509,11 +2501,10 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd)
/* Complain about various flag mismatches. */ /* Complain about various flag mismatches. */
if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_VERSION (out_flags)) if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_VERSION (out_flags))
{ {
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d"), (_("ERROR: %B is compiled for EABI version %d, whereas %B is compiled for version %d"),
bfd_archive_filename (ibfd), ibfd, obfd,
(in_flags & EF_ARM_EABIMASK) >> 24, (in_flags & EF_ARM_EABIMASK) >> 24,
bfd_get_filename (obfd),
(out_flags & EF_ARM_EABIMASK) >> 24); (out_flags & EF_ARM_EABIMASK) >> 24);
return FALSE; return FALSE;
} }
@ -2523,11 +2514,10 @@ ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d
{ {
if ((in_flags & EF_ARM_APCS_26) != (out_flags & EF_ARM_APCS_26)) if ((in_flags & EF_ARM_APCS_26) != (out_flags & EF_ARM_APCS_26))
{ {
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d"), (_("ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"),
bfd_archive_filename (ibfd), ibfd, obfd,
in_flags & EF_ARM_APCS_26 ? 26 : 32, in_flags & EF_ARM_APCS_26 ? 26 : 32,
bfd_get_filename (obfd),
out_flags & EF_ARM_APCS_26 ? 26 : 32); out_flags & EF_ARM_APCS_26 ? 26 : 32);
flags_compatible = FALSE; flags_compatible = FALSE;
} }
@ -2535,15 +2525,13 @@ ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d"),
if ((in_flags & EF_ARM_APCS_FLOAT) != (out_flags & EF_ARM_APCS_FLOAT)) if ((in_flags & EF_ARM_APCS_FLOAT) != (out_flags & EF_ARM_APCS_FLOAT))
{ {
if (in_flags & EF_ARM_APCS_FLOAT) if (in_flags & EF_ARM_APCS_FLOAT)
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s passes floats in float registers, whereas %s passes them in integer registers"), (_("ERROR: %B passes floats in float registers, whereas %B passes them in integer registers"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
else else
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s passes floats in integer registers, whereas %s passes them in float registers"), (_("ERROR: %B passes floats in integer registers, whereas %B passes them in float registers"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
flags_compatible = FALSE; flags_compatible = FALSE;
} }
@ -2551,15 +2539,13 @@ ERROR: %s passes floats in integer registers, whereas %s passes them in float re
if ((in_flags & EF_ARM_VFP_FLOAT) != (out_flags & EF_ARM_VFP_FLOAT)) if ((in_flags & EF_ARM_VFP_FLOAT) != (out_flags & EF_ARM_VFP_FLOAT))
{ {
if (in_flags & EF_ARM_VFP_FLOAT) if (in_flags & EF_ARM_VFP_FLOAT)
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s uses VFP instructions, whereas %s does not"), (_("ERROR: %B uses VFP instructions, whereas %B does not"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
else else
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s uses FPA instructions, whereas %s does not"), (_("ERROR: %B uses FPA instructions, whereas %B does not"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
flags_compatible = FALSE; flags_compatible = FALSE;
} }
@ -2567,15 +2553,13 @@ ERROR: %s uses FPA instructions, whereas %s does not"),
if ((in_flags & EF_ARM_MAVERICK_FLOAT) != (out_flags & EF_ARM_MAVERICK_FLOAT)) if ((in_flags & EF_ARM_MAVERICK_FLOAT) != (out_flags & EF_ARM_MAVERICK_FLOAT))
{ {
if (in_flags & EF_ARM_MAVERICK_FLOAT) if (in_flags & EF_ARM_MAVERICK_FLOAT)
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s uses Maverick instructions, whereas %s does not"), (_("ERROR: %B uses Maverick instructions, whereas %B does not"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
else else
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s does not use Maverick instructions, whereas %s does"), (_("ERROR: %B does not use Maverick instructions, whereas %B does"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
flags_compatible = FALSE; flags_compatible = FALSE;
} }
@ -2592,15 +2576,13 @@ ERROR: %s does not use Maverick instructions, whereas %s does"),
|| (in_flags & EF_ARM_VFP_FLOAT) == 0) || (in_flags & EF_ARM_VFP_FLOAT) == 0)
{ {
if (in_flags & EF_ARM_SOFT_FLOAT) if (in_flags & EF_ARM_SOFT_FLOAT)
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s uses software FP, whereas %s uses hardware FP"), (_("ERROR: %B uses software FP, whereas %B uses hardware FP"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
else else
_bfd_error_handler (_("\ _bfd_error_handler
ERROR: %s uses hardware FP, whereas %s uses software FP"), (_("ERROR: %B uses hardware FP, whereas %B uses software FP"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
flags_compatible = FALSE; flags_compatible = FALSE;
} }
@ -2612,17 +2594,15 @@ ERROR: %s uses hardware FP, whereas %s uses software FP"),
{ {
if (in_flags & EF_ARM_INTERWORK) if (in_flags & EF_ARM_INTERWORK)
{ {
_bfd_error_handler (_("\ _bfd_error_handler
Warning: %s supports interworking, whereas %s does not"), (_("Warning: %B supports interworking, whereas %B does not"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
} }
else else
{ {
_bfd_error_handler (_("\ _bfd_error_handler
Warning: %s does not support interworking, whereas %s does"), (_("Warning: %B does not support interworking, whereas %B does"),
bfd_archive_filename (ibfd), ibfd, obfd);
bfd_get_filename (obfd));
} }
} }
} }

View file

@ -918,11 +918,11 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else if (unresolved_reloc) else if (unresolved_reloc)
{ {
_bfd_error_handler _bfd_error_handler
(_("%s: unresolvable relocation %s against symbol `%s' from %s section"), (_("%B(%A): unresolvable relocation %s against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
input_section,
cris_elf_howto_table[r_type].name, cris_elf_howto_table[r_type].name,
symname, symname);
bfd_get_section_name (input_bfd, input_section));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -975,14 +975,14 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
((h->got.offset == (bfd_vma) -1) ((h->got.offset == (bfd_vma) -1)
? _("%s: No PLT nor GOT for relocation %s against\ ? _("%B(%A): No PLT nor GOT for relocation %s"
symbol `%s' from %s section") " against symbol `%s'")
: _("%s: No PLT for relocation %s against\ : _("%B(%A): No PLT for relocation %s"
symbol `%s' from %s section"), " against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
input_section,
cris_elf_howto_table[r_type].name, cris_elf_howto_table[r_type].name,
symname[0] != '\0' ? symname : _("[whose name is lost]"), symname[0] != '\0' ? symname : _("[whose name is lost]"));
bfd_get_section_name (input_bfd, input_section));
/* FIXME: Perhaps blaming input is not the right thing to /* FIXME: Perhaps blaming input is not the right thing to
do; this is probably an internal error. But it is true do; this is probably an internal error. But it is true
@ -1103,19 +1103,21 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
allowed to pass us these kinds of things. */ allowed to pass us these kinds of things. */
if (h == NULL) if (h == NULL)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s with non-zero addend %d against local symbol from %s section"), (_("%B(%A): relocation %s with non-zero addend %d"
bfd_archive_filename (input_bfd), " against local symbol"),
input_bfd,
input_section,
cris_elf_howto_table[r_type].name, cris_elf_howto_table[r_type].name,
rel->r_addend, rel->r_addend);
bfd_get_section_name (input_bfd, input_section));
else else
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s with non-zero addend %d against symbol `%s' from %s section"), (_("%B(%A): relocation %s with non-zero addend %d"
bfd_archive_filename (input_bfd), " against symbol `%s'"),
input_bfd,
input_section,
cris_elf_howto_table[r_type].name, cris_elf_howto_table[r_type].name,
rel->r_addend, rel->r_addend,
symname[0] != '\0' ? symname : _("[whose name is lost]"), symname[0] != '\0' ? symname : _("[whose name is lost]"));
bfd_get_section_name (input_bfd, input_section));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
@ -1135,11 +1137,11 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& h->root.type == bfd_link_hash_undefweak)))) && h->root.type == bfd_link_hash_undefweak))))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s is not allowed for global symbol: `%s' from %s section"), (_("%B(%A): relocation %s is not allowed for global symbol: `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
input_section,
cris_elf_howto_table[r_type].name, cris_elf_howto_table[r_type].name,
symname, symname);
bfd_get_section_name (input_bfd, input_section));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -1150,10 +1152,10 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (sgot == NULL) if (sgot == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s in section %s with no GOT created"), (_("%B: relocation %s in section %A with no GOT created"),
bfd_archive_filename (input_bfd), input_bfd,
cris_elf_howto_table[r_type].name, input_section,
bfd_get_section_name (input_bfd, input_section)); cris_elf_howto_table[r_type].name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -1269,8 +1271,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (sreloc == NULL) if (sreloc == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Internal inconsistency; no relocation section %s"), (_("%B: Internal inconsistency; no relocation section %s"),
bfd_archive_filename (input_bfd), input_bfd,
name); name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -2491,9 +2493,9 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
{ {
/* FIXME: How do we make this optionally a warning only? */ /* FIXME: How do we make this optionally a warning only? */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s, section %s:\n relocation %s should not be used in a shared object; recompile with -fPIC"), (_("%B, section %A:\n relocation %s should not be used in a shared object; recompile with -fPIC"),
bfd_archive_filename (abfd), abfd,
sec->name, sec,
cris_elf_howto_table[r_type].name); cris_elf_howto_table[r_type].name);
} }
/* Fall through. */ /* Fall through. */
@ -3011,9 +3013,9 @@ cris_elf_merge_private_bfd_data (ibfd, obfd)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
((new_flags & EF_CRIS_UNDERSCORE) ((new_flags & EF_CRIS_UNDERSCORE)
? _("%s: uses _-prefixed symbols, but writing file with non-prefixed symbols") ? _("%B: uses _-prefixed symbols, but writing file with non-prefixed symbols")
: _("%s: uses non-prefixed symbols, but writing file with _-prefixed symbols"), : _("%B: uses non-prefixed symbols, but writing file with _-prefixed symbols"),
bfd_archive_filename (ibfd)); ibfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }

View file

@ -2042,9 +2042,8 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
rel->r_addend)) rel->r_addend))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation at `%s+0x%x' references symbol `%s' with nonzero addend"), (_("%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"),
bfd_archive_filename (input_bfd), input_section->name, input_bfd, input_section, rel->r_offset, name);
rel->r_offset, name);
return FALSE; return FALSE;
} }
@ -4237,8 +4236,8 @@ elf32_frv_check_relocs (abfd, info, sec, relocs)
default: default:
bad_reloc: bad_reloc:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unsupported relocation type %i"), (_("%B: unsupported relocation type %i"),
bfd_archive_filename (abfd), ELF32_R_TYPE (rel->r_info)); abfd, ELF32_R_TYPE (rel->r_info));
return FALSE; return FALSE;
} }
} }

View file

@ -80,8 +80,8 @@ elf32_generic_link_add_symbols (abfd, info)
Elf_Internal_Ehdr *ehdrp; Elf_Internal_Ehdr *ehdrp;
ehdrp = elf_elfheader (abfd); ehdrp = elf_elfheader (abfd);
(*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"), (*_bfd_error_handler) (_("%B: Relocations in generic ELF (EM: %d)"),
bfd_archive_filename (abfd), abfd,
ehdrp->e_machine); ehdrp->e_machine);
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);

View file

@ -539,8 +539,8 @@ hppa_add_stub (const char *stub_name,
TRUE, FALSE); TRUE, FALSE);
if (stub_entry == NULL) if (stub_entry == NULL)
{ {
(*_bfd_error_handler) (_("%s: cannot create stub entry %s"), (*_bfd_error_handler) (_("%B: cannot create stub entry %s"),
bfd_archive_filename (section->owner), section->owner,
stub_name); stub_name);
return NULL; return NULL;
} }
@ -792,9 +792,9 @@ hppa_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
|| sym_value - 8 + (1 << (22 + 1)) >= (1 << (22 + 2)))) || sym_value - 8 + (1 << (22 + 1)) >= (1 << (22 + 2))))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"), (_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
bfd_archive_filename (stub_entry->target_section->owner), stub_entry->target_section->owner,
stub_sec->name, stub_sec,
(long) stub_entry->stub_offset, (long) stub_entry->stub_offset,
stub_entry->root.string); stub_entry->root.string);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -1172,8 +1172,8 @@ elf32_hppa_check_relocs (bfd *abfd,
if (info->shared) if (info->shared)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"), (_("%B: relocation %s can not be used when making a shared object; recompile with -fPIC"),
bfd_archive_filename (abfd), abfd,
elf_hppa_howto_table[r_type].name); elf_hppa_howto_table[r_type].name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
@ -1192,8 +1192,8 @@ elf32_hppa_check_relocs (bfd *abfd,
if (info->shared) if (info->shared)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s should not be used when making a shared object; recompile with -fPIC"), (_("%B: relocation %s should not be used when making a shared object; recompile with -fPIC"),
bfd_archive_filename (abfd), abfd,
elf_hppa_howto_table[r_type].name); elf_hppa_howto_table[r_type].name);
} }
/* Fall through. */ /* Fall through. */
@ -2573,8 +2573,8 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info)
} }
else else
{ {
(*_bfd_error_handler) (_("%s: duplicate export stub %s"), (*_bfd_error_handler) (_("%B: duplicate export stub %s"),
bfd_archive_filename (input_bfd), input_bfd,
stub_name); stub_name);
} }
} }
@ -3164,9 +3164,9 @@ final_link_relocate (asection *input_section,
and convert the associated add instruction, so issue an and convert the associated add instruction, so issue an
error. */ error. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"), (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
bfd_archive_filename (input_bfd), input_bfd,
input_section->name, input_section,
(long) rel->r_offset, (long) rel->r_offset,
howto->name, howto->name,
insn); insn);
@ -3194,9 +3194,9 @@ final_link_relocate (asection *input_section,
insn &= ~ (0x1f << 21); insn &= ~ (0x1f << 21);
#if 0 /* debug them. */ #if 0 /* debug them. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): fixing %s"), (_("%B(%A+0x%lx): fixing %s"),
bfd_archive_filename (input_bfd), input_bfd,
input_section->name, input_section,
(long) rel->r_offset, (long) rel->r_offset,
howto->name); howto->name);
#endif #endif
@ -3317,9 +3317,9 @@ final_link_relocate (asection *input_section,
&& value + addend + max_branch_offset >= 2*max_branch_offset) && value + addend + max_branch_offset >= 2*max_branch_offset)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"), (_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
bfd_archive_filename (input_bfd), input_bfd,
input_section->name, input_section,
(long) rel->r_offset, (long) rel->r_offset,
stub_entry->root.string); stub_entry->root.string);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -3812,9 +3812,9 @@ elf32_hppa_relocate_section (bfd *output_bfd,
if (r == bfd_reloc_notsupported || !warned_undef) if (r == bfd_reloc_notsupported || !warned_undef)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): cannot handle %s for %s"), (_("%B(%A+0x%lx): cannot handle %s for %s"),
bfd_archive_filename (input_bfd), input_bfd,
input_section->name, input_section,
(long) rel->r_offset, (long) rel->r_offset,
howto->name, howto->name,
sym_name); sym_name);

View file

@ -367,8 +367,8 @@ i370_elf_merge_private_bfd_data (ibfd, obfd)
else /* Incompatible flags */ else /* Incompatible flags */
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)", ("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); ibfd, (long) new_flags, (long) old_flags);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
@ -891,9 +891,8 @@ i370_elf_check_relocs (abfd, info, sec, relocs)
return TRUE; return TRUE;
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, "i370_elf_check_relocs called for section %s in %s\n", _bfd_error_handler ("i370_elf_check_relocs called for section %A in %B",
bfd_get_section_name (abfd, sec), sec, abfd);
bfd_archive_filename (abfd));
#endif #endif
dynobj = elf_hash_table (info)->dynobj; dynobj = elf_hash_table (info)->dynobj;
@ -1156,9 +1155,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
return TRUE; return TRUE;
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, "i370_elf_relocate_section called for %s section %s, %ld relocations%s\n", _bfd_error_handler ("i370_elf_relocate_section called for %B section %A, %ld relocations%s",
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_section_name(input_bfd, input_section),
(long) input_section->reloc_count, (long) input_section->reloc_count,
(info->relocatable) ? " (relocatable)" : ""); (info->relocatable) ? " (relocatable)" : "");
#endif #endif
@ -1186,8 +1184,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if ((unsigned)r_type >= (unsigned)R_I370_max if ((unsigned)r_type >= (unsigned)R_I370_max
|| !i370_elf_howto_table[(int)r_type]) || !i370_elf_howto_table[(int)r_type])
{ {
(*_bfd_error_handler) ("%s: unknown relocation type %d", (*_bfd_error_handler) ("%B: unknown relocation type %d",
bfd_archive_filename (input_bfd), input_bfd,
(int) r_type); (int) r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -1262,9 +1260,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: unknown relocation type %d for symbol %s", ("%B: unknown relocation type %d for symbol %s",
bfd_archive_filename (input_bfd), input_bfd, (int) r_type, sym_name);
(int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret = FALSE; ret = FALSE;
@ -1405,8 +1402,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case (int)R_I370_COPY: case (int)R_I370_COPY:
case (int)R_I370_RELATIVE: case (int)R_I370_RELATIVE:
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: Relocation %s is not yet supported for symbol %s.", ("%B: Relocation %s is not yet supported for symbol %s.",
bfd_archive_filename (input_bfd), input_bfd,
i370_elf_howto_table[(int) r_type]->name, i370_elf_howto_table[(int) r_type]->name,
sym_name); sym_name);

View file

@ -323,8 +323,8 @@ elf_i386_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
&& ((indx = r_type - R_386_vt_offset) - R_386_tls && ((indx = r_type - R_386_vt_offset) - R_386_tls
>= R_386_vt - R_386_tls)) >= R_386_vt - R_386_tls))
{ {
(*_bfd_error_handler) (_("%s: invalid relocation type %d"), (*_bfd_error_handler) (_("%B: invalid relocation type %d"),
bfd_archive_filename (abfd), (int) r_type); abfd, (int) r_type);
indx = R_386_NONE; indx = R_386_NONE;
} }
cache_ptr->howto = &elf_howto_table[indx]; cache_ptr->howto = &elf_howto_table[indx];
@ -861,8 +861,8 @@ elf_i386_check_relocs (bfd *abfd,
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{ {
(*_bfd_error_handler) (_("%s: bad symbol index: %d"), (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
bfd_archive_filename (abfd), abfd,
r_symndx); r_symndx);
return FALSE; return FALSE;
} }
@ -969,9 +969,9 @@ elf_i386_check_relocs (bfd *abfd,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: `%s' accessed both as normal and " (_("%B: `%s' accessed both as normal and "
"thread local symbol"), "thread local symbol"),
bfd_archive_filename (abfd), abfd,
h ? h->root.root.string : "<local>"); h ? h->root.root.string : "<local>");
return FALSE; return FALSE;
} }
@ -1086,8 +1086,8 @@ elf_i386_check_relocs (bfd *abfd,
name + 4) != 0) name + 4) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad relocation section name `%s\'"), (_("%B: bad relocation section name `%s\'"),
bfd_archive_filename (abfd), name); abfd, name);
} }
if (htab->elf.dynobj == NULL) if (htab->elf.dynobj == NULL)
@ -2039,13 +2039,9 @@ elf_i386_relocate_section (bfd *output_bfd,
&& ((indx = r_type - R_386_tls_offset) - R_386_ext && ((indx = r_type - R_386_tls_offset) - R_386_ext
>= R_386_tls - R_386_ext)) >= R_386_tls - R_386_ext))
{ {
char *name = bfd_get_section_ident (input_section);
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unrecognized relocation (0x%x) in section `%s'"), (_("%B: unrecognized relocation (0x%x) in section `%A'"),
bfd_archive_filename (input_bfd), r_type, input_bfd, input_section, r_type);
name ? name : input_section->name);
if (name)
free (name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -2908,9 +2904,9 @@ elf_i386_relocate_section (bfd *output_bfd,
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
h->root.root.string); h->root.root.string);
return FALSE; return FALSE;
@ -2947,9 +2943,8 @@ elf_i386_relocate_section (bfd *output_bfd,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): reloc against `%s': error %d"), (_("%B(%A+0x%lx): reloc against `%s': error %d"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, name, (int) r); (long) rel->r_offset, name, (int) r);
return FALSE; return FALSE;
} }

View file

@ -2606,8 +2606,8 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
r_type = ELF32_R_TYPE (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info);
if (r_type < 0 || r_type >= (int) R_M32R_max) if (r_type < 0 || r_type >= (int) R_M32R_max)
{ {
(*_bfd_error_handler) (_("%s: unknown relocation type %d"), (*_bfd_error_handler) (_("%B: unknown relocation type %d"),
bfd_archive_filename (input_bfd), input_bfd,
(int) r_type); (int) r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret = FALSE; ret = FALSE;
@ -3195,11 +3195,11 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: The target (%s) of an %s relocation is in the wrong section (%s)"), (_("%B: The target (%s) of an %s relocation is in the wrong section (%A)"),
bfd_archive_filename (input_bfd), input_bfd,
sec,
sym_name, sym_name,
m32r_elf_howto_table[(int) r_type].name, m32r_elf_howto_table[(int) r_type].name);
bfd_get_section_name (abfd, sec));
/*bfd_set_error (bfd_error_bad_value); ??? why? */ /*bfd_set_error (bfd_error_bad_value); ??? why? */
ret = FALSE; ret = FALSE;
continue; continue;
@ -4262,8 +4262,7 @@ m32r_elf_merge_private_bfd_data (ibfd, obfd)
|| ((in_flags & EF_M32R_ARCH) == E_M32R2_ARCH)) || ((in_flags & EF_M32R_ARCH) == E_M32R2_ARCH))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Instruction set mismatch with previous modules"), (_("%B: Instruction set mismatch with previous modules"), ibfd);
bfd_archive_filename (ibfd));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;

View file

@ -158,9 +158,8 @@ m68hc12_add_stub (const char *stub_name, asection *section,
TRUE, FALSE); TRUE, FALSE);
if (stub_entry == NULL) if (stub_entry == NULL)
{ {
(*_bfd_error_handler) (_("%s: cannot create stub entry %s"), (*_bfd_error_handler) (_("%B: cannot create stub entry %s"),
bfd_archive_filename (section->owner), section->owner, stub_name);
stub_name);
return NULL; return NULL;
} }
@ -1274,17 +1273,15 @@ _bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32)) if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking files compiled for 16-bit integers (-mshort) " (_("%B: linking files compiled for 16-bit integers (-mshort) "
"and others for 32-bit integers"), "and others for 32-bit integers"), ibfd);
bfd_archive_filename (ibfd));
ok = FALSE; ok = FALSE;
} }
if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64)) if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking files compiled for 32-bit double (-fshort-double) " (_("%B: linking files compiled for 32-bit double (-fshort-double) "
"and others for 64-bit double"), "and others for 64-bit double"), ibfd);
bfd_archive_filename (ibfd));
ok = FALSE; ok = FALSE;
} }
@ -1292,9 +1289,8 @@ _bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (!EF_M68HC11_CAN_MERGE_MACH (new_flags, old_flags)) if (!EF_M68HC11_CAN_MERGE_MACH (new_flags, old_flags))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking files compiled for HCS12 with " (_("%B: linking files compiled for HCS12 with "
"others compiled for HC12"), "others compiled for HC12"), ibfd);
bfd_archive_filename (ibfd));
ok = FALSE; ok = FALSE;
} }
new_flags = ((new_flags & ~EF_M68HC11_MACH_MASK) new_flags = ((new_flags & ~EF_M68HC11_MACH_MASK)
@ -1309,9 +1305,8 @@ _bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (new_flags != old_flags) if (new_flags != old_flags)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
bfd_archive_filename (ibfd), (unsigned long) new_flags, ibfd, (unsigned long) new_flags, (unsigned long) old_flags);
(unsigned long) old_flags);
ok = FALSE; ok = FALSE;
} }

View file

@ -1705,9 +1705,9 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
h->root.root.string); h->root.root.string);
return FALSE; return FALSE;
@ -1744,9 +1744,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): reloc against `%s': error %d"), (_("%B(%A+0x%lx): reloc against `%s': error %d"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, name, (int) r); (long) rel->r_offset, name, (int) r);
return FALSE; return FALSE;
} }

View file

@ -350,8 +350,8 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
{ {
BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0); BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
_bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"), _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"),
bfd_archive_filename (abfd), abfd,
reloc_entry->howto->name, reloc_entry->howto->name,
reloc_entry->howto->type); reloc_entry->howto->type);
@ -406,10 +406,10 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_boolean ret = TRUE; bfd_boolean ret = TRUE;
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, _bfd_error_handler
"mcore_elf_relocate_section called for %s section %s, %ld relocations%s\n", ("mcore_elf_relocate_section called for %B section %A, %ld relocations%s",
bfd_archive_filename (input_bfd), input_bfd,
bfd_section_name(input_bfd, input_section), input_section,
(long) input_section->reloc_count, (long) input_section->reloc_count,
(info->relocatable) ? " (relocatable)" : ""); (info->relocatable) ? " (relocatable)" : "");
#endif #endif
@ -438,9 +438,8 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if ((unsigned) r_type >= (unsigned) R_MCORE_max if ((unsigned) r_type >= (unsigned) R_MCORE_max
|| ! mcore_elf_howto_table [(int)r_type]) || ! mcore_elf_howto_table [(int)r_type])
{ {
_bfd_error_handler (_("%s: Unknown relocation type %d\n"), _bfd_error_handler (_("%B: Unknown relocation type %d\n"),
bfd_archive_filename (input_bfd), input_bfd, (int) r_type);
(int) r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret = FALSE; ret = FALSE;
@ -453,8 +452,8 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Complain about known relocation that are not yet supported. */ /* Complain about known relocation that are not yet supported. */
if (howto->special_function == mcore_elf_unsupported_reloc) if (howto->special_function == mcore_elf_unsupported_reloc)
{ {
_bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"), _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"),
bfd_archive_filename (input_bfd), input_bfd,
howto->name, howto->name,
(int)r_type); (int)r_type);

View file

@ -2282,18 +2282,16 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
{ {
error = TRUE; error = TRUE;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: compiled with -mrelocatable and linked with " (_("%B: compiled with -mrelocatable and linked with "
"modules compiled normally"), "modules compiled normally"), ibfd);
bfd_archive_filename (ibfd));
} }
else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0 else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0
&& (old_flags & EF_PPC_RELOCATABLE) != 0) && (old_flags & EF_PPC_RELOCATABLE) != 0)
{ {
error = TRUE; error = TRUE;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: compiled normally and linked with " (_("%B: compiled normally and linked with "
"modules compiled with -mrelocatable"), "modules compiled with -mrelocatable"), ibfd);
bfd_archive_filename (ibfd));
} }
/* The output is -mrelocatable-lib iff both the input files are. */ /* The output is -mrelocatable-lib iff both the input files are. */
@ -2319,9 +2317,9 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
{ {
error = TRUE; error = TRUE;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: uses different e_flags (0x%lx) fields " (_("%B: uses different e_flags (0x%lx) fields "
"than previous modules (0x%lx)"), "than previous modules (0x%lx)"),
bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); ibfd, (long) new_flags, (long) old_flags);
} }
if (error) if (error)
@ -3561,8 +3559,8 @@ static void
bad_shared_reloc (bfd *abfd, enum elf_ppc_reloc_type r_type) bad_shared_reloc (bfd *abfd, enum elf_ppc_reloc_type r_type)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s cannot be used when making a shared object"), (_("%B: relocation %s cannot be used when making a shared object"),
bfd_archive_filename (abfd), abfd,
ppc_elf_howto_table[r_type]->name); ppc_elf_howto_table[r_type]->name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
} }
@ -3588,9 +3586,8 @@ ppc_elf_check_relocs (bfd *abfd,
return TRUE; return TRUE;
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, "ppc_elf_check_relocs called for section %s in %s\n", _bfd_error_handler ("ppc_elf_check_relocs called for section %A in %B",
bfd_get_section_name (abfd, sec), sec, abfd);
bfd_archive_filename (abfd));
#endif #endif
/* Initialize howto table if not already done. */ /* Initialize howto table if not already done. */
@ -3767,10 +3764,10 @@ ppc_elf_check_relocs (bfd *abfd,
{ {
/* It does not make sense to have a procedure linkage /* It does not make sense to have a procedure linkage
table entry for a local symbol. */ table entry for a local symbol. */
(*_bfd_error_handler) (_("%s(%s+0x%lx): %s reloc against " (*_bfd_error_handler) (_("%B(%A+0x%lx): %s reloc against "
"local symbol"), "local symbol"),
bfd_archive_filename (abfd), abfd,
sec->name, sec,
(long) rel->r_offset, (long) rel->r_offset,
ppc_elf_howto_table[r_type]->name); ppc_elf_howto_table[r_type]->name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -4664,10 +4661,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
bfd_boolean ret = TRUE; bfd_boolean ret = TRUE;
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, " _bfd_error_handler ("ppc_elf_relocate_section called for %B section %A, "
"%ld relocations%s\n", "%ld relocations%s",
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_section_name(input_bfd, input_section),
(long) input_section->reloc_count, (long) input_section->reloc_count,
(info->relocatable) ? " (relocatable)" : ""); (info->relocatable) ? " (relocatable)" : "");
#endif #endif
@ -4972,8 +4968,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
{ {
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unknown relocation type %d for symbol %s"), (_("%B: unknown relocation type %d for symbol %s"),
bfd_archive_filename (input_bfd), (int) r_type, sym_name); input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret = FALSE; ret = FALSE;
@ -5223,9 +5219,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
got at entry m+n bears little relation to the entry m. */ got at entry m+n bears little relation to the entry m. */
if (addend != 0) if (addend != 0)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): non-zero addend on %s reloc against `%s'"), (_("%B(%A+0x%lx): non-zero addend on %s reloc against `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
howto->name, howto->name,
sym_name); sym_name);
@ -5534,9 +5530,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
&& (name[5] == 0 || name[5] == '.')))) && (name[5] == 0 || name[5] == '.'))))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: the target (%s) of a %s relocation is " (_("%B: the target (%s) of a %s relocation is "
"in the wrong output section (%s)"), "in the wrong output section (%s)"),
bfd_archive_filename (input_bfd), input_bfd,
sym_name, sym_name,
howto->name, howto->name,
name); name);
@ -5560,9 +5556,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
|| strncmp (name, ".sbss2", 6) == 0)) || strncmp (name, ".sbss2", 6) == 0))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: the target (%s) of a %s relocation is " (_("%B: the target (%s) of a %s relocation is "
"in the wrong output section (%s)"), "in the wrong output section (%s)"),
bfd_archive_filename (input_bfd), input_bfd,
sym_name, sym_name,
howto->name, howto->name,
name); name);
@ -5619,9 +5615,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: the target (%s) of a %s relocation is " (_("%B: the target (%s) of a %s relocation is "
"in the wrong output section (%s)"), "in the wrong output section (%s)"),
bfd_archive_filename (input_bfd), input_bfd,
sym_name, sym_name,
howto->name, howto->name,
name); name);
@ -5674,8 +5670,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
case R_PPC_EMB_RELST_HA: case R_PPC_EMB_RELST_HA:
case R_PPC_EMB_BIT_FLD: case R_PPC_EMB_BIT_FLD:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s is not yet supported for symbol %s."), (_("%B: relocation %s is not yet supported for symbol %s."),
bfd_archive_filename (input_bfd), input_bfd,
howto->name, howto->name,
sym_name); sym_name);
@ -5729,9 +5725,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
howto->name, howto->name,
sym_name); sym_name);
@ -5779,9 +5775,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): %s reloc against `%s': error %d"), (_("%B(%A+0x%lx): %s reloc against `%s': error %d"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, howto->name, sym_name, (int) r); (long) rel->r_offset, howto->name, sym_name, (int) r);
ret = FALSE; ret = FALSE;
} }
@ -6023,20 +6018,20 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info)
length = asec->size; length = asec->size;
if (length < 24) if (length < 24)
{ {
error_message = _("corrupt or empty %s section in %s"); error_message = _("corrupt or empty %s section in %B");
goto fail; goto fail;
} }
if (bfd_seek (ibfd, asec->filepos, SEEK_SET) != 0 if (bfd_seek (ibfd, asec->filepos, SEEK_SET) != 0
|| (bfd_bread (buffer + offset, length, ibfd) != length)) || (bfd_bread (buffer + offset, length, ibfd) != length))
{ {
error_message = _("unable to read in %s section from %s"); error_message = _("unable to read in %s section from %B");
goto fail; goto fail;
} }
/* Process the contents of the section. */ /* Process the contents of the section. */
ptr = buffer + offset; ptr = buffer + offset;
error_message = _("corrupt %s section in %s"); error_message = _("corrupt %s section in %B");
/* Verify the contents of the header. Note - we have to /* Verify the contents of the header. Note - we have to
extract the values this way in order to allow for a extract the values this way in order to allow for a
@ -6079,14 +6074,13 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info)
if (! bfd_set_section_size (abfd, asec, output_section_size)) if (! bfd_set_section_size (abfd, asec, output_section_size))
ibfd = abfd, ibfd = abfd,
error_message = _("warning: unable to set size of %s section in %s"); error_message = _("warning: unable to set size of %s section in %B");
fail: fail:
free (buffer); free (buffer);
if (error_message) if (error_message)
(*_bfd_error_handler) (error_message, APUINFO_SECTION_NAME, (*_bfd_error_handler) (error_message, ibfd, APUINFO_SECTION_NAME);
bfd_archive_filename (ibfd));
} }

View file

@ -980,9 +980,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{ {
(*_bfd_error_handler) (_("%s: bad symbol index: %d"), (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
bfd_archive_filename (abfd), abfd, r_symndx);
r_symndx);
return FALSE; return FALSE;
} }
@ -1158,8 +1157,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL) if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: `%s' accessed both as normal and thread local symbol"), (_("%B: `%s' accessed both as normal and thread local symbol"),
bfd_archive_filename (abfd), h->root.root.string); abfd, h->root.root.string);
return FALSE; return FALSE;
} }
if (old_tls_type > tls_type) if (old_tls_type > tls_type)
@ -1269,8 +1268,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
name + 5) != 0) name + 5) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad relocation section name `%s\'"), (_("%B: bad relocation section name `%s\'"),
bfd_archive_filename (abfd), name); abfd, name);
} }
if (htab->elf.dynobj == NULL) if (htab->elf.dynobj == NULL)
@ -2231,9 +2230,9 @@ invalid_tls_insn (input_bfd, input_section, rel)
howto = elf_howto_table + ELF32_R_TYPE (rel->r_info); howto = elf_howto_table + ELF32_R_TYPE (rel->r_info);
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): invalid instruction for TLS relocation %s"), (_("%B(%A+0x%lx): invalid instruction for TLS relocation %s"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
howto->name); howto->name);
} }
@ -2993,9 +2992,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& !((input_section->flags & SEC_DEBUGGING) != 0 && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
h->root.root.string); h->root.root.string);
@ -3043,9 +3042,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): reloc against `%s': error %d"), (_("%B(%A+0x%lx): reloc against `%s': error %d"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, name, (int) r); (long) rel->r_offset, name, (int) r);
return FALSE; return FALSE;
} }

View file

@ -125,8 +125,8 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd,
return TRUE; return TRUE;
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
_bfd_error_handler (_("%s: IMPORT AS directive for %s conceals previous IMPORT AS"), _bfd_error_handler (_("%B: IMPORT AS directive for %s conceals previous IMPORT AS"),
bfd_archive_filename (abfd), current_name); abfd, current_name);
return FALSE; return FALSE;
} }
@ -377,8 +377,8 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
fprintf (stderr, "offset into .directive section: %d\n", directive - contents); fprintf (stderr, "offset into .directive section: %d\n", directive - contents);
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
_bfd_error_handler (_("%s: Unrecognised .directive command: %s"), _bfd_error_handler (_("%B: Unrecognised .directive command: %s"),
bfd_archive_filename (abfd), directive); abfd, directive);
break; break;
} }
} }
@ -495,8 +495,8 @@ sh_symbian_relocate_section (bfd * output_bfd,
& new_value, & new_hash, & skip, & override, & type_change_ok, & new_value, & new_hash, & skip, & override, & type_change_ok,
& size_change_ok)) & size_change_ok))
{ {
_bfd_error_handler (_("%s: Failed to add renamed symbol %s"), _bfd_error_handler (_("%B: Failed to add renamed symbol %s"),
bfd_archive_filename (input_bfd), ptr->new_name); input_bfd, ptr->new_name);
continue; continue;
} }
/* XXX - should we check psec, skip, override etc ? */ /* XXX - should we check psec, skip, override etc ? */

View file

@ -2242,8 +2242,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
laddr = irel->r_offset + 4 + irel->r_addend; laddr = irel->r_offset + 4 + irel->r_addend;
if (laddr >= sec->size) if (laddr >= sec->size)
{ {
(*_bfd_error_handler) (_("%s: 0x%lx: warning: bad R_SH_USES offset"), (*_bfd_error_handler) (_("%B: 0x%lx: warning: bad R_SH_USES offset"),
bfd_archive_filename (abfd), abfd,
(unsigned long) irel->r_offset); (unsigned long) irel->r_offset);
continue; continue;
} }
@ -2254,8 +2254,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
if ((insn & 0xf000) != 0xd000) if ((insn & 0xf000) != 0xd000)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"), (_("%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"),
bfd_archive_filename (abfd), (unsigned long) irel->r_offset, insn)); abfd, (unsigned long) irel->r_offset, insn));
continue; continue;
} }
@ -2271,8 +2271,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
if (paddr >= sec->size) if (paddr >= sec->size)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: warning: bad R_SH_USES load offset"), (_("%B: 0x%lx: warning: bad R_SH_USES load offset"),
bfd_archive_filename (abfd), (unsigned long) irel->r_offset)); abfd, (unsigned long) irel->r_offset));
continue; continue;
} }
@ -2286,8 +2286,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
if (irelfn >= irelend) if (irelfn >= irelend)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: warning: could not find expected reloc"), (_("%B: 0x%lx: warning: could not find expected reloc"),
bfd_archive_filename (abfd), (unsigned long) paddr)); abfd, (unsigned long) paddr));
continue; continue;
} }
@ -2314,8 +2314,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
!= (unsigned int) _bfd_elf_section_from_bfd_section (abfd, sec)) != (unsigned int) _bfd_elf_section_from_bfd_section (abfd, sec))
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: warning: symbol in unexpected section"), (_("%B: 0x%lx: warning: symbol in unexpected section"),
bfd_archive_filename (abfd), (unsigned long) paddr)); abfd, (unsigned long) paddr));
continue; continue;
} }
@ -2439,8 +2439,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
if (irelcount >= irelend) if (irelcount >= irelend)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: warning: could not find expected COUNT reloc"), (_("%B: 0x%lx: warning: could not find expected COUNT reloc"),
bfd_archive_filename (abfd), (unsigned long) paddr)); abfd, (unsigned long) paddr));
continue; continue;
} }
@ -2448,8 +2448,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
just deleted one. */ just deleted one. */
if (irelcount->r_addend == 0) if (irelcount->r_addend == 0)
{ {
((*_bfd_error_handler) (_("%s: 0x%lx: warning: bad count"), ((*_bfd_error_handler) (_("%B: 0x%lx: warning: bad count"),
bfd_archive_filename (abfd), abfd,
(unsigned long) paddr)); (unsigned long) paddr));
continue; continue;
} }
@ -2843,8 +2843,8 @@ sh_elf_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr,
if (overflow) if (overflow)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: fatal: reloc overflow while relaxing"), (_("%B: 0x%lx: fatal: reloc overflow while relaxing"),
bfd_archive_filename (abfd), (unsigned long) irel->r_offset)); abfd, (unsigned long) irel->r_offset));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -3213,8 +3213,8 @@ sh_elf_swap_insns (bfd *abfd, asection *sec, void *relocs,
if (overflow) if (overflow)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: fatal: reloc overflow while relaxing"), (_("%B: 0x%lx: fatal: reloc overflow while relaxing"),
bfd_archive_filename (abfd), (unsigned long) irel->r_offset)); abfd, (unsigned long) irel->r_offset));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -4795,9 +4795,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
if (howto->rightshift || howto->src_mask != 0xffffffff) if (howto->rightshift || howto->src_mask != 0xffffffff)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"), (_("%B(%A+0x%lx): %s relocation against SEC_MERGE section"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, howto->name); (long) rel->r_offset, howto->name);
return FALSE; return FALSE;
} }
@ -4900,9 +4899,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
else if (sec->output_section == NULL) else if (sec->output_section == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unresolvable relocation against symbol `%s' from %s section"), (_("%B(%A): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), h->root.root.string, input_bfd, input_section, h->root.root.string);
bfd_get_section_name (input_bfd, input_section));
return FALSE; return FALSE;
} }
else else
@ -4971,8 +4969,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
if (disp & mask) if (disp & mask)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: fatal: unaligned branch target for relax-support relocation"), (_("%B: 0x%lx: fatal: unaligned branch target for relax-support relocation"),
bfd_archive_filename (input_section->owner), input_section->owner,
(unsigned long) rel->r_offset)); (unsigned long) rel->r_offset));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
@ -5004,10 +5002,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
if (relocation & 3) if (relocation & 3)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: fatal: unaligned %s relocation 0x%lx"), (_("%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"),
bfd_archive_filename (input_section->owner), input_section->owner,
(unsigned long) rel->r_offset, howto->name, (unsigned long) rel->r_offset, howto->name,
(unsigned long)relocation)); (unsigned long) relocation));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -5019,10 +5017,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
if (relocation & 1) if (relocation & 1)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: fatal: unaligned %s relocation 0x%lx"), (_("%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"),
bfd_archive_filename (input_section->owner), input_section->owner,
(unsigned long) rel->r_offset, howto->name, (unsigned long) rel->r_offset, howto->name,
(unsigned long)relocation)); (unsigned long) relocation));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -5033,10 +5031,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|| (signed int)relocation > 32) || (signed int)relocation > 32)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"), (_("%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"),
bfd_archive_filename (input_section->owner), input_section->owner,
(unsigned long) rel->r_offset, (unsigned long) rel->r_offset,
(unsigned long)relocation)); (unsigned long) relocation));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -5047,10 +5045,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|| (signed int)relocation > 16) || (signed int)relocation > 16)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
(_("%s: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"), (_("%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"),
bfd_archive_filename (input_section->owner), input_section->owner,
(unsigned long) rel->r_offset, (unsigned long) rel->r_offset,
(unsigned long)relocation)); (unsigned long) relocation));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -6577,8 +6575,8 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: `%s' accessed both as normal and thread local symbol"), (_("%B: `%s' accessed both as normal and thread local symbol"),
bfd_archive_filename (abfd), h->root.root.string); abfd, h->root.root.string);
return FALSE; return FALSE;
} }
} }
@ -6789,8 +6787,9 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
case R_SH_TLS_LE_32: case R_SH_TLS_LE_32:
if (info->shared) if (info->shared)
{ {
(*_bfd_error_handler) (_("%s: TLS local exec code cannot be linked into shared objects"), (*_bfd_error_handler)
bfd_archive_filename (abfd)); (_("%B: TLS local exec code cannot be linked into shared objects"),
abfd);
return FALSE; return FALSE;
} }
@ -6914,9 +6913,9 @@ sh_elf_merge_private_data (bfd *ibfd, bfd *obfd)
if (! sh_merge_bfd_arch (ibfd, obfd)) if (! sh_merge_bfd_arch (ibfd, obfd))
{ {
_bfd_error_handler ("%s: uses instructions which are incompatible " _bfd_error_handler ("%B: uses instructions which are incompatible "
"with instructions used in previous modules", "with instructions used in previous modules",
bfd_archive_filename (ibfd)); ibfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }

View file

@ -913,9 +913,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{ {
(*_bfd_error_handler) (_("%s: bad symbol index: %d"), (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
bfd_archive_filename (abfd), abfd, r_symndx);
r_symndx);
return FALSE; return FALSE;
} }
@ -1037,9 +1036,8 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: `%s' accessed both as normal and thread local symbol"), (_("%B: `%s' accessed both as normal and thread local symbol"),
bfd_archive_filename (abfd), abfd, h ? h->root.root.string : "<local>");
h ? h->root.root.string : "<local>");
return FALSE; return FALSE;
} }
} }
@ -2495,8 +2493,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
BFD_FAIL (); BFD_FAIL ();
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: probably compiled without -fPIC?"), (_("%B: probably compiled without -fPIC?"),
bfd_archive_filename (input_bfd)); input_bfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -2853,9 +2851,9 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
&& !((input_section->flags & SEC_DEBUGGING) != 0 && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
h->root.root.string); h->root.root.string);
@ -3318,8 +3316,7 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
{ {
error = TRUE; error = TRUE;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: compiled for a 64 bit system and target is 32 bit"), (_("%B: compiled for a 64 bit system and target is 32 bit"), ibfd);
bfd_archive_filename (ibfd));
} }
else if ((ibfd->flags & DYNAMIC) == 0) else if ((ibfd->flags & DYNAMIC) == 0)
{ {
@ -3332,8 +3329,7 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
&& previous_ibfd_e_flags != (unsigned long) -1) && previous_ibfd_e_flags != (unsigned long) -1)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking little endian files with big endian files"), (_("%B: linking little endian files with big endian files"), ibfd);
bfd_archive_filename (ibfd));
error = TRUE; error = TRUE;
} }
previous_ibfd_e_flags = elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA; previous_ibfd_e_flags = elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA;

View file

@ -656,9 +656,8 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
return TRUE; return TRUE;
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, "v850_elf_check_relocs called for section %s in %s\n", _bfd_error_handler ("v850_elf_check_relocs called for section %A in %B",
bfd_get_section_name (abfd, sec), sec, abfd);
bfd_archive_filename (abfd));
#endif #endif
dynobj = elf_hash_table (info)->dynobj; dynobj = elf_hash_table (info)->dynobj;
@ -1948,8 +1947,8 @@ v850_elf_merge_private_bfd_data (ibfd, obfd)
return TRUE; return TRUE;
} }
_bfd_error_handler (_("%s: Architecture mismatch with previous modules"), _bfd_error_handler (_("%B: Architecture mismatch with previous modules"),
bfd_archive_filename (ibfd)); ibfd);
} }
return TRUE; return TRUE;

View file

@ -641,9 +641,8 @@ elf_xtensa_check_relocs (abfd, info, sec, relocs)
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{ {
(*_bfd_error_handler) (_("%s: bad symbol index: %d"), (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
bfd_archive_filename (abfd), abfd, r_symndx);
r_symndx);
return FALSE; return FALSE;
} }
@ -2103,9 +2102,9 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd,
&& !((input_section->flags & SEC_DEBUGGING) != 0 && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
h->root.root.string); h->root.root.string);
@ -2523,8 +2522,8 @@ elf_xtensa_merge_private_bfd_data (ibfd, obfd)
if (out_mach != in_mach) if (out_mach != in_mach)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: incompatible machine type. Output is 0x%x. Input is 0x%x", ("%B: incompatible machine type. Output is 0x%x. Input is 0x%x",
bfd_archive_filename (ibfd), out_mach, in_mach); ibfd, out_mach, in_mach);
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return FALSE; return FALSE;
} }

View file

@ -1257,8 +1257,8 @@ elf64_alpha_relax_with_lituse (info, symval, irel)
if (lit_insn >> 26 != OP_LDQ) if (lit_insn >> 26 != OP_LDQ)
{ {
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn", ("%B: %A+0x%lx: warning: LITERAL relocation against unexpected insn",
bfd_archive_filename (info->abfd), info->sec->name, info->abfd, info->sec,
(unsigned long) irel->r_offset)); (unsigned long) irel->r_offset));
return TRUE; return TRUE;
} }
@ -1570,8 +1570,8 @@ elf64_alpha_relax_got_load (info, symval, irel, r_type)
{ {
reloc_howto_type *howto = elf64_alpha_howto_table + r_type; reloc_howto_type *howto = elf64_alpha_howto_table + r_type;
((*_bfd_error_handler) ((*_bfd_error_handler)
("%s: %s+0x%lx: warning: %s relocation against unexpected insn", ("%B: %A+0x%lx: warning: %s relocation against unexpected insn",
bfd_archive_filename (info->abfd), info->sec->name, info->abfd, info->sec,
(unsigned long) irel->r_offset, howto->name)); (unsigned long) irel->r_offset, howto->name));
return TRUE; return TRUE;
} }
@ -3638,9 +3638,8 @@ elf64_alpha_size_got_sections (info)
{ {
/* Yikes! A single object file has too many entries. */ /* Yikes! A single object file has too many entries. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: .got subsegment exceeds 64K (size %d)"), (_("%B: .got subsegment exceeds 64K (size %d)"),
bfd_archive_filename (i), i, alpha_elf_tdata (this_got)->total_got_size);
alpha_elf_tdata (this_got)->total_got_size);
return FALSE; return FALSE;
} }
@ -4180,8 +4179,8 @@ elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section,
if (r_type >= R_ALPHA_max) if (r_type >= R_ALPHA_max)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unknown relocation type %d"), (_("%B: unknown relocation type %d"),
bfd_archive_filename (input_bfd), (int)r_type); input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret_val = FALSE; ret_val = FALSE;
continue; continue;
@ -4306,8 +4305,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (r_type >= R_ALPHA_max) if (r_type >= R_ALPHA_max)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unknown relocation type %d"), (_("%B: unknown relocation type %d"),
bfd_archive_filename (input_bfd), (int)r_type); input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret_val = FALSE; ret_val = FALSE;
continue; continue;
@ -4478,8 +4477,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (dynamic_symbol_p) if (dynamic_symbol_p)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: gp-relative relocation against dynamic symbol %s"), (_("%B: gp-relative relocation against dynamic symbol %s"),
bfd_archive_filename (input_bfd), h->root.root.root.string); input_bfd, h->root.root.root.string);
ret_val = FALSE; ret_val = FALSE;
} }
BFD_ASSERT(gp != 0); BFD_ASSERT(gp != 0);
@ -4490,8 +4489,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (dynamic_symbol_p) if (dynamic_symbol_p)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: gp-relative relocation against dynamic symbol %s"), (_("%B: gp-relative relocation against dynamic symbol %s"),
bfd_archive_filename (input_bfd), h->root.root.root.string); input_bfd, h->root.root.root.string);
ret_val = FALSE; ret_val = FALSE;
} }
BFD_ASSERT(gp != 0); BFD_ASSERT(gp != 0);
@ -4516,8 +4515,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (dynamic_symbol_p) if (dynamic_symbol_p)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: pc-relative relocation against dynamic symbol %s"), (_("%B: pc-relative relocation against dynamic symbol %s"),
bfd_archive_filename (input_bfd), h->root.root.root.string); input_bfd, h->root.root.root.string);
ret_val = FALSE; ret_val = FALSE;
} }
/* The regular PC-relative stuff measures from the start of /* The regular PC-relative stuff measures from the start of
@ -4544,8 +4543,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
&& gotobj != alpha_elf_tdata (sec->owner)->gotobj) && gotobj != alpha_elf_tdata (sec->owner)->gotobj)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: change in gp: BRSGP %s"), (_("%B: change in gp: BRSGP %s"),
bfd_archive_filename (input_bfd), h->root.root.root.string); input_bfd, h->root.root.root.string);
ret_val = FALSE; ret_val = FALSE;
} }
@ -4574,8 +4573,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
name = bfd_section_name (input_bfd, sec); name = bfd_section_name (input_bfd, sec);
} }
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: !samegp reloc against symbol without .prologue: %s"), (_("%B: !samegp reloc against symbol without .prologue: %s"),
bfd_archive_filename (input_bfd), name); input_bfd, name);
ret_val = FALSE; ret_val = FALSE;
break; break;
} }
@ -4625,8 +4624,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (r_type == R_ALPHA_REFLONG) if (r_type == R_ALPHA_REFLONG)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unhandled dynamic relocation against %s"), (_("%B: unhandled dynamic relocation against %s"),
bfd_archive_filename (input_bfd), input_bfd,
h->root.root.root.string); h->root.root.root.string);
ret_val = FALSE; ret_val = FALSE;
} }
@ -4649,8 +4648,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (dynamic_symbol_p) if (dynamic_symbol_p)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: pc-relative relocation against dynamic symbol %s"), (_("%B: pc-relative relocation against dynamic symbol %s"),
bfd_archive_filename (input_bfd), h->root.root.root.string); input_bfd, h->root.root.root.string);
ret_val = FALSE; ret_val = FALSE;
} }
@ -4708,8 +4707,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (dynamic_symbol_p) if (dynamic_symbol_p)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: dtp-relative relocation against dynamic symbol %s"), (_("%B: dtp-relative relocation against dynamic symbol %s"),
bfd_archive_filename (input_bfd), h->root.root.root.string); input_bfd, h->root.root.root.string);
ret_val = FALSE; ret_val = FALSE;
} }
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
@ -4724,15 +4723,15 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: TLS local exec code cannot be linked into shared objects"), (_("%B: TLS local exec code cannot be linked into shared objects"),
bfd_archive_filename (input_bfd)); input_bfd);
ret_val = FALSE; ret_val = FALSE;
} }
else if (dynamic_symbol_p) else if (dynamic_symbol_p)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: tp-relative relocation against dynamic symbol %s"), (_("%B: tp-relative relocation against dynamic symbol %s"),
bfd_archive_filename (input_bfd), h->root.root.root.string); input_bfd, h->root.root.root.string);
ret_val = FALSE; ret_val = FALSE;
} }
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);

View file

@ -80,9 +80,8 @@ elf64_generic_link_add_symbols (abfd, info)
Elf_Internal_Ehdr *ehdrp; Elf_Internal_Ehdr *ehdrp;
ehdrp = elf_elfheader (abfd); ehdrp = elf_elfheader (abfd);
(*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"), (*_bfd_error_handler) (_("%B: Relocations in generic ELF (EM: %d)"),
bfd_archive_filename (abfd), abfd, ehdrp->e_machine);
ehdrp->e_machine);
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return FALSE; return FALSE;

View file

@ -2432,13 +2432,13 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
const char *msg; const char *msg;
if (bfd_big_endian (ibfd)) if (bfd_big_endian (ibfd))
msg = _("%s: compiled for a big endian system " msg = _("%B: compiled for a big endian system "
"and target is little endian"); "and target is little endian");
else else
msg = _("%s: compiled for a little endian system " msg = _("%B: compiled for a little endian system "
"and target is big endian"); "and target is big endian");
(*_bfd_error_handler) (msg, bfd_archive_filename (ibfd)); (*_bfd_error_handler) (msg, ibfd);
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return FALSE; return FALSE;
@ -3205,9 +3205,8 @@ ppc_add_stub (const char *stub_name,
TRUE, FALSE); TRUE, FALSE);
if (stub_entry == NULL) if (stub_entry == NULL)
{ {
(*_bfd_error_handler) (_("%s: cannot create stub entry %s"), (*_bfd_error_handler) (_("%B: cannot create stub entry %s"),
bfd_archive_filename (section->owner), section->owner, stub_name);
stub_name);
return NULL; return NULL;
} }
@ -4175,8 +4174,8 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
name + 5) != 0) name + 5) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad relocation section name `%s\'"), (_("%B: bad relocation section name `%s\'"),
bfd_archive_filename (abfd), name); abfd, name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
} }
@ -5320,8 +5319,7 @@ ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info)
something silly in .opd with the assembler. No .opd something silly in .opd with the assembler. No .opd
optimization for them! */ optimization for them! */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: .opd is not a regular array of opd entries"), (_("%B: .opd is not a regular array of opd entries"), ibfd);
bfd_archive_filename (ibfd));
need_edit = FALSE; need_edit = FALSE;
break; break;
} }
@ -5330,8 +5328,8 @@ ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info)
|| (r_type = ELF64_R_TYPE ((rel + 1)->r_info)) != R_PPC64_TOC) || (r_type = ELF64_R_TYPE ((rel + 1)->r_info)) != R_PPC64_TOC)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unexpected reloc type %u in .opd section"), (_("%B: unexpected reloc type %u in .opd section"),
bfd_archive_filename (ibfd), r_type); ibfd, r_type);
need_edit = FALSE; need_edit = FALSE;
break; break;
} }
@ -5350,9 +5348,8 @@ ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info)
sym_name = bfd_elf_local_sym_name (ibfd, sym); sym_name = bfd_elf_local_sym_name (ibfd, sym);
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: undefined sym `%s' in .opd section"), (_("%B: undefined sym `%s' in .opd section"),
bfd_archive_filename (ibfd), ibfd, sym_name);
sym_name);
need_edit = FALSE; need_edit = FALSE;
break; break;
} }
@ -7913,10 +7910,10 @@ ppc64_elf_relocate_section (bfd *output_bfd,
else else
(*_bfd_error_handler) (*_bfd_error_handler)
(sym_type == STT_TLS (sym_type == STT_TLS
? _("%s(%s+0x%lx): %s used with TLS symbol %s") ? _("%B(%A+0x%lx): %s used with TLS symbol %s")
: _("%s(%s+0x%lx): %s used with non-TLS symbol %s"), : _("%B(%A+0x%lx): %s used with non-TLS symbol %s"),
bfd_archive_filename (input_bfd), input_bfd,
input_section->name, input_section,
(long) rel->r_offset, (long) rel->r_offset,
ppc64_elf_howto_table[r_type]->name, ppc64_elf_howto_table[r_type]->name,
sym_name); sym_name);
@ -8314,21 +8311,21 @@ ppc64_elf_relocate_section (bfd *output_bfd,
|| strcmp (input_section->output_section->name, || strcmp (input_section->output_section->name,
".fini") == 0) ".fini") == 0)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): automatic multiple TOCs " (_("%B(%A+0x%lx): automatic multiple TOCs "
"not supported using your crt files; " "not supported using your crt files; "
"recompile with -mminimal-toc or upgrade gcc"), "recompile with -mminimal-toc or upgrade gcc"),
bfd_archive_filename (input_bfd), input_bfd,
input_section->name, input_section,
(long) rel->r_offset); (long) rel->r_offset);
else else
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): sibling call optimization to `%s' " (_("%B(%A+0x%lx): sibling call optimization to `%s' "
"does not allow automatic multiple TOCs; " "does not allow automatic multiple TOCs; "
"recompile with -mminimal-toc or " "recompile with -mminimal-toc or "
"-fno-optimize-sibling-calls, " "-fno-optimize-sibling-calls, "
"or make `%s' extern"), "or make `%s' extern"),
bfd_archive_filename (input_bfd), input_bfd,
input_section->name, input_section,
(long) rel->r_offset, (long) rel->r_offset,
sym_name, sym_name,
sym_name); sym_name);
@ -8424,8 +8421,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
{ {
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unknown relocation type %d for symbol %s"), (_("%B: unknown relocation type %d for symbol %s"),
bfd_archive_filename (input_bfd), (int) r_type, sym_name); input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret = FALSE; ret = FALSE;
@ -8964,8 +8961,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
/* These ones haven't been implemented yet. */ /* These ones haven't been implemented yet. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s is not supported for symbol %s."), (_("%B: relocation %s is not supported for symbol %s."),
bfd_archive_filename (input_bfd), input_bfd,
ppc64_elf_howto_table[r_type]->name, sym_name); ppc64_elf_howto_table[r_type]->name, sym_name);
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
@ -9043,8 +9040,8 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if (((relocation + addend) & mask) != 0) if (((relocation + addend) & mask) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: error: relocation %s not a multiple of %d"), (_("%B: error: relocation %s not a multiple of %d"),
bfd_archive_filename (input_bfd), input_bfd,
ppc64_elf_howto_table[r_type]->name, ppc64_elf_howto_table[r_type]->name,
mask + 1); mask + 1);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -9062,9 +9059,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
ppc64_elf_howto_table[(int) r_type]->name, ppc64_elf_howto_table[(int) r_type]->name,
h->root.root.string); h->root.root.string);
@ -9108,9 +9105,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): %s reloc against `%s': error %d"), (_("%B(%A+0x%lx): %s reloc against `%s': error %d"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
ppc64_elf_howto_table[r_type]->name, ppc64_elf_howto_table[r_type]->name,
sym_name, sym_name,

View file

@ -933,8 +933,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{ {
(*_bfd_error_handler) (_("%s: bad symbol index: %d"), (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
bfd_archive_filename (abfd), abfd,
r_symndx); r_symndx);
return FALSE; return FALSE;
} }
@ -1119,8 +1119,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL) if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: `%s' accessed both as normal and thread local symbol"), (_("%B: `%s' accessed both as normal and thread local symbol"),
bfd_archive_filename (abfd), h->root.root.string); abfd, h->root.root.string);
return FALSE; return FALSE;
} }
if (old_tls_type > tls_type) if (old_tls_type > tls_type)
@ -1233,8 +1233,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
name + 5) != 0) name + 5) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad relocation section name `%s\'"), (_("%B: bad relocation section name `%s\'"),
bfd_archive_filename (abfd), name); abfd, name);
} }
if (htab->elf.dynobj == NULL) if (htab->elf.dynobj == NULL)
@ -2201,9 +2201,9 @@ invalid_tls_insn (input_bfd, input_section, rel)
howto = elf_howto_table + ELF64_R_TYPE (rel->r_info); howto = elf_howto_table + ELF64_R_TYPE (rel->r_info);
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): invalid instruction for TLS relocation %s"), (_("%B(%A+0x%lx): invalid instruction for TLS relocation %s"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
howto->name); howto->name);
} }
@ -2989,9 +2989,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& !((input_section->flags & SEC_DEBUGGING) != 0 && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
h->root.root.string); h->root.root.string);
@ -3039,9 +3039,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): reloc against `%s': error %d"), (_("%B(%A+0x%lx): reloc against `%s': error %d"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, name, (int) r); (long) rel->r_offset, name, (int) r);
return FALSE; return FALSE;
} }

View file

@ -1593,9 +1593,8 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
if (howto->rightshift || howto->src_mask != 0xffffffff) if (howto->rightshift || howto->src_mask != 0xffffffff)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"), (_("%B(%A+0x%lx): %s relocation against SEC_MERGE section"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, howto->name); (long) rel->r_offset, howto->name);
return FALSE; return FALSE;
} }

View file

@ -1368,9 +1368,8 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
break; break;
default: default:
(*_bfd_error_handler) (_("%s: check_relocs: unhandled reloc type %d"), (*_bfd_error_handler) (_("%B: check_relocs: unhandled reloc type %d"),
bfd_archive_filename (abfd), abfd, ELF64_R_TYPE_ID (rel->r_info));
ELF64_R_TYPE_ID (rel->r_info));
return FALSE; return FALSE;
} }
} }
@ -1405,8 +1404,8 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
case 6: reg -= 4; break; case 6: reg -= 4; break;
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Only registers %%g[2367] can be declared using STT_REGISTER"), (_("%B: Only registers %%g[2367] can be declared using STT_REGISTER"),
bfd_archive_filename (abfd)); abfd);
return FALSE; return FALSE;
} }
@ -1425,10 +1424,10 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
if (p->name != NULL && strcmp (p->name, *namep)) if (p->name != NULL && strcmp (p->name, *namep))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("Register %%g%d used incompatibly: %s in %s, previously %s in %s"), (_("Register %%g%d used incompatibly: %s in %B, previously %s in %B"),
(int) sym->st_value, abfd, p->abfd, (int) sym->st_value,
**namep ? *namep : "#scratch", bfd_archive_filename (abfd), **namep ? *namep : "#scratch",
*p->name ? p->name : "#scratch", bfd_archive_filename (p->abfd)); *p->name ? p->name : "#scratch");
return FALSE; return FALSE;
} }
@ -1448,9 +1447,8 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
if (type > STT_FUNC) if (type > STT_FUNC)
type = 0; type = 0;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("Symbol `%s' has differing types: REGISTER in %s, previously %s in %s"), (_("Symbol `%s' has differing types: REGISTER in %B, previously %s in %B"),
*namep, bfd_archive_filename (abfd), abfd, p->abfd, *namep, stt_types[type]);
stt_types[type], bfd_archive_filename (p->abfd));
return FALSE; return FALSE;
} }
@ -1494,9 +1492,8 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
if (type > STT_FUNC) if (type > STT_FUNC)
type = 0; type = 0;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("Symbol `%s' has differing types: %s in %s, previously REGISTER in %s"), (_("Symbol `%s' has differing types: %s in %B, previously REGISTER in %B"),
*namep, stt_types[type], bfd_archive_filename (abfd), abfd, p->abfd, *namep, stt_types[type]);
bfd_archive_filename (p->abfd));
return FALSE; return FALSE;
} }
} }
@ -2275,8 +2272,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
BFD_FAIL (); BFD_FAIL ();
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: probably compiled without -fPIC?"), (_("%B: probably compiled without -fPIC?"),
bfd_archive_filename (input_bfd)); input_bfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -2619,9 +2616,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& !((input_section->flags & SEC_DEBUGGING) != 0 && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, (long) rel->r_offset,
h->root.root.string); h->root.root.string);
@ -3003,8 +2999,8 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd)
{ {
error = TRUE; error = TRUE;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking UltraSPARC specific with HAL specific code"), (_("%B: linking UltraSPARC specific with HAL specific code"),
bfd_archive_filename (ibfd)); ibfd);
} }
/* Choose the most restrictive memory ordering. */ /* Choose the most restrictive memory ordering. */
old_mm = (old_flags & EF_SPARCV9_MM); old_mm = (old_flags & EF_SPARCV9_MM);
@ -3022,8 +3018,8 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd)
{ {
error = TRUE; error = TRUE;
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); ibfd, (long) new_flags, (long) old_flags);
} }
elf_elfheader (obfd)->e_flags = old_flags; elf_elfheader (obfd)->e_flags = old_flags;

View file

@ -641,9 +641,8 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{ {
(*_bfd_error_handler) (_("%s: bad symbol index: %d"), (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
bfd_archive_filename (abfd), abfd, r_symndx);
r_symndx);
return FALSE; return FALSE;
} }
@ -663,8 +662,8 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
if (info->shared) if (info->shared)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
bfd_archive_filename (abfd), abfd,
x86_64_elf_howto_table[r_type].name, x86_64_elf_howto_table[r_type].name,
(h) ? h->root.root.string : "a local symbol"); (h) ? h->root.root.string : "a local symbol");
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -731,9 +730,8 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s' accessed both as normal and thread local symbol"), (_("%B: %s' accessed both as normal and thread local symbol"),
bfd_archive_filename (abfd), abfd, h ? h->root.root.string : "<local>");
h ? h->root.root.string : "<local>");
return FALSE; return FALSE;
} }
} }
@ -789,8 +787,8 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
&& (sec->flags & SEC_READONLY) != 0) && (sec->flags & SEC_READONLY) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
bfd_archive_filename (abfd), abfd,
x86_64_elf_howto_table[r_type].name, x86_64_elf_howto_table[r_type].name,
(h) ? h->root.root.string : "a local symbol"); (h) ? h->root.root.string : "a local symbol");
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -881,8 +879,8 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
name + 5) != 0) name + 5) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad relocation section name `%s\'"), (_("%B: bad relocation section name `%s\'"),
bfd_archive_filename (abfd), name); abfd, name);
} }
if (htab->elf.dynobj == NULL) if (htab->elf.dynobj == NULL)
@ -1954,8 +1952,8 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
&& (input_section->flags & SEC_READONLY) != 0) && (input_section->flags & SEC_READONLY) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
bfd_archive_filename (input_bfd), input_bfd,
x86_64_elf_howto_table[r_type].name, x86_64_elf_howto_table[r_type].name,
(h) ? h->root.root.string : "a local symbol"); (h) ? h->root.root.string : "a local symbol");
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -2408,9 +2406,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
&& !((input_section->flags & SEC_DEBUGGING) != 0 && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
bfd_get_section_name (input_bfd, input_section), input_section,
(long) rel->r_offset, (long) rel->r_offset,
h->root.root.string); h->root.root.string);
@ -2451,9 +2449,8 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): reloc against `%s': error %d"), (_("%B(%A+0x%lx): reloc against `%s': error %d"),
bfd_archive_filename (input_bfd), input_bfd, input_section,
bfd_get_section_name (input_bfd, input_section),
(long) rel->r_offset, name, (int) r); (long) rel->r_offset, name, (int) r);
return FALSE; return FALSE;
} }

View file

@ -1392,8 +1392,8 @@ nondefault:
if (hi->root.type != bfd_link_hash_defined if (hi->root.type != bfd_link_hash_defined
&& hi->root.type != bfd_link_hash_defweak) && hi->root.type != bfd_link_hash_defweak)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"), (_("%B: unexpected redefinition of indirect versioned symbol `%s'"),
bfd_archive_filename (abfd), shortname); abfd, shortname);
} }
else else
{ {
@ -1711,8 +1711,8 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
/* We could not find the version for a symbol when /* We could not find the version for a symbol when
generating a shared archive. Return an error. */ generating a shared archive. Return an error. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: undefined versioned symbol name %s"), (_("%B: undefined versioned symbol name %s"),
bfd_get_filename (sinfo->output_bfd), h->root.root.string); sinfo->output_bfd, h->root.root.string);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
sinfo->failed = TRUE; sinfo->failed = TRUE;
return FALSE; return FALSE;
@ -1859,14 +1859,11 @@ elf_link_read_relocs_from_section (bfd *abfd,
r_symndx >>= 24; r_symndx >>= 24;
if ((size_t) r_symndx >= nsyms) if ((size_t) r_symndx >= nsyms)
{ {
char *sec_name = bfd_get_section_ident (sec);
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%s'"), (_("%B: bad reloc symbol index (0x%lx >= 0x%lx)"
bfd_archive_filename (abfd), (unsigned long) r_symndx, " for offset 0x%lx in section `%A'"),
(unsigned long) nsyms, irela->r_offset, abfd, sec,
sec_name ? sec_name : sec->name); (unsigned long) r_symndx, (unsigned long) nsyms, irela->r_offset);
if (sec_name)
free (sec_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -2052,14 +2049,9 @@ _bfd_elf_link_output_relocs (bfd *output_bfd,
} }
else else
{ {
char *sec_name = bfd_get_section_ident (input_section);
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: relocation size mismatch in %s section %s"), (_("%B: relocation size mismatch in %B section %A"),
bfd_get_filename (output_bfd), output_bfd, input_section->owner, input_section);
bfd_archive_filename (input_section->owner),
sec_name ? sec_name : input_section->name);
if (sec_name)
free (sec_name);
bfd_set_error (bfd_error_wrong_object_format); bfd_set_error (bfd_error_wrong_object_format);
return FALSE; return FALSE;
} }
@ -3467,8 +3459,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info) if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s: invalid version %u (max %d)"), (_("%B: %s: invalid version %u (max %d)"),
bfd_archive_filename (abfd), name, vernum, abfd, name, vernum,
elf_tdata (abfd)->dynverdef_hdr.sh_info); elf_tdata (abfd)->dynverdef_hdr.sh_info);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_free_vers; goto error_free_vers;
@ -3508,8 +3500,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (verstr == NULL) if (verstr == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s: invalid needed version %d"), (_("%B: %s: invalid needed version %d"),
bfd_archive_filename (abfd), name, vernum); abfd, name, vernum);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_free_vers; goto error_free_vers;
} }
@ -3683,12 +3675,10 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (normal_align < common_align) if (normal_align < common_align)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s"), (_("Warning: alignment %u of symbol `%s' in %B"
1 << normal_align, " is smaller than %u in %B"),
name, normal_bfd, common_bfd,
bfd_archive_filename (normal_bfd), 1 << normal_align, name, 1 << common_align);
1 << common_align,
bfd_archive_filename (common_bfd));
} }
/* Remember the symbol size and type. */ /* Remember the symbol size and type. */
@ -3697,11 +3687,11 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
{ {
if (h->size != 0 && h->size != isym->st_size && ! size_change_ok) if (h->size != 0 && h->size != isym->st_size && ! size_change_ok)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("Warning: size of symbol `%s' changed from %lu in %s to %lu in %s"), (_("Warning: size of symbol `%s' changed"
" from %lu in %B to %lu in %B"),
old_bfd, abfd,
name, (unsigned long) h->size, name, (unsigned long) h->size,
bfd_archive_filename (old_bfd), (unsigned long) isym->st_size);
(unsigned long) isym->st_size,
bfd_archive_filename (abfd));
h->size = isym->st_size; h->size = isym->st_size;
} }
@ -3721,9 +3711,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
&& h->type != ELF_ST_TYPE (isym->st_info) && h->type != ELF_ST_TYPE (isym->st_info)
&& ! type_change_ok) && ! type_change_ok)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("Warning: type of symbol `%s' changed from %d to %d in %s"), (_("Warning: type of symbol `%s' changed"
name, h->type, ELF_ST_TYPE (isym->st_info), " from %d to %d in %B"),
bfd_archive_filename (abfd)); abfd, name, h->type, ELF_ST_TYPE (isym->st_info));
h->type = ELF_ST_TYPE (isym->st_info); h->type = ELF_ST_TYPE (isym->st_info);
} }
@ -3861,7 +3851,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: invalid DSO for symbol `%s' definition"), (_("%s: invalid DSO for symbol `%s' definition"),
bfd_archive_filename (abfd), name); abfd, name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_free_vers; goto error_free_vers;
} }
@ -4967,8 +4957,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
== SHT_PREINIT_ARRAY) == SHT_PREINIT_ARRAY)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: .preinit_array section is not allowed in DSO"), (_("%B: .preinit_array section is not allowed in DSO"),
bfd_archive_filename (sub)); sub);
break; break;
} }
@ -6040,14 +6030,13 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
&& ! elf_link_check_versioned_symbol (finfo->info, bed, h)) && ! elf_link_check_versioned_symbol (finfo->info, bed, h))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s symbol `%s' in %s is referenced by DSO"), (_("%B: %s symbol `%s' in %B is referenced by DSO"),
bfd_get_filename (finfo->output_bfd), finfo->output_bfd, h->root.u.def.section->owner,
ELF_ST_VISIBILITY (h->other) == STV_INTERNAL ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
? "internal" ? "internal"
: ELF_ST_VISIBILITY (h->other) == STV_HIDDEN : ELF_ST_VISIBILITY (h->other) == STV_HIDDEN
? "hidden" : "local", ? "hidden" : "local",
h->root.root.string, h->root.root.string);
bfd_archive_filename (h->root.u.def.section->owner));
eoinfo->failed = TRUE; eoinfo->failed = TRUE;
return FALSE; return FALSE;
} }
@ -6120,14 +6109,9 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
input_sec->output_section); input_sec->output_section);
if (sym.st_shndx == SHN_BAD) if (sym.st_shndx == SHN_BAD)
{ {
char *sec_name = bfd_get_section_ident (input_sec);
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: could not find output section %s for input section %s"), (_("%B: could not find output section %A for input section %A"),
bfd_get_filename (finfo->output_bfd), finfo->output_bfd, input_sec->output_section, input_sec);
input_sec->output_section->name,
sec_name ? sec_name : input_sec->name);
if (sec_name)
free (sec_name);
eoinfo->failed = TRUE; eoinfo->failed = TRUE;
return FALSE; return FALSE;
} }
@ -6223,8 +6207,8 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s symbol `%s' isn't defined"), (_("%B: %s symbol `%s' isn't defined"),
bfd_get_filename (finfo->output_bfd), finfo->output_bfd,
ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED
? "protected" ? "protected"
: ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL : ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL
@ -6725,20 +6709,10 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
} }
else if (complain) else if (complain)
{ {
char *r_sec = bfd_get_section_ident (o); (*_bfd_error_handler)
char *d_sec = bfd_get_section_ident (sec); (_("`%s' referenced in section `%A' of %B: "
"defined in discarded section `%A' of %B\n"),
finfo->info->callbacks->error_handler o, input_bfd, sec, sec->owner, sym_name);
(LD_DEFINITION_IN_DISCARDED_SECTION,
_("`%T' referenced in section `%s' of %B: "
"defined in discarded section `%s' of %B\n"),
sym_name, sym_name,
r_sec ? r_sec : o->name, input_bfd,
d_sec ? d_sec : sec->name, sec->owner);
if (r_sec)
free (r_sec);
if (d_sec)
free (d_sec);
} }
/* Remove the symbol reference from the reloc, but /* Remove the symbol reference from the reloc, but
@ -7244,15 +7218,8 @@ elf_get_linked_section_vma (struct bfd_link_order *p)
const struct elf_backend_data *bed const struct elf_backend_data *bed
= get_elf_backend_data (s->owner); = get_elf_backend_data (s->owner);
if (bed->link_order_error_handler) if (bed->link_order_error_handler)
{
char *name = bfd_get_section_ident (s);
bed->link_order_error_handler bed->link_order_error_handler
(_("%s: warning: sh_link not set for section `%s'"), (_("%B: warning: sh_link not set for section `%A'"), s->owner, s);
bfd_archive_filename (s->owner),
name ? name : s->name);
if (name)
free (name);
}
return 0; return 0;
} }
else else
@ -7325,8 +7292,8 @@ elf_fixup_link_order (bfd *abfd, asection *o)
if (seen_other && seen_linkorder) if (seen_other && seen_linkorder)
{ {
(*_bfd_error_handler) (_("%s: has both ordered and unordered sections"), (*_bfd_error_handler) (_("%A has both ordered and unordered sections"),
o->name); o);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -8155,8 +8122,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
if (o == NULL) if (o == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: could not find output section %s"), (_("%B: could not find output section %s"), abfd, name);
bfd_get_filename (abfd), name);
goto error_return; goto error_return;
} }
if (o->size == 0) if (o->size == 0)
@ -8197,8 +8163,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
if (o == NULL) if (o == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: could not find output section %s"), (_("%B: could not find output section %s"), abfd, name);
bfd_get_filename (abfd), name);
goto error_return; goto error_return;
} }
dyn.d_un.d_ptr = o->vma; dyn.d_un.d_ptr = o->vma;
@ -8806,7 +8771,6 @@ bfd_elf_gc_record_vtinherit (bfd *abfd,
struct elf_link_hash_entry **search, *child; struct elf_link_hash_entry **search, *child;
bfd_size_type extsymcount; bfd_size_type extsymcount;
const struct elf_backend_data *bed = get_elf_backend_data (abfd); const struct elf_backend_data *bed = get_elf_backend_data (abfd);
char *sec_name;
/* The sh_info field of the symtab header tells us where the /* The sh_info field of the symtab header tells us where the
external symbols start. We don't care about the local symbols at external symbols start. We don't care about the local symbols at
@ -8830,11 +8794,8 @@ bfd_elf_gc_record_vtinherit (bfd *abfd,
goto win; goto win;
} }
sec_name = bfd_get_section_ident (sec); (*_bfd_error_handler) ("%B: %A+%lu: No symbol found for INHERIT",
(*_bfd_error_handler) ("%s: %s+%lu: No symbol found for INHERIT", abfd, sec, (unsigned long) offset);
bfd_archive_filename (abfd),
sec_name ? sec_name : sec->name,
(unsigned long) offset);
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return FALSE; return FALSE;
@ -9387,15 +9348,15 @@ _bfd_elf_section_already_linked (bfd *abfd, struct bfd_section * sec)
case SEC_LINK_DUPLICATES_ONE_ONLY: case SEC_LINK_DUPLICATES_ONE_ONLY:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s: warning: ignoring duplicate section `%s'\n"), (_("%B: ignoring duplicate section `%A'\n"),
bfd_archive_filename (abfd), name); abfd, sec);
break; break;
case SEC_LINK_DUPLICATES_SAME_SIZE: case SEC_LINK_DUPLICATES_SAME_SIZE:
if (sec->size != l->sec->size) if (sec->size != l->sec->size)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s: warning: duplicate section `%s' has different size\n"), (_("%B: duplicate section `%A' has different size\n"),
bfd_archive_filename (abfd), name); abfd, sec);
break; break;
} }

View file

@ -977,9 +977,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
|| strcmp (sec->output_section->name, ".fini") == 0) || strcmp (sec->output_section->name, ".fini") == 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Can't relax br at 0x%lx in section `%s'. Please use brl or indirect branch."), (_("%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."),
bfd_archive_filename (sec->owner), sec->owner, sec, (unsigned long) roff);
(unsigned long) roff, sec->name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -3904,8 +3903,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
if (r_type > R_IA64_MAX_RELOC_CODE) if (r_type > R_IA64_MAX_RELOC_CODE)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unknown relocation type %d"), (_("%B: unknown relocation type %d"),
bfd_archive_filename (input_bfd), (int)r_type); input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ret_val = FALSE; ret_val = FALSE;
continue; continue;
@ -4009,8 +4008,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
/* ??? People shouldn't be doing non-pic code in /* ??? People shouldn't be doing non-pic code in
shared libraries nor dynamic executables. */ shared libraries nor dynamic executables. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: non-pic code with imm relocation against dynamic symbol `%s'"), (_("%B: non-pic code with imm relocation against dynamic symbol `%s'"),
bfd_archive_filename (input_bfd), input_bfd,
h->root.root.string); h->root.root.string);
ret_val = FALSE; ret_val = FALSE;
continue; continue;
@ -4074,8 +4073,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
if (dynamic_symbol_p) if (dynamic_symbol_p)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: @gprel relocation against dynamic symbol %s"), (_("%B: @gprel relocation against dynamic symbol %s"),
bfd_archive_filename (input_bfd), h->root.root.string); input_bfd, h->root.root.string);
ret_val = FALSE; ret_val = FALSE;
continue; continue;
} }
@ -4134,8 +4133,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
/* ??? People shouldn't be doing non-pic code in /* ??? People shouldn't be doing non-pic code in
shared libraries. Hork. */ shared libraries. Hork. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking non-pic code in a position independent executable"), (_("%B: linking non-pic code in a position independent executable"),
bfd_archive_filename (input_bfd)); input_bfd);
ret_val = FALSE; ret_val = FALSE;
continue; continue;
} }
@ -4271,13 +4270,12 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
const char *msg; const char *msg;
if (r_type == R_IA64_PCREL21BI) if (r_type == R_IA64_PCREL21BI)
msg = _("%s: @internal branch to dynamic symbol %s"); msg = _("%B: @internal branch to dynamic symbol %s");
else if (r_type == R_IA64_PCREL21F || r_type == R_IA64_PCREL21M) else if (r_type == R_IA64_PCREL21F || r_type == R_IA64_PCREL21M)
msg = _("%s: speculation fixup to dynamic symbol %s"); msg = _("%B: speculation fixup to dynamic symbol %s");
else else
msg = _("%s: @pcrel relocation against dynamic symbol %s"); msg = _("%B: @pcrel relocation against dynamic symbol %s");
(*_bfd_error_handler) (msg, bfd_archive_filename (input_bfd), (*_bfd_error_handler) (msg, input_bfd, h->root.root.string);
h->root.root.string);
ret_val = FALSE; ret_val = FALSE;
continue; continue;
} }
@ -4761,8 +4759,8 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd)
if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL)) if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking trap-on-NULL-dereference with non-trapping files"), (_("%B: linking trap-on-NULL-dereference with non-trapping files"),
bfd_archive_filename (ibfd)); ibfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ok = FALSE; ok = FALSE;
@ -4770,8 +4768,8 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd)
if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE)) if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking big-endian files with little-endian files"), (_("%B: linking big-endian files with little-endian files"),
bfd_archive_filename (ibfd)); ibfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ok = FALSE; ok = FALSE;
@ -4779,8 +4777,8 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd)
if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64)) if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking 64-bit files with 32-bit files"), (_("%B: linking 64-bit files with 32-bit files"),
bfd_archive_filename (ibfd)); ibfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ok = FALSE; ok = FALSE;
@ -4788,8 +4786,8 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd)
if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP)) if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking constant-gp files with non-constant-gp files"), (_("%B: linking constant-gp files with non-constant-gp files"),
bfd_archive_filename (ibfd)); ibfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ok = FALSE; ok = FALSE;
@ -4798,8 +4796,8 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd)
!= (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP)) != (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking auto-pic files with non-auto-pic files"), (_("%B: linking auto-pic files with non-auto-pic files"),
bfd_archive_filename (ibfd)); ibfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
ok = FALSE; ok = FALSE;

View file

@ -3719,9 +3719,9 @@ mips_elf_perform_relocation (struct bfd_link_info *info,
if (!ok) if (!ok)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s+0x%lx: jump to stub routine which is not jal"), (_("%B: %A+0x%lx: jump to stub routine which is not jal"),
bfd_archive_filename (input_bfd), input_bfd,
input_section->name, input_section,
(unsigned long) relocation->r_offset); (unsigned long) relocation->r_offset);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
@ -5226,8 +5226,8 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr)) else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: Malformed reloc detected for section %s"), (_("%B: Malformed reloc detected for section %s"),
bfd_archive_filename (abfd), name); abfd, name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -5300,8 +5300,8 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (h == NULL) if (h == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: CALL16 reloc at 0x%lx not against global symbol"), (_("%B: CALL16 reloc at 0x%lx not against global symbol"),
bfd_archive_filename (abfd), (unsigned long) rel->r_offset); abfd, (unsigned long) rel->r_offset);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -8895,8 +8895,8 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (! _bfd_generic_verify_endian_match (ibfd, obfd)) if (! _bfd_generic_verify_endian_match (ibfd, obfd))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: endianness incompatible with that of the selected emulation"), (_("%B: endianness incompatible with that of the selected emulation"),
bfd_archive_filename (ibfd)); ibfd);
return FALSE; return FALSE;
} }
@ -8907,8 +8907,8 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0) if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: ABI is incompatible with that of the selected emulation"), (_("%B: ABI is incompatible with that of the selected emulation"),
bfd_archive_filename (ibfd)); ibfd);
return FALSE; return FALSE;
} }
@ -8979,8 +8979,8 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
!= ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0)) != ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: warning: linking PIC files with non-PIC files"), (_("%B: warning: linking PIC files with non-PIC files"),
bfd_archive_filename (ibfd)); ibfd);
ok = TRUE; ok = TRUE;
} }
@ -8996,8 +8996,8 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (mips_32bit_flags_p (old_flags) != mips_32bit_flags_p (new_flags)) if (mips_32bit_flags_p (old_flags) != mips_32bit_flags_p (new_flags))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking 32-bit code with 64-bit code"), (_("%B: linking 32-bit code with 64-bit code"),
bfd_archive_filename (ibfd)); ibfd);
ok = FALSE; ok = FALSE;
} }
else if (!mips_mach_extends_p (bfd_get_mach (ibfd), bfd_get_mach (obfd))) else if (!mips_mach_extends_p (bfd_get_mach (ibfd), bfd_get_mach (obfd)))
@ -9024,8 +9024,8 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
{ {
/* The ISAs aren't compatible. */ /* The ISAs aren't compatible. */
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: linking %s module with previous %s modules"), (_("%B: linking %s module with previous %s modules"),
bfd_archive_filename (ibfd), ibfd,
bfd_printable_name (ibfd), bfd_printable_name (ibfd),
bfd_printable_name (obfd)); bfd_printable_name (obfd));
ok = FALSE; ok = FALSE;
@ -9047,8 +9047,8 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
!= elf_elfheader (obfd)->e_ident[EI_CLASS])) != elf_elfheader (obfd)->e_ident[EI_CLASS]))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: ABI mismatch: linking %s module with previous %s modules"), (_("%B: ABI mismatch: linking %s module with previous %s modules"),
bfd_archive_filename (ibfd), ibfd,
elf_mips_abi_name (ibfd), elf_mips_abi_name (ibfd),
elf_mips_abi_name (obfd)); elf_mips_abi_name (obfd));
ok = FALSE; ok = FALSE;
@ -9070,8 +9070,8 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
if (new_flags != old_flags) if (new_flags != old_flags)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
bfd_archive_filename (ibfd), (unsigned long) new_flags, ibfd, (unsigned long) new_flags,
(unsigned long) old_flags); (unsigned long) old_flags);
ok = FALSE; ok = FALSE;
} }

View file

@ -935,9 +935,8 @@ ieee_slurp_external_symbols (abfd)
break; break;
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unimplemented ATI record %u for symbol %u"), (_("%B: unimplemented ATI record %u for symbol %u"),
bfd_archive_filename (abfd), symbol_attribute_def, abfd, symbol_attribute_def, symbol_name_index);
symbol_name_index);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
break; break;
@ -960,8 +959,8 @@ ieee_slurp_external_symbols (abfd)
if (value != 0x3f) if (value != 0x3f)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unexpected ATN type %d in external part"), (_("%B: unexpected ATN type %d in external part"),
bfd_archive_filename (abfd), (int) value); abfd, (int) value);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -982,8 +981,7 @@ ieee_slurp_external_symbols (abfd)
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: unexpected type after ATN"), (_("%B: unexpected type after ATN"), abfd);
bfd_archive_filename (abfd));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }

View file

@ -261,8 +261,8 @@ ihex_bad_byte (abfd, lineno, c, error)
buf[1] = '\0'; buf[1] = '\0';
} }
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s:%d: unexpected character `%s' in Intel Hex file\n"), (_("%B:%d: unexpected character `%s' in Intel Hex file"),
bfd_archive_filename (abfd), lineno, buf); abfd, lineno, buf);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
} }
} }
@ -369,8 +369,8 @@ ihex_scan (abfd)
if (((- chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i)) if (((- chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s:%u: bad checksum in Intel Hex file (expected %u, found %u)"), (_("%B:%u: bad checksum in Intel Hex file (expected %u, found %u)"),
bfd_archive_filename (abfd), lineno, abfd, lineno,
(- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i)); (- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
@ -423,8 +423,8 @@ ihex_scan (abfd)
if (len != 2) if (len != 2)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s:%u: bad extended address record length in Intel Hex file"), (_("%B:%u: bad extended address record length in Intel Hex file"),
bfd_archive_filename (abfd), lineno); abfd, lineno);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -440,8 +440,8 @@ ihex_scan (abfd)
if (len != 4) if (len != 4)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s:%u: bad extended start address length in Intel Hex file"), (_("%B:%u: bad extended start address length in Intel Hex file"),
bfd_archive_filename (abfd), lineno); abfd, lineno);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -457,8 +457,8 @@ ihex_scan (abfd)
if (len != 2) if (len != 2)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s:%u: bad extended linear address record length in Intel Hex file"), (_("%B:%u: bad extended linear address record length in Intel Hex file"),
bfd_archive_filename (abfd), lineno); abfd, lineno);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -474,8 +474,8 @@ ihex_scan (abfd)
if (len != 2 && len != 4) if (len != 2 && len != 4)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s:%u: bad extended linear start address length in Intel Hex file"), (_("%B:%u: bad extended linear start address length in Intel Hex file"),
bfd_archive_filename (abfd), lineno); abfd, lineno);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -491,8 +491,8 @@ ihex_scan (abfd)
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s:%u: unrecognized ihex type %u in Intel Hex file\n"), (_("%B:%u: unrecognized ihex type %u in Intel Hex file"),
bfd_archive_filename (abfd), lineno, type); abfd, lineno, type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -616,8 +616,7 @@ ihex_read_section (abfd, section, contents)
if (type != 0) if (type != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: internal error in ihex_read_section"), (_("%B: internal error in ihex_read_section"), abfd);
bfd_archive_filename (abfd));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -651,8 +650,7 @@ ihex_read_section (abfd, section, contents)
if ((bfd_size_type) (p - contents) < section->size) if ((bfd_size_type) (p - contents) < section->size)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad section length in ihex_read_section"), (_("%B: bad section length in ihex_read_section"), abfd);
bfd_archive_filename (abfd));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }

View file

@ -823,11 +823,11 @@ _bfd_generic_verify_endian_match (bfd *ibfd, bfd *obfd)
const char *msg; const char *msg;
if (bfd_big_endian (ibfd)) if (bfd_big_endian (ibfd))
msg = _("%s: compiled for a big endian system and target is little endian"); msg = _("%B: compiled for a big endian system and target is little endian");
else else
msg = _("%s: compiled for a little endian system and target is big endian"); msg = _("%B: compiled for a little endian system and target is big endian");
(*_bfd_error_handler) (msg, bfd_archive_filename (ibfd)); (*_bfd_error_handler) (msg, ibfd);
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return FALSE; return FALSE;

View file

@ -1828,8 +1828,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
&& inh->u.i.link == h) && inh->u.i.link == h)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: indirect symbol `%s' to `%s' is a loop"), (_("%B: indirect symbol `%s' to `%s' is a loop"),
bfd_archive_filename (abfd), name, string); abfd, name, string);
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return FALSE; return FALSE;
} }
@ -2992,14 +2992,9 @@ _bfd_generic_section_already_linked (bfd *abfd, asection *sec)
break; break;
case SEC_LINK_DUPLICATES_ONE_ONLY: case SEC_LINK_DUPLICATES_ONE_ONLY:
if (s_comdat == NULL)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s: warning: ignoring duplicate section `%s'\n"), (_("%B: warning: ignoring duplicate section `%A'\n"),
bfd_archive_filename (abfd), name); abfd, sec);
else
(*_bfd_error_handler)
(_("%s: %s: warning: ignoring duplicate `%s' section symbol `%s'\n"),
bfd_archive_filename (abfd), name, s_comdat->name);
break; break;
case SEC_LINK_DUPLICATES_SAME_CONTENTS: case SEC_LINK_DUPLICATES_SAME_CONTENTS:
@ -3012,8 +3007,8 @@ _bfd_generic_section_already_linked (bfd *abfd, asection *sec)
case SEC_LINK_DUPLICATES_SAME_SIZE: case SEC_LINK_DUPLICATES_SAME_SIZE:
if (sec->size != l->sec->size) if (sec->size != l->sec->size)
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: %s: warning: duplicate section `%s' has different size\n"), (_("%B: warning: duplicate section `%A' has different size\n"),
bfd_archive_filename (abfd), name); abfd, sec);
break; break;
} }

View file

@ -1672,9 +1672,8 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
/* This case occurs, e.g., for the *DEBUG* section of a COFF /* This case occurs, e.g., for the *DEBUG* section of a COFF
file. */ file. */
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: can not represent section for symbol `%s' in a.out object file format", ("%B: can not represent section for symbol `%s' in a.out object file format",
bfd_archive_filename (abfd), abfd, cache_ptr->name != NULL ? cache_ptr->name : "*unknown*");
cache_ptr->name != NULL ? cache_ptr->name : "*unknown*");
bfd_set_error (bfd_error_nonrepresentable_section); bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE; return FALSE;
} }
@ -1700,8 +1699,8 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
("%s: can not represent section `%s' in a.out object file format", ("%B: can not represent section `%A' in a.out object file format",
bfd_archive_filename (abfd), bfd_get_section_name (abfd, sec)); abfd, sec);
bfd_set_error (bfd_error_nonrepresentable_section); bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE; return FALSE;
} }

View file

@ -1,6 +1,6 @@
/* BFD back-end for MIPS PE COFF files. /* BFD back-end for MIPS PE COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003 Free Software Foundation, Inc. 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Modified from coff-i386.c by DJ Delorie, dj@cygnus.com Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -632,9 +632,8 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
if (info->relocatable) if (info->relocatable)
{ {
(*_bfd_error_handler) (_("\ (*_bfd_error_handler)
%s: `ld -r' not supported with PE MIPS objects\n"), (_("%B: `ld -r' not supported with PE MIPS objects\n"), input_bfd);
bfd_archive_filename (input_bfd));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -768,8 +767,8 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
val = VMA of what we need to refer to val = VMA of what we need to refer to
*/ */
#define UI(x) (*_bfd_error_handler) (_("%s: unimplemented %s\n"), \ #define UI(x) (*_bfd_error_handler) (_("%B: unimplemented %s\n"), \
bfd_archive_filename (input_bfd), x); \ input_bfd, x); \
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
switch (rel->r_type) switch (rel->r_type)
@ -794,8 +793,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
targ = val + (tmp&0x03ffffff)*4; targ = val + (tmp&0x03ffffff)*4;
if ((src & 0xf0000000) != (targ & 0xf0000000)) if ((src & 0xf0000000) != (targ & 0xf0000000))
{ {
(*_bfd_error_handler) (_("%s: jump too far away\n"), (*_bfd_error_handler) (_("%B: jump too far away\n"), input_bfd);
bfd_archive_filename (input_bfd));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }
@ -821,8 +819,8 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
targ = val + low + ((tmp & 0xffff) << 16); targ = val + low + ((tmp & 0xffff) << 16);
break; break;
default: default:
(*_bfd_error_handler) (_("%s: bad pair/reflo after refhi\n"), (*_bfd_error_handler) (_("%B: bad pair/reflo after refhi\n"),
bfd_archive_filename (input_bfd)); input_bfd);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
} }

View file

@ -1,5 +1,5 @@
/* Support for the generic parts of PE/PEI, for BFD. /* Support for the generic parts of PE/PEI, for BFD.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Cygnus Solutions. Written by Cygnus Solutions.
@ -784,13 +784,13 @@ pe_ILF_build_a_bfd (bfd * abfd,
case IMPORT_CONST: case IMPORT_CONST:
/* XXX code yet to be written. */ /* XXX code yet to be written. */
_bfd_error_handler (_("%s: Unhandled import type; %x"), _bfd_error_handler (_("%B: Unhandled import type; %x"),
bfd_archive_filename (abfd), import_type); abfd, import_type);
return FALSE; return FALSE;
default: default:
_bfd_error_handler (_("%s: Unrecognised import type; %x"), _bfd_error_handler (_("%B: Unrecognised import type; %x"),
bfd_archive_filename (abfd), import_type); abfd, import_type);
return FALSE; return FALSE;
} }
@ -803,8 +803,8 @@ pe_ILF_build_a_bfd (bfd * abfd,
break; break;
default: default:
_bfd_error_handler (_("%s: Unrecognised import name type; %x"), _bfd_error_handler (_("%B: Unrecognised import name type; %x"),
bfd_archive_filename (abfd), import_name_type); abfd, import_name_type);
return FALSE; return FALSE;
} }
@ -1190,9 +1190,9 @@ pe_ILF_object_p (bfd * abfd)
/* We no longer support PowerPC. */ /* We no longer support PowerPC. */
default: default:
_bfd_error_handler _bfd_error_handler
( (_("%B: Unrecognised machine type (0x%x)"
_("%s: Unrecognised machine type (0x%x) in Import Library Format archive"), " in Import Library Format archive"),
bfd_archive_filename (abfd), machine); abfd, machine);
bfd_set_error (bfd_error_malformed_archive); bfd_set_error (bfd_error_malformed_archive);
return NULL; return NULL;
@ -1202,9 +1202,9 @@ _("%s: Unrecognised machine type (0x%x) in Import Library Format archive"),
if (magic == 0) if (magic == 0)
{ {
_bfd_error_handler _bfd_error_handler
( (_("%B: Recognised but unhandled machine type (0x%x)"
_("%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive"), " in Import Library Format archive"),
bfd_archive_filename (abfd), machine); abfd, machine);
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return NULL; return NULL;
@ -1220,8 +1220,7 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc
if (size == 0) if (size == 0)
{ {
_bfd_error_handler _bfd_error_handler
(_("%s: size field is zero in Import Library Format header"), (_("%B: size field is zero in Import Library Format header"), abfd);
bfd_archive_filename (abfd));
bfd_set_error (bfd_error_malformed_archive); bfd_set_error (bfd_error_malformed_archive);
return NULL; return NULL;
@ -1251,8 +1250,7 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc
if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size)) if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size))
{ {
_bfd_error_handler _bfd_error_handler
(_("%s: string not null terminated in ILF object file."), (_("%B: string not null terminated in ILF object file."), abfd);
bfd_archive_filename (abfd));
bfd_set_error (bfd_error_malformed_archive); bfd_set_error (bfd_error_malformed_archive);
bfd_release (abfd, ptr); bfd_release (abfd, ptr);
return NULL; return NULL;

View file

@ -299,8 +299,8 @@ srec_bad_byte (abfd, lineno, c, error)
buf[1] = '\0'; buf[1] = '\0';
} }
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s:%d: Unexpected character `%s' in S-record file\n"), (_("%B:%d: Unexpected character `%s' in S-record file\n"),
bfd_archive_filename (abfd), lineno, buf); abfd, lineno, buf);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
} }
} }

View file

@ -293,10 +293,8 @@ _bfd_link_section_stabs (abfd, sinfo, stabsec, stabstrsec, psecinfo, pstring_off
if (symstroff >= stabstrsec->size) if (symstroff >= stabstrsec->size)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s(%s+0x%lx): Stabs entry has invalid string index."), (_("%B(%A+0x%lx): Stabs entry has invalid string index."),
bfd_archive_filename (abfd), abfd, stabsec, (long) (sym - stabbuf));
bfd_get_section_name (abfd, stabsec),
(long) (sym - stabbuf));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }

View file

@ -1240,8 +1240,8 @@ xcoff_link_add_symbols (abfd, info)
if (enclosing == NULL) if (enclosing == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: `%s' has line numbers but no enclosing section"), (_("%B: `%s' has line numbers but no enclosing section"),
bfd_archive_filename (abfd), name); abfd, name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -1293,8 +1293,8 @@ xcoff_link_add_symbols (abfd, info)
if (sym.n_numaux == 0) if (sym.n_numaux == 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: class %d symbol `%s' has no aux entries"), (_("%B: class %d symbol `%s' has no aux entries"),
bfd_archive_filename (abfd), sym.n_sclass, name); abfd, sym.n_sclass, name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -1316,8 +1316,8 @@ xcoff_link_add_symbols (abfd, info)
{ {
default: default:
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: symbol `%s' has unrecognized csect type %d"), (_("%B: symbol `%s' has unrecognized csect type %d"),
bfd_archive_filename (abfd), name, smtyp); abfd, name, smtyp);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
@ -1328,8 +1328,8 @@ xcoff_link_add_symbols (abfd, info)
|| aux.x_csect.x_scnlen.l != 0) || aux.x_csect.x_scnlen.l != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"), (_("%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"),
bfd_archive_filename (abfd), name, sym.n_sclass, sym.n_scnum, abfd, name, sym.n_sclass, sym.n_scnum,
aux.x_csect.x_scnlen.l); aux.x_csect.x_scnlen.l);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
@ -1364,9 +1364,8 @@ xcoff_link_add_symbols (abfd, info)
|| aux.x_csect.x_scnlen.l != 0) || aux.x_csect.x_scnlen.l != 0)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: XMC_TC0 symbol `%s' is class %d scnlen %d"), (_("%B: XMC_TC0 symbol `%s' is class %d scnlen %d"),
bfd_archive_filename (abfd), name, sym.n_sclass, abfd, name, sym.n_sclass, aux.x_csect.x_scnlen.l);
aux.x_csect.x_scnlen.l);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -1516,8 +1515,8 @@ xcoff_link_add_symbols (abfd, info)
> enclosing->vma + enclosing->size))) > enclosing->vma + enclosing->size)))
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: csect `%s' not in enclosing section"), (_("%B: csect `%s' not in enclosing section"),
bfd_archive_filename (abfd), name); abfd, name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -1623,8 +1622,8 @@ xcoff_link_add_symbols (abfd, info)
if (bad) if (bad)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: misplaced XTY_LD `%s'"), (_("%B: misplaced XTY_LD `%s'"),
bfd_archive_filename (abfd), name); abfd, name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -1954,8 +1953,8 @@ xcoff_link_add_symbols (abfd, info)
if (*rel_csect == NULL) if (*rel_csect == NULL)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: reloc %s:%d not in csect"), (_("%B: reloc %s:%d not in csect"),
bfd_archive_filename (abfd), o->name, i); abfd, o->name, i);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
goto error_return; goto error_return;
} }
@ -5283,9 +5282,8 @@ xcoff_link_input_bfd (finfo, input_bfd)
else else
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: loader reloc in unrecognized section `%s'"), (_("%B: loader reloc in unrecognized section `%A'"),
bfd_archive_filename (input_bfd), input_bfd, sec);
sec->name);
bfd_set_error (bfd_error_nonrepresentable_section); bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE; return FALSE;
} }
@ -5305,8 +5303,8 @@ xcoff_link_input_bfd (finfo, input_bfd)
if (h->ldindx < 0 && ! quiet) if (h->ldindx < 0 && ! quiet)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: `%s' in loader reloc but not loader sym"), (_("%B: `%s' in loader reloc but not loader sym"),
bfd_archive_filename (input_bfd), input_bfd,
h->root.root.string); h->root.root.string);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return FALSE; return FALSE;
@ -5320,10 +5318,8 @@ xcoff_link_input_bfd (finfo, input_bfd)
&& ! quiet) && ! quiet)
{ {
(*_bfd_error_handler) (*_bfd_error_handler)
(_("%s: loader reloc in read-only section %s"), (_("%B: loader reloc in read-only section %A"),
bfd_archive_filename (input_bfd), input_bfd, o->output_section);
bfd_get_section_name (finfo->output_bfd,
o->output_section));
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return FALSE; return FALSE;
} }

View file

@ -1,3 +1,8 @@
2004-08-13 Alan Modra <amodra@bigpond.net.au>
* bfdlink.h (struct bfd_link_callbacks): Remove "error_handler".
(LD_DEFINITION_IN_DISCARDED_SECTION): Delete.
2004-08-02 Gabriel Dos Reis <gdr@integrable-solutions.net> 2004-08-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
* libiberty.h (XDELETE, XDELETEVEC, XRESIZEVEC): Remove any * libiberty.h (XDELETE, XDELETEVEC, XRESIZEVEC): Remove any

View file

@ -511,14 +511,6 @@ struct bfd_link_callbacks
bfd_boolean (*notice) bfd_boolean (*notice)
(struct bfd_link_info *, const char *name, (struct bfd_link_info *, const char *name,
bfd *abfd, asection *section, bfd_vma address); bfd *abfd, asection *section, bfd_vma address);
/* A function which is called for reporting a linker error. ID is the
error identifier. The remaining input is the same as einfo () in
ld. */
bfd_boolean (*error_handler)
(int id, const char *fmt, ...);
/* Identifiers of linker error messages used by error_handler. */
#define LD_DEFINITION_IN_DISCARDED_SECTION 1
}; };
/* The linker builds link_order structures which tell the code how to /* The linker builds link_order structures which tell the code how to

View file

@ -1,3 +1,12 @@
2004-08-13 Alan Modra <amodra@bigpond.net.au>
* ldmain.c (link_callbacks): Remove "error_handler".
* ldmisc.c: Include elf-bfd.h.
(vfinfo): Sort comment. Handle %A. Use %A instead of
bfd_get_section_indent.
(error_handler): Delete.
* ldmisc.h (error_handler): Delete declaration.
2004-08-10 Alan Modra <amodra@bigpond.net.au> 2004-08-10 Alan Modra <amodra@bigpond.net.au>
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Call * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Call

View file

@ -156,8 +156,7 @@ static struct bfd_link_callbacks link_callbacks =
reloc_overflow, reloc_overflow,
reloc_dangerous, reloc_dangerous,
unattached_reloc, unattached_reloc,
notice, notice
error_handler
}; };
struct bfd_link_info link_info; struct bfd_link_info link_info;

View file

@ -1,6 +1,6 @@
/* ldmisc.c /* ldmisc.c
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2000, 2002, 2003 2002, 2003, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support. Written by Steve Chamberlain of Cygnus Support.
@ -35,27 +35,29 @@
#include "ldlex.h" #include "ldlex.h"
#include "ldmain.h" #include "ldmain.h"
#include "ldfile.h" #include "ldfile.h"
#include "elf-bfd.h"
/* /*
%% literal % %% literal %
%F error is fatal %A section name from a section
%P print program name
%S print script file and linenumber
%E current bfd error or errno
%I filename from a lang_input_statement_type
%B filename from a bfd %B filename from a bfd
%T symbol name
%X no object output, fail return
%V hex bfd_vma
%v hex bfd_vma, no leading zeros
%W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
%C clever filename:linenumber with function %C clever filename:linenumber with function
%D like %C, but no function name %D like %C, but no function name
%E current bfd error or errno
%F error is fatal
%G like %D, but only function name %G like %D, but only function name
%I filename from a lang_input_statement_type
%P print program name
%R info about a relent %R info about a relent
%s arbitrary string, like printf %S print script file and linenumber
%T symbol name
%V hex bfd_vma
%W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
%X no object output, fail return
%d integer, like printf %d integer, like printf
%s arbitrary string, like printf
%u integer, like printf %u integer, like printf
%v hex bfd_vma, no leading zeros
*/ */
static void static void
@ -158,6 +160,30 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
} }
break; break;
case 'A':
/* section name from a section */
{
asection *sec = va_arg (arg, asection *);
bfd *abfd = sec->owner;
const char *group = NULL;
struct coff_comdat_info *ci;
fprintf (fp, "%s", sec->name);
if (abfd != NULL
&& bfd_get_flavour (abfd) == bfd_target_elf_flavour
&& elf_next_in_group (sec) != NULL
&& (sec->flags & SEC_GROUP) == 0)
group = elf_group_name (sec);
else if (abfd != NULL
&& bfd_get_flavour (abfd) == bfd_target_coff_flavour
&& (ci = bfd_coff_get_comdat_section (sec->owner,
sec)) != NULL)
group = ci->name;
if (group != NULL)
fprintf (fp, "[%s]", group);
}
break;
case 'B': case 'B':
/* filename from a bfd */ /* filename from a bfd */
{ {
@ -241,7 +267,6 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
const char *functionname; const char *functionname;
unsigned int linenumber; unsigned int linenumber;
bfd_boolean discard_last; bfd_boolean discard_last;
char *sec_name;
abfd = va_arg (arg, bfd *); abfd = va_arg (arg, bfd *);
section = va_arg (arg, asection *); section = va_arg (arg, asection *);
@ -270,11 +295,7 @@ vfinfo (FILE *fp, const char *fmt, va_list arg)
} }
} }
sec_name = bfd_get_section_ident (section); lfinfo (fp, "%B(%A+0x%v)", abfd, section, offset);
lfinfo (fp, "%B(%s+0x%v)", abfd,
sec_name ? sec_name : section->name, offset);
if (sec_name)
free (sec_name);
discard_last = TRUE; discard_last = TRUE;
if (bfd_find_nearest_line (abfd, section, asymbols, offset, if (bfd_find_nearest_line (abfd, section, asymbols, offset,
@ -494,64 +515,3 @@ ld_abort (const char *file, int line, const char *fn)
einfo (_("%P%F: please report this bug\n")); einfo (_("%P%F: please report this bug\n"));
xexit (1); xexit (1);
} }
bfd_boolean
error_handler (int id, const char *fmt, ...)
{
va_list arg;
va_start (arg, fmt);
switch (id)
{
default:
break;
/* We can be called with
error_handler (-LD_DEFINITION_IN_DISCARDED_SECTION, "", 0);
to make this error non-fatal and
error_handler (-LD_DEFINITION_IN_DISCARDED_SECTION, "", 1);
to make this error fatal. */
case -LD_DEFINITION_IN_DISCARDED_SECTION:
case LD_DEFINITION_IN_DISCARDED_SECTION:
{
static struct bfd_hash_table *hash;
static int fatal = 1;
const char *name;
if (id == -LD_DEFINITION_IN_DISCARDED_SECTION)
{
fatal = va_arg (arg, int);
goto out;
}
name = va_arg (arg, const char *);
/* Only warn once about a particular undefined symbol. */
if (hash == NULL)
{
hash = xmalloc (sizeof (struct bfd_hash_table));
if (! bfd_hash_table_init (hash, bfd_hash_newfunc))
einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
}
if (bfd_hash_lookup (hash, name, FALSE, FALSE) != NULL)
goto out;
if (bfd_hash_lookup (hash, name, TRUE, TRUE) == NULL)
einfo (_("%F%P: bfd_hash_lookup failed: %E\n"));
if (fatal)
config.make_executable = FALSE;
}
break;
}
vfinfo (stderr, fmt, arg);
out:
va_end (arg);
return TRUE;
}

View file

@ -1,5 +1,5 @@
/* ldmisc.h - /* ldmisc.h -
Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2001, 2003 Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2001, 2003, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker. This file is part of GLD, the Gnu Linker.
@ -22,7 +22,6 @@
#ifndef LDMISC_H #ifndef LDMISC_H
#define LDMISC_H #define LDMISC_H
extern bfd_boolean error_handler (int, const char *, ...);
extern void einfo (const char *, ...); extern void einfo (const char *, ...);
extern void minfo (const char *, ...); extern void minfo (const char *, ...);
extern void info_msg (const char *, ...); extern void info_msg (const char *, ...);