* 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.
+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>
* elf32-i386.c (elf_i386_relocate_section): Report unrecognized
default:
(*_bfd_error_handler)
- (_("%s: Unknown section type in a.out.adobe file: %x\n"),
- bfd_archive_filename (abfd), ext->e_type[0]);
+ (_("%B: Unknown section type in a.out.adobe file: %x\n"),
+ abfd, ext->e_type[0]);
goto no_more_sections;
}
/* 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.
Written by Hans-Peter Nilsson.
if (r_type > 2)
{
- (*_bfd_error_handler) (_("%s: Invalid relocation type imported: %d"),
- bfd_archive_filename (abfd), r_type);
+ (*_bfd_error_handler) (_("%B: Invalid relocation type imported: %d"),
+ 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;
if (r_extern && r_index > symcount)
{
(*_bfd_error_handler)
- (_("%s: Bad relocation record imported: %d"),
- bfd_archive_filename (abfd), r_index);
+ (_("%B: Bad relocation record imported: %d"), abfd, r_index);
bfd_set_error (bfd_error_wrong_format);
BFD_RELOC_ARM_GOTOFF,
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. */
BFD_RELOC_ARM_RELABS32,
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_canonicalize_reloc
void bfd_preserve_finish (bfd *, struct bfd_preserve *);
-char *bfd_get_section_ident (asection *sec);
-
/* Extracted from archive.c. */
symindex bfd_get_next_mapent
(bfd *abfd, symindex previous, carsym **sym);
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
-_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)
fprintf (stderr, "%s: ", _bfd_error_program_name);
else
fprintf (stderr, "BFD: ");
- va_start (p, s);
- vfprintf (stderr, s, p);
- va_end (p);
+ va_start (ap, fmt);
+ new_fmt = fmt;
+ bufp = buf;
+
+ /* 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);
- fprintf (stderr, "\n");
+ putc ('\n', stderr);
}
/* This is a function pointer to the routine which should handle BFD
{
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);
-}
\f
/*
SECTION
objalloc. */
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;
-}
if (myh == NULL)
/* xgettext:c-format */
- _bfd_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"),
- bfd_archive_filename (input_bfd), tmp_name, name);
+ _bfd_error_handler (_("%B: unable to find THUMB glue '%s' for `%s'"),
+ input_bfd, tmp_name, name);
free (tmp_name);
if (myh == NULL)
/* xgettext:c-format */
- _bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"),
- bfd_archive_filename (input_bfd), tmp_name, name);
+ _bfd_error_handler (_("%B: unable to find ARM glue '%s' for `%s'"),
+ input_bfd, tmp_name, name);
free (tmp_name);
if (h_sec->owner != NULL
&& INTERWORK_SET (h_sec->owner)
&& ! INTERWORK_FLAG (h_sec->owner))
- {
- _bfd_error_handler
- /* xgettext:c-format */
- (_("%s(%s): warning: interworking not enabled."),
- bfd_archive_filename (h_sec->owner), name);
- _bfd_error_handler
- /* xgettext:c-format */
- (_(" first occurrence: %s: arm call to thumb"),
- bfd_archive_filename (input_bfd));
- }
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%B(%s): warning: interworking not enabled.\n"
+ " first occurrence: %B: arm call to thumb"),
+ h_sec->owner, input_bfd, name);
--my_offset;
myh->root.u.def.value = my_offset;
&& INTERWORK_SET (h_sec->owner)
&& ! INTERWORK_FLAG (h_sec->owner)
&& ! globals->support_old_code)
- {
- _bfd_error_handler
- /* xgettext:c-format */
- (_("%s(%s): warning: interworking not enabled."),
- bfd_archive_filename (h_sec->owner), name);
- _bfd_error_handler
- /* xgettext:c-format */
- (_(" first occurrence: %s: thumb call to arm"),
- bfd_archive_filename (input_bfd));
- _bfd_error_handler
- (_(" consider relinking with --support-old-code enabled"));
- }
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%B(%s): warning: interworking not enabled.\n"
+ " first occurrence: %B: thumb call to arm\n"
+ " consider relinking with --support-old-code enabled"),
+ h_sec->owner, input_bfd, name);
-- my_offset;
myh->root.u.def.value = my_offset;
break;
case bfd_reloc_outofrange:
(*_bfd_error_handler)
- (_("%s: bad reloc address 0x%lx in section `%s'"),
- bfd_archive_filename (input_bfd),
- (unsigned long) rel->r_vaddr,
- bfd_get_section_name (input_bfd, input_section));
+ (_("%B: bad reloc address 0x%lx in section `%A'"),
+ input_bfd, input_section, (unsigned long) rel->r_vaddr);
return FALSE;
case bfd_reloc_overflow:
{
/* If the index is outside of the range of our table, something has gone wrong. */
if (symndx >= obj_conv_table_size (abfd))
{
- _bfd_error_handler (_("%s: illegal symbol index in reloc: %d"),
- bfd_archive_filename (abfd), symndx);
+ _bfd_error_handler (_("%B: illegal symbol index in reloc: %d"),
+ abfd, symndx);
continue;
}
{
_bfd_error_handler
/* xgettext: c-format */
- (_("ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d"),
- bfd_archive_filename (ibfd), APCS_26_FLAG (ibfd) ? 26 : 32,
- bfd_get_filename (obfd), APCS_26_FLAG (obfd) ? 26 : 32
+ (_("ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"),
+ ibfd, obfd,
+ APCS_26_FLAG (ibfd) ? 26 : 32,
+ APCS_26_FLAG (obfd) ? 26 : 32
);
bfd_set_error (bfd_error_wrong_format);
if (APCS_FLOAT_FLAG (ibfd))
/* 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
/* 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_get_filename (obfd));
+ _bfd_error_handler (msg, ibfd, obfd);
bfd_set_error (bfd_error_wrong_format);
return FALSE;
if (PIC_FLAG (ibfd))
/* 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
/* xgettext: c-format */
- msg = _("ERROR: %s is compiled as absolute position code, whereas target %s is position independent");
- _bfd_error_handler (msg, bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ msg = _("ERROR: %B is compiled as absolute position code, whereas target %B is position independent");
+ _bfd_error_handler (msg, ibfd, obfd);
bfd_set_error (bfd_error_wrong_format);
return FALSE;
if (INTERWORK_FLAG (ibfd))
/* xgettext: c-format */
- msg = _("Warning: %s supports interworking, whereas %s does not");
+ msg = _("Warning: %B supports interworking, whereas %B does not");
else
/* 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_get_filename (obfd));
+ _bfd_error_handler (msg, ibfd, obfd);
}
}
else
{
if (flag)
/* xgettext: c-format */
- _bfd_error_handler (_("Warning: Not setting interworking flag of %s since it has already been specified as non-interworking"),
- bfd_archive_filename (abfd));
+ _bfd_error_handler (_("Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"),
+ abfd);
else
/* xgettext: c-format */
- _bfd_error_handler (_("Warning: Clearing the interworking flag of %s due to outside request"),
- bfd_archive_filename (abfd));
+ _bfd_error_handler (_("Warning: Clearing the interworking flag of %B due to outside request"),
+ abfd);
flag = 0;
}
{
/* xgettext:c-format */
_bfd_error_handler (("\
-Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it"),
- bfd_get_filename (dest),
- bfd_archive_filename (src));
+Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"),
+ dest, src);
}
SET_INTERWORK_FLAG (dest, 0);
/* BFD back-end for Intel i860 COFF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in coff-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995
if (dst->r_symndx < 0 || dst->r_symndx >= obj_conv_table_size (abfd))
{
(*_bfd_error_handler)
- (_("%s: warning: illegal symbol index %ld in relocs"),
- bfd_archive_filename (abfd), dst->r_symndx);
+ (_("%B: warning: illegal symbol index %ld in relocs"),
+ abfd, dst->r_symndx);
cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL;
}
/* 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.
{
BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
- _bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"),
- bfd_archive_filename (abfd),
+ _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"),
+ abfd,
reloc_entry->howto->name,
reloc_entry->howto->type);
&& output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
{
(*_bfd_error_handler)
- (_("%s: compiled for a %s system and target is %s.\n"),
- bfd_archive_filename (input_bfd),
+ (_("%B: compiled for a %s system and target is %s.\n"),
+ input_bfd,
bfd_big_endian (input_bfd) ? _("big endian") : _("little endian"),
bfd_big_endian (output_bfd) ? _("big endian") : _("little endian"));
switch (r_type)
{
default:
- _bfd_error_handler (_("%s: unsupported relocation type 0x%02x"),
- bfd_archive_filename (input_bfd), r_type);
+ _bfd_error_handler (_("%B: unsupported relocation type 0x%02x"),
+ input_bfd, r_type);
bfd_set_error (bfd_error_bad_value);
return FALSE;
case IMAGE_REL_MCORE_ABSOLUTE:
- fprintf (stderr,
- _("Warning: unsupported reloc %s <file %s, section %s>\n"),
- howto->name,
- bfd_archive_filename (input_bfd),
- input_section->name);
-
- fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n",
- rel->r_symndx, my_name, (long) rel->r_vaddr,
- (unsigned long) rel->r_vaddr);
+ _bfd_error_handler
+ (_("Warning: unsupported reloc %s <file %B, section %A>\n"
+ "sym %ld (%s), r_vaddr %ld (%lx)"),
+ input_bfd, input_section, howto->name,
+ rel->r_symndx, my_name, (long) rel->r_vaddr,
+ (unsigned long) rel->r_vaddr);
break;
case IMAGE_REL_MCORE_PCREL_IMM8BY4:
{
default:
(*_bfd_error_handler)
- (_("%s: unsupported relocation type 0x%02x"),
- bfd_archive_filename (input_bfd), r_type);
+ (_("%B: unsupported relocation type 0x%02x"), input_bfd, r_type);
bfd_set_error (bfd_error_bad_value);
return FALSE;
case IMAGE_REL_PPC_TOCREL16:
if ((bfd_vma) our_toc_offset >= 65535)
{
(*_bfd_error_handler)
- (_("%s: Relocation for %s of %lx exceeds Toc size limit"),
- bfd_archive_filename (input_bfd), name,
+ (_("%B: Relocation for %s of %lx exceeds Toc size limit"),
+ input_bfd, name,
(unsigned long) our_toc_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
&& (bfd_vma) our_toc_offset > toc_section->size)
{
(*_bfd_error_handler)
- (_("%s: Relocation exceeds allocated TOC (%lx)"),
- bfd_archive_filename (input_bfd),
- (unsigned long) toc_section->size);
+ (_("%B: Relocation exceeds allocated TOC (%lx)"),
+ input_bfd, (unsigned long) toc_section->size);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
else
my_name = h->root.root.root.string;
- fprintf (stderr,
- _("Warning: unsupported reloc %s <file %s, section %s>\n"),
- howto->name,
- bfd_archive_filename(input_bfd),
- input_section->name);
-
- fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n",
- rel->r_symndx, my_name, (long) rel->r_vaddr,
- (unsigned long) rel->r_vaddr);
+ (*_bfd_error_handler)
+ (_("Warning: unsupported reloc %s <file %B, section %A>\n"
+ "sym %ld (%s), r_vaddr %ld (%lx)"),
+ input_bfd, input_section, howto->name,
+ rel->r_symndx, my_name, (long) rel->r_vaddr,
+ (unsigned long) rel->r_vaddr);
}
break;
case IMAGE_REL_PPC_IMGLUE:
my_name = h->root.root.root.string;
(*_bfd_error_handler)
- (_("%s: Out of order IMGLUE reloc for %s"),
- bfd_archive_filename (input_bfd), my_name);
+ (_("%B: Out of order IMGLUE reloc for %s"), input_bfd, my_name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
else
{
(*_bfd_error_handler)
- (_("%s: symbol `%s' has unrecognized smclas %d"),
- bfd_archive_filename (abfd), symbol_name, aux->x_csect.x_smclas);
+ (_("%B: symbol `%s' has unrecognized smclas %d"),
+ abfd, symbol_name, aux->x_csect.x_smclas);
bfd_set_error (bfd_error_bad_value);
}
laddr += ((irel->r_offset & 0xffffffff) ^ 0x80000000) - 0x80000000;
if (laddr >= sec->size)
{
- (*_bfd_error_handler) ("%s: 0x%lx: warning: bad R_SH_USES offset",
- bfd_archive_filename (abfd),
- (unsigned long) irel->r_vaddr);
+ (*_bfd_error_handler) ("%B: 0x%lx: warning: bad R_SH_USES offset",
+ abfd, (unsigned long) irel->r_vaddr);
continue;
}
insn = bfd_get_16 (abfd, contents + laddr);
if ((insn & 0xf000) != 0xd000)
{
((*_bfd_error_handler)
- ("%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x",
- bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr, insn));
+ ("%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x",
+ abfd, (unsigned long) irel->r_vaddr, insn));
continue;
}
if (paddr >= sec->size)
{
((*_bfd_error_handler)
- ("%s: 0x%lx: warning: bad R_SH_USES load offset",
- bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
+ ("%B: 0x%lx: warning: bad R_SH_USES load offset",
+ abfd, (unsigned long) irel->r_vaddr));
continue;
}
if (irelfn >= irelend)
{
((*_bfd_error_handler)
- ("%s: 0x%lx: warning: could not find expected reloc",
- bfd_archive_filename (abfd), (unsigned long) paddr));
+ ("%B: 0x%lx: warning: could not find expected reloc",
+ abfd, (unsigned long) paddr));
continue;
}
if (sym.n_scnum != 0 && sym.n_scnum != sec->target_index)
{
((*_bfd_error_handler)
- ("%s: 0x%lx: warning: symbol in unexpected section",
- bfd_archive_filename (abfd), (unsigned long) paddr));
+ ("%B: 0x%lx: warning: symbol in unexpected section",
+ abfd, (unsigned long) paddr));
continue;
}
if (irelcount >= irelend)
{
((*_bfd_error_handler)
- ("%s: 0x%lx: warning: could not find expected COUNT reloc",
- bfd_archive_filename (abfd), (unsigned long) paddr));
+ ("%B: 0x%lx: warning: could not find expected COUNT reloc",
+ abfd, (unsigned long) paddr));
continue;
}
just deleted one. */
if (irelcount->r_offset == 0)
{
- ((*_bfd_error_handler) ("%s: 0x%lx: warning: bad count",
- bfd_archive_filename (abfd),
- (unsigned long) paddr));
+ ((*_bfd_error_handler) ("%B: 0x%lx: warning: bad count",
+ abfd, (unsigned long) paddr));
continue;
}
if (overflow)
{
((*_bfd_error_handler)
- ("%s: 0x%lx: fatal: reloc overflow while relaxing",
- bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
+ ("%B: 0x%lx: fatal: reloc overflow while relaxing",
+ abfd, (unsigned long) irel->r_vaddr));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
|| obj_raw_syments (abfd) != NULL)
{
((*_bfd_error_handler)
- ("%s: fatal: generic symbols retrieved before relaxing",
- bfd_archive_filename (abfd)));
+ ("%B: fatal: generic symbols retrieved before relaxing", abfd));
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
if (overflow)
{
((*_bfd_error_handler)
- ("%s: 0x%lx: fatal: reloc overflow while relaxing",
- bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
+ ("%B: 0x%lx: fatal: reloc overflow while relaxing",
+ abfd, (unsigned long) irel->r_vaddr));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
|| (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
{
(*_bfd_error_handler)
- ("%s: illegal symbol index %ld in relocs",
- bfd_archive_filename (input_bfd), symndx);
+ ("%B: illegal symbol index %ld in relocs",
+ input_bfd, symndx);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
/* 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)
This file is part of BFD, the Binary File Descriptor library.
if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
{
(*_bfd_error_handler)
- (_("%s: warning: illegal symbol index %ld in relocs"),
- bfd_archive_filename (abfd), reloc->r_symndx);
+ (_("%B: warning: illegal symbol index %ld in relocs"),
+ abfd, reloc->r_symndx);
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL;
}
break;
case bfd_reloc_outofrange:
(*_bfd_error_handler)
- (_("%s: bad reloc address 0x%lx in section `%s'"),
- bfd_archive_filename (input_bfd),
- (unsigned long) rel->r_vaddr,
- bfd_get_section_name (input_bfd, input_section));
+ (_("%B: bad reloc address 0x%lx in section `%A'"),
+ input_bfd, input_section, (unsigned long) rel->r_vaddr);
return FALSE;
case bfd_reloc_overflow:
{
else
{
(*_bfd_error_handler)
- (_("%s: symbol `%s' has unrecognized smclas %d"),
- bfd_archive_filename (abfd), symbol_name, aux->x_csect.x_smclas);
+ (_("%B: symbol `%s' has unrecognized smclas %d"),
+ abfd, symbol_name, aux->x_csect.x_smclas);
bfd_set_error (bfd_error_bad_value);
}
/* Generate a warning message rather using the 'unhandled'
variable as this will allow some .sys files generate by
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_archive_filename (abfd), name);
+ _bfd_error_handler (_("%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"),
+ abfd, name);
#endif
break;
case IMAGE_SCN_MEM_EXECUTE:
if (unhandled != NULL)
{
(*_bfd_error_handler)
- (_("%s (%s): Section flag %s (0x%x) ignored"),
- bfd_archive_filename (abfd), name, unhandled, flag);
+ (_("%B (%s): Section flag %s (0x%x) ignored"),
+ abfd, name, unhandled, flag);
result = FALSE;
}
}
if (native_lineno == NULL)
{
(*_bfd_error_handler)
- (_("%s: warning: line number table read failed"),
- bfd_archive_filename (abfd));
+ (_("%B: warning: line number table read failed"), abfd);
return FALSE;
}
amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent);
|| (bfd_vma) symndx >= obj_raw_syment_count (abfd))
{
(*_bfd_error_handler)
- (_("%s: warning: illegal symbol index %ld in line numbers"),
- bfd_archive_filename (abfd), dst.l_addr.l_symndx);
+ (_("%B: warning: illegal symbol index %ld in line numbers"),
+ abfd, dst.l_addr.l_symndx);
symndx = 0;
warned = TRUE;
}
if (sym->lineno != NULL && ! warned)
{
(*_bfd_error_handler)
- (_("%s: warning: duplicate line number information for `%s'"),
- bfd_archive_filename (abfd),
- bfd_asymbol_name (&sym->symbol));
+ (_("%B: warning: duplicate line number information for `%s'"),
+ abfd, bfd_asymbol_name (&sym->symbol));
}
sym->lineno = cache_ptr;
}
case C_HIDDEN: /* Ext symbol in dmert public lib. */
default:
(*_bfd_error_handler)
- (_("%s: Unrecognized storage class %d for %s symbol `%s'"),
- bfd_archive_filename (abfd), src->u.syment.n_sclass,
+ (_("%B: Unrecognized storage class %d for %s symbol `%s'"),
+ abfd, src->u.syment.n_sclass,
dst->symbol.section->name, dst->symbol.name);
dst->symbol.flags = BSF_DEBUGGING;
dst->symbol.value = (src->u.syment.n_value);
char buf[SYMNMLEN + 1];
(*_bfd_error_handler)
- (_("warning: %s: local symbol `%s' has no section"),
- bfd_archive_filename (abfd),
- _bfd_coff_internal_syment_name (abfd, syment, buf));
+ (_("warning: %B: local symbol `%s' has no section"),
+ abfd, _bfd_coff_internal_syment_name (abfd, syment, buf));
}
return COFF_SYMBOL_LOCAL;
if (dst.r_symndx < 0 || dst.r_symndx >= obj_conv_table_size (abfd))
{
(*_bfd_error_handler)
- (_("%s: warning: illegal symbol index %ld in relocs"),
- bfd_archive_filename (abfd), dst.r_symndx);
+ (_("%B: warning: illegal symbol index %ld in relocs"),
+ abfd, dst.r_symndx);
cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL;
}
if (cache_ptr->howto == NULL)
{
(*_bfd_error_handler)
- (_("%s: illegal relocation type %d at address 0x%lx"),
- bfd_archive_filename (abfd), dst.r_type, (long) dst.r_vaddr);
+ (_("%B: illegal relocation type %d at address 0x%lx"),
+ abfd, dst.r_type, (long) dst.r_vaddr);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (strsize < STRING_SIZE_SIZE)
{
(*_bfd_error_handler)
- (_("%s: bad string table size %lu"), bfd_archive_filename (abfd),
- (unsigned long) strsize);
+ (_("%B: bad string table size %lu"), abfd, (unsigned long) strsize);
bfd_set_error (bfd_error_bad_value);
return NULL;
}
&& (BTYPE ((*sym_hash)->type) == T_NULL
|| BTYPE (sym.n_type) == T_NULL)))
(*_bfd_error_handler)
- (_("Warning: type of symbol `%s' changed from %d to %d in %s"),
- name, (*sym_hash)->type, sym.n_type,
- bfd_archive_filename (abfd));
+ (_("Warning: type of symbol `%s' changed from %d to %d in %B"),
+ abfd, name, (*sym_hash)->type, sym.n_type);
/* We don't want to change from a meaningful
base type to a null one, but if we know
if ((o->flags & SEC_RELOC) != 0
&& o->reloc_count != 0)
{
- ((*_bfd_error_handler)
- (_("%s: relocs in section `%s', but it has no contents"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, o)));
+ (*_bfd_error_handler)
+ (_("%B: relocs in section `%A', but it has no contents"),
+ input_bfd, o);
bfd_set_error (bfd_error_no_contents);
return FALSE;
}
|| (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
{
(*_bfd_error_handler)
- ("%s: illegal symbol index %ld in relocs",
- bfd_archive_filename (input_bfd), symndx);
+ ("%B: illegal symbol index %ld in relocs", input_bfd, symndx);
return FALSE;
}
else
break;
case bfd_reloc_outofrange:
(*_bfd_error_handler)
- (_("%s: bad reloc address 0x%lx in section `%s'"),
- bfd_archive_filename (input_bfd),
- (unsigned long) rel->r_vaddr,
- bfd_get_section_name (input_bfd, input_section));
+ (_("%B: bad reloc address 0x%lx in section `%A'"),
+ input_bfd, input_section, (unsigned long) rel->r_vaddr);
return FALSE;
case bfd_reloc_overflow:
{
&& (out == bfd_mach_arm_XScale || out == bfd_mach_arm_iWMMXt))
{
_bfd_error_handler (_("\
-ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
+ ibfd, obfd);
bfd_set_error (bfd_error_wrong_format);
return FALSE;
}
&& (in == bfd_mach_arm_XScale || in == bfd_mach_arm_iWMMXt))
{
_bfd_error_handler (_("\
-ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"),
- bfd_archive_filename (obfd),
- bfd_get_filename (ibfd));
+ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
+ obfd, ibfd);
bfd_set_error (bfd_error_wrong_format);
return FALSE;
}
if (!SH_VALID_CO_ARCH_SET (merged_arch))
{
(*_bfd_error_handler)
- ("%s: uses %s instructions while previous modules use %s instructions",
- bfd_archive_filename (ibfd),
+ ("%B: uses %s instructions while previous modules use %s instructions",
+ ibfd,
SH_ARCH_SET_HAS_DSP (new_arch) ? "dsp" : "floating point",
SH_ARCH_SET_HAS_DSP (new_arch) ? "floating point" : "dsp");
bfd_set_error (bfd_error_bad_value);
/* 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.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
fdr.issBase = output_symhdr->issMax;
fdr.cbSs = 0;
fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr,
- bfd_archive_filename (input_bfd));
+ input_bfd->filename);
if (fdr.rss == -1)
return FALSE;
fdr.isymBase = output_symhdr->isymMax;
if (sym_sec->output_section == NULL && dyn_h == NULL)
{
(*_bfd_error_handler)
- (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd), h->root.root.string,
- bfd_get_section_name (input_bfd, input_section));
+ (_("%B(%A): warning: unresolvable relocation against symbol `%s'"),
+ input_bfd, input_section, h->root.root.string);
relocation = 0;
}
else if (sym_sec->output_section)
if (dyn_h == NULL)
{
(*_bfd_error_handler)
- (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd), h->root.root.string,
- bfd_get_section_name (input_bfd, input_section));
+ (_("%B(%A): warning: unresolvable relocation against symbol `%s'"),
+ input_bfd, input_section, h->root.root.string);
}
relocation = 0;
}
if (dyn_h == NULL)
{
(*_bfd_error_handler)
- (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd), h->root.root.string,
- bfd_get_section_name (input_bfd, input_section));
+ (_("%B(%A): warning: unresolvable relocation against symbol `%s'"),
+ input_bfd, input_section, h->root.root.string);
}
relocation = 0;
}
if (strindex >= hdr->sh_size)
{
(*_bfd_error_handler)
- (_("%s: invalid string offset %u >= %lu for section `%s'"),
- bfd_archive_filename (abfd), strindex, (unsigned long) hdr->sh_size,
+ (_("%B: invalid string offset %u >= %lu for section `%s'"),
+ abfd, strindex, (unsigned long) hdr->sh_size,
((shindex == elf_elfheader(abfd)->e_shstrndx
&& strindex == hdr->sh_name)
? ".shstrtab"
if (idx >= shnum)
{
((*_bfd_error_handler)
- (_("%s: invalid SHT_GROUP entry"),
- bfd_archive_filename (abfd)));
+ (_("%B: invalid SHT_GROUP entry"), abfd));
idx = 0;
}
dest->shdr = elf_elfsections (abfd)[idx];
if (elf_group_name (newsect) == NULL)
{
- (*_bfd_error_handler) (_("%s: no group info for section %s"),
- bfd_archive_filename (abfd), newsect->name);
+ (*_bfd_error_handler) (_("%B: no group info for section %A"),
+ abfd, newsect);
}
return TRUE;
}
{
/* There are some unknown sections in the group. */
(*_bfd_error_handler)
- (_("%s: unknown [%d] section `%s' in group [%s]"),
- bfd_archive_filename (abfd),
+ (_("%B: unknown [%d] section `%s' in group [%s]"),
+ abfd,
(unsigned int) idx->shdr->sh_type,
elf_string_from_elf_strtab (abfd, idx->shdr->sh_name),
shdr->bfd_section->name);
|| hdr->sh_link >= num_sec)
{
((*_bfd_error_handler)
- (_("%s: invalid link %lu for reloc section %s (index %u)"),
- bfd_archive_filename (abfd), hdr->sh_link, name, shindex));
+ (_("%B: invalid link %lu for reloc section %s (index %u)"),
+ abfd, hdr->sh_link, name, shindex));
return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
}
const struct elf_backend_data *bed
= get_elf_backend_data (abfd);
if (bed->link_order_error_handler)
- {
- char *name = bfd_get_section_ident (s);
- bed->link_order_error_handler
- (_("%s: warning: sh_link not set for section `%s'"),
- bfd_archive_filename (abfd),
- name ? name : s->name);
- if (name)
- free (name);
- }
+ bed->link_order_error_handler
+ (_("%B: warning: sh_link not set for section `%S'"),
+ abfd, s);
}
else
{
/* This case can occur when using --strip-symbol on a symbol
which is used in a relocation entry. */
(*_bfd_error_handler)
- (_("%s: symbol `%s' required but not present"),
- bfd_archive_filename (abfd), bfd_asymbol_name (asym_ptr));
+ (_("%B: symbol `%s' required but not present"),
+ abfd, bfd_asymbol_name (asym_ptr));
bfd_set_error (bfd_error_no_symbols);
return -1;
}
a warning is produced. */
if (segment->p_type == PT_LOAD)
(*_bfd_error_handler)
- (_("%s: warning: Empty loadable segment detected, is this intentional ?\n"),
- bfd_archive_filename (ibfd));
+ (_("%B: warning: Empty loadable segment detected, is this intentional ?\n"),
+ ibfd);
map->count = 0;
*pointer_to_map = map;
fail:
(*_bfd_error_handler)
- (_("%s: unsupported relocation type %s"),
- bfd_archive_filename (abfd), areloc->howto->name);
+ (_("%B: unsupported relocation type %s"),
+ abfd, areloc->howto->name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (hash == NULL)
/* xgettext:c-format */
- (*_bfd_error_handler) (_("%s: unable to find THUMB glue '%s' for `%s'"),
- bfd_archive_filename (input_bfd), tmp_name, name);
+ (*_bfd_error_handler) (_("%B: unable to find THUMB glue '%s' for `%s'"),
+ input_bfd, tmp_name, name);
free (tmp_name);
if (myh == NULL)
/* xgettext:c-format */
- (*_bfd_error_handler) (_("%s: unable to find ARM glue '%s' for `%s'"),
- bfd_archive_filename (input_bfd), tmp_name, name);
+ (*_bfd_error_handler) (_("%B: unable to find ARM glue '%s' for `%s'"),
+ input_bfd, tmp_name, name);
free (tmp_name);
globals->no_pipeline_knowledge = no_pipeline_knowledge;
if (byteswap_code && !bfd_big_endian (abfd))
{
- _bfd_error_handler (
- _("%s: BE8 images only valid in big-endian mode."),
- bfd_archive_filename (abfd));
+ _bfd_error_handler (_("%B: BE8 images only valid in big-endian mode."),
+ abfd);
return FALSE;
}
globals->byteswap_code = byteswap_code;
&& !INTERWORK_FLAG (sym_sec->owner))
{
(*_bfd_error_handler)
- (_("%s(%s): warning: interworking not enabled."),
- bfd_archive_filename (sym_sec->owner), name);
- (*_bfd_error_handler)
- (_(" first occurrence: %s: thumb call to arm"),
- bfd_archive_filename (input_bfd));
+ (_("%B(%s): warning: interworking not enabled.\n"
+ " first occurrence: %B: thumb call to arm"),
+ sym_sec->owner, input_bfd, name);
return FALSE;
}
&& !INTERWORK_FLAG (sym_sec->owner))
{
(*_bfd_error_handler)
- (_("%s(%s): warning: interworking not enabled."),
- bfd_archive_filename (sym_sec->owner), name);
- (*_bfd_error_handler)
- (_(" first occurrence: %s: arm call to thumb"),
- bfd_archive_filename (input_bfd));
+ (_("%B(%s): warning: interworking not enabled.\n"
+ " first occurrence: %B: arm call to thumb"),
+ sym_sec->owner, input_bfd, name);
}
--my_offset;
/* FIXME: Should we translate the instruction into a BL
instruction instead ? */
if (sym_flags != STT_ARM_TFUNC)
- (*_bfd_error_handler) (_("\
-%s: Warning: Arm BLX instruction targets Arm function '%s'."),
- bfd_archive_filename (input_bfd),
- h ? h->root.root.string : "(local)");
+ (*_bfd_error_handler)
+ (_("\%B: Warning: Arm BLX instruction targets Arm function '%s'."),
+ input_bfd,
+ h ? h->root.root.string : "(local)");
}
else
#endif
/* FIXME: Should we translate the instruction into a BL
instruction instead ? */
if (sym_flags == STT_ARM_TFUNC)
- (*_bfd_error_handler) (_("\
-%s: Warning: Thumb BLX instruction targets thumb function '%s'."),
- bfd_archive_filename (input_bfd),
- h ? h->root.root.string : "(local)");
+ (*_bfd_error_handler)
+ (_("%B: Warning: Thumb BLX instruction targets thumb function '%s'."),
+ input_bfd,
+ h ? h->root.root.string : "(local)");
}
else
#endif
if (howto->rightshift)
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): %s relocation against SEC_MERGE section"),
+ input_bfd, input_section,
(long) rel->r_offset, howto->name);
return FALSE;
}
default:
if (unresolved_reloc)
_bfd_error_handler
- (_("%s: warning: unresolvable relocation %d against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd),
+ (_("%B(%A): warning: unresolvable relocation %d against symbol `%s'"),
+ input_bfd, input_section,
r_type,
- h->root.root.string,
- bfd_get_section_name (input_bfd, input_section));
+ h->root.root.string);
break;
}
}
if (EF_ARM_EABI_VERSION (flags) == EF_ARM_EABI_UNKNOWN)
{
if (flags & EF_ARM_INTERWORK)
- (*_bfd_error_handler) (_("\
-Warning: Not setting interworking flag of %s since it has already been specified as non-interworking"),
- bfd_archive_filename (abfd));
+ (*_bfd_error_handler)
+ (_("Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"),
+ abfd);
else
- _bfd_error_handler (_("\
-Warning: Clearing the interworking flag of %s due to outside request"),
- bfd_archive_filename (abfd));
+ _bfd_error_handler
+ (_("Warning: Clearing the interworking flag of %B due to outside request"),
+ abfd);
}
}
else
if ((in_flags & EF_ARM_INTERWORK) != (out_flags & EF_ARM_INTERWORK))
{
if (out_flags & EF_ARM_INTERWORK)
- _bfd_error_handler (_("\
-Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it"),
- bfd_get_filename (obfd),
- bfd_archive_filename (ibfd));
+ _bfd_error_handler
+ (_("Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"),
+ obfd, ibfd);
in_flags &= ~EF_ARM_INTERWORK;
}
/* Complain about various flag mismatches. */
if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_VERSION (out_flags))
{
- _bfd_error_handler (_("\
-ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d"),
- bfd_archive_filename (ibfd),
- (in_flags & EF_ARM_EABIMASK) >> 24,
- bfd_get_filename (obfd),
- (out_flags & EF_ARM_EABIMASK) >> 24);
+ _bfd_error_handler
+ (_("ERROR: %B is compiled for EABI version %d, whereas %B is compiled for version %d"),
+ ibfd, obfd,
+ (in_flags & EF_ARM_EABIMASK) >> 24,
+ (out_flags & EF_ARM_EABIMASK) >> 24);
return FALSE;
}
{
if ((in_flags & EF_ARM_APCS_26) != (out_flags & EF_ARM_APCS_26))
{
- _bfd_error_handler (_("\
-ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d"),
- bfd_archive_filename (ibfd),
- in_flags & EF_ARM_APCS_26 ? 26 : 32,
- bfd_get_filename (obfd),
- out_flags & EF_ARM_APCS_26 ? 26 : 32);
+ _bfd_error_handler
+ (_("ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"),
+ ibfd, obfd,
+ in_flags & EF_ARM_APCS_26 ? 26 : 32,
+ out_flags & EF_ARM_APCS_26 ? 26 : 32);
flags_compatible = FALSE;
}
if ((in_flags & EF_ARM_APCS_FLOAT) != (out_flags & EF_ARM_APCS_FLOAT))
{
if (in_flags & EF_ARM_APCS_FLOAT)
- _bfd_error_handler (_("\
-ERROR: %s passes floats in float registers, whereas %s passes them in integer registers"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("ERROR: %B passes floats in float registers, whereas %B passes them in integer registers"),
+ ibfd, obfd);
else
- _bfd_error_handler (_("\
-ERROR: %s passes floats in integer registers, whereas %s passes them in float registers"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("ERROR: %B passes floats in integer registers, whereas %B passes them in float registers"),
+ ibfd, obfd);
flags_compatible = FALSE;
}
if ((in_flags & EF_ARM_VFP_FLOAT) != (out_flags & EF_ARM_VFP_FLOAT))
{
if (in_flags & EF_ARM_VFP_FLOAT)
- _bfd_error_handler (_("\
-ERROR: %s uses VFP instructions, whereas %s does not"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("ERROR: %B uses VFP instructions, whereas %B does not"),
+ ibfd, obfd);
else
- _bfd_error_handler (_("\
-ERROR: %s uses FPA instructions, whereas %s does not"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("ERROR: %B uses FPA instructions, whereas %B does not"),
+ ibfd, obfd);
flags_compatible = FALSE;
}
if ((in_flags & EF_ARM_MAVERICK_FLOAT) != (out_flags & EF_ARM_MAVERICK_FLOAT))
{
if (in_flags & EF_ARM_MAVERICK_FLOAT)
- _bfd_error_handler (_("\
-ERROR: %s uses Maverick instructions, whereas %s does not"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("ERROR: %B uses Maverick instructions, whereas %B does not"),
+ ibfd, obfd);
else
- _bfd_error_handler (_("\
-ERROR: %s does not use Maverick instructions, whereas %s does"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("ERROR: %B does not use Maverick instructions, whereas %B does"),
+ ibfd, obfd);
flags_compatible = FALSE;
}
|| (in_flags & EF_ARM_VFP_FLOAT) == 0)
{
if (in_flags & EF_ARM_SOFT_FLOAT)
- _bfd_error_handler (_("\
-ERROR: %s uses software FP, whereas %s uses hardware FP"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("ERROR: %B uses software FP, whereas %B uses hardware FP"),
+ ibfd, obfd);
else
- _bfd_error_handler (_("\
-ERROR: %s uses hardware FP, whereas %s uses software FP"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("ERROR: %B uses hardware FP, whereas %B uses software FP"),
+ ibfd, obfd);
flags_compatible = FALSE;
}
{
if (in_flags & EF_ARM_INTERWORK)
{
- _bfd_error_handler (_("\
-Warning: %s supports interworking, whereas %s does not"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("Warning: %B supports interworking, whereas %B does not"),
+ ibfd, obfd);
}
else
{
- _bfd_error_handler (_("\
-Warning: %s does not support interworking, whereas %s does"),
- bfd_archive_filename (ibfd),
- bfd_get_filename (obfd));
+ _bfd_error_handler
+ (_("Warning: %B does not support interworking, whereas %B does"),
+ ibfd, obfd);
}
}
}
else if (unresolved_reloc)
{
_bfd_error_handler
- (_("%s: unresolvable relocation %s against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd),
+ (_("%B(%A): unresolvable relocation %s against symbol `%s'"),
+ input_bfd,
+ input_section,
cris_elf_howto_table[r_type].name,
- symname,
- bfd_get_section_name (input_bfd, input_section));
+ symname);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
{
(*_bfd_error_handler)
((h->got.offset == (bfd_vma) -1)
- ? _("%s: No PLT nor GOT for relocation %s against\
- symbol `%s' from %s section")
- : _("%s: No PLT for relocation %s against\
- symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd),
+ ? _("%B(%A): No PLT nor GOT for relocation %s"
+ " against symbol `%s'")
+ : _("%B(%A): No PLT for relocation %s"
+ " against symbol `%s'"),
+ input_bfd,
+ input_section,
cris_elf_howto_table[r_type].name,
- symname[0] != '\0' ? symname : _("[whose name is lost]"),
- bfd_get_section_name (input_bfd, input_section));
+ symname[0] != '\0' ? symname : _("[whose name is lost]"));
/* FIXME: Perhaps blaming input is not the right thing to
do; this is probably an internal error. But it is true
allowed to pass us these kinds of things. */
if (h == NULL)
(*_bfd_error_handler)
- (_("%s: relocation %s with non-zero addend %d against local symbol from %s section"),
- bfd_archive_filename (input_bfd),
+ (_("%B(%A): relocation %s with non-zero addend %d"
+ " against local symbol"),
+ input_bfd,
+ input_section,
cris_elf_howto_table[r_type].name,
- rel->r_addend,
- bfd_get_section_name (input_bfd, input_section));
+ rel->r_addend);
else
(*_bfd_error_handler)
- (_("%s: relocation %s with non-zero addend %d against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd),
+ (_("%B(%A): relocation %s with non-zero addend %d"
+ " against symbol `%s'"),
+ input_bfd,
+ input_section,
cris_elf_howto_table[r_type].name,
rel->r_addend,
- symname[0] != '\0' ? symname : _("[whose name is lost]"),
- bfd_get_section_name (input_bfd, input_section));
+ symname[0] != '\0' ? symname : _("[whose name is lost]"));
bfd_set_error (bfd_error_bad_value);
return FALSE;
&& h->root.type == bfd_link_hash_undefweak))))
{
(*_bfd_error_handler)
- (_("%s: relocation %s is not allowed for global symbol: `%s' from %s section"),
- bfd_archive_filename (input_bfd),
+ (_("%B(%A): relocation %s is not allowed for global symbol: `%s'"),
+ input_bfd,
+ input_section,
cris_elf_howto_table[r_type].name,
- symname,
- bfd_get_section_name (input_bfd, input_section));
+ symname);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (sgot == NULL)
{
(*_bfd_error_handler)
- (_("%s: relocation %s in section %s with no GOT created"),
- bfd_archive_filename (input_bfd),
- cris_elf_howto_table[r_type].name,
- bfd_get_section_name (input_bfd, input_section));
+ (_("%B: relocation %s in section %A with no GOT created"),
+ input_bfd,
+ input_section,
+ cris_elf_howto_table[r_type].name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (sreloc == NULL)
{
(*_bfd_error_handler)
- (_("%s: Internal inconsistency; no relocation section %s"),
- bfd_archive_filename (input_bfd),
+ (_("%B: Internal inconsistency; no relocation section %s"),
+ input_bfd,
name);
bfd_set_error (bfd_error_bad_value);
{
/* FIXME: How do we make this optionally a warning only? */
(*_bfd_error_handler)
- (_("%s, section %s:\n relocation %s should not be used in a shared object; recompile with -fPIC"),
- bfd_archive_filename (abfd),
- sec->name,
+ (_("%B, section %A:\n relocation %s should not be used in a shared object; recompile with -fPIC"),
+ abfd,
+ sec,
cris_elf_howto_table[r_type].name);
}
/* Fall through. */
{
(*_bfd_error_handler)
((new_flags & EF_CRIS_UNDERSCORE)
- ? _("%s: uses _-prefixed symbols, but writing file with non-prefixed symbols")
- : _("%s: uses non-prefixed symbols, but writing file with _-prefixed symbols"),
- bfd_archive_filename (ibfd));
+ ? _("%B: uses _-prefixed symbols, but writing file with non-prefixed symbols")
+ : _("%B: uses non-prefixed symbols, but writing file with _-prefixed symbols"),
+ ibfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
rel->r_addend))
{
(*_bfd_error_handler)
- (_("%s: relocation at `%s+0x%x' references symbol `%s' with nonzero addend"),
- bfd_archive_filename (input_bfd), input_section->name,
- rel->r_offset, name);
+ (_("%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"),
+ input_bfd, input_section, rel->r_offset, name);
return FALSE;
}
default:
bad_reloc:
(*_bfd_error_handler)
- (_("%s: unsupported relocation type %i"),
- bfd_archive_filename (abfd), ELF32_R_TYPE (rel->r_info));
+ (_("%B: unsupported relocation type %i"),
+ abfd, ELF32_R_TYPE (rel->r_info));
return FALSE;
}
}
Elf_Internal_Ehdr *ehdrp;
ehdrp = elf_elfheader (abfd);
- (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"),
- bfd_archive_filename (abfd),
+ (*_bfd_error_handler) (_("%B: Relocations in generic ELF (EM: %d)"),
+ abfd,
ehdrp->e_machine);
bfd_set_error (bfd_error_wrong_format);
TRUE, FALSE);
if (stub_entry == NULL)
{
- (*_bfd_error_handler) (_("%s: cannot create stub entry %s"),
- bfd_archive_filename (section->owner),
+ (*_bfd_error_handler) (_("%B: cannot create stub entry %s"),
+ section->owner,
stub_name);
return NULL;
}
|| sym_value - 8 + (1 << (22 + 1)) >= (1 << (22 + 2))))
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
- bfd_archive_filename (stub_entry->target_section->owner),
- stub_sec->name,
+ (_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
+ stub_entry->target_section->owner,
+ stub_sec,
(long) stub_entry->stub_offset,
stub_entry->root.string);
bfd_set_error (bfd_error_bad_value);
if (info->shared)
{
(*_bfd_error_handler)
- (_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"),
- bfd_archive_filename (abfd),
+ (_("%B: relocation %s can not be used when making a shared object; recompile with -fPIC"),
+ abfd,
elf_hppa_howto_table[r_type].name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
if (info->shared)
{
(*_bfd_error_handler)
- (_("%s: relocation %s should not be used when making a shared object; recompile with -fPIC"),
- bfd_archive_filename (abfd),
+ (_("%B: relocation %s should not be used when making a shared object; recompile with -fPIC"),
+ abfd,
elf_hppa_howto_table[r_type].name);
}
/* Fall through. */
}
else
{
- (*_bfd_error_handler) (_("%s: duplicate export stub %s"),
- bfd_archive_filename (input_bfd),
+ (*_bfd_error_handler) (_("%B: duplicate export stub %s"),
+ input_bfd,
stub_name);
}
}
and convert the associated add instruction, so issue an
error. */
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
- bfd_archive_filename (input_bfd),
- input_section->name,
+ (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
howto->name,
insn);
insn &= ~ (0x1f << 21);
#if 0 /* debug them. */
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): fixing %s"),
- bfd_archive_filename (input_bfd),
- input_section->name,
+ (_("%B(%A+0x%lx): fixing %s"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
howto->name);
#endif
&& value + addend + max_branch_offset >= 2*max_branch_offset)
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
- bfd_archive_filename (input_bfd),
- input_section->name,
+ (_("%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
stub_entry->root.string);
bfd_set_error (bfd_error_bad_value);
if (r == bfd_reloc_notsupported || !warned_undef)
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): cannot handle %s for %s"),
- bfd_archive_filename (input_bfd),
- input_section->name,
+ (_("%B(%A+0x%lx): cannot handle %s for %s"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
howto->name,
sym_name);
else /* Incompatible flags */
{
(*_bfd_error_handler)
- ("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
- bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags);
+ ("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
+ ibfd, (long) new_flags, (long) old_flags);
bfd_set_error (bfd_error_bad_value);
return FALSE;
return TRUE;
#ifdef DEBUG
- fprintf (stderr, "i370_elf_check_relocs called for section %s in %s\n",
- bfd_get_section_name (abfd, sec),
- bfd_archive_filename (abfd));
+ _bfd_error_handler ("i370_elf_check_relocs called for section %A in %B",
+ sec, abfd);
#endif
dynobj = elf_hash_table (info)->dynobj;
return TRUE;
#ifdef DEBUG
- fprintf (stderr, "i370_elf_relocate_section called for %s section %s, %ld relocations%s\n",
- bfd_archive_filename (input_bfd),
- bfd_section_name(input_bfd, input_section),
- (long) input_section->reloc_count,
- (info->relocatable) ? " (relocatable)" : "");
+ _bfd_error_handler ("i370_elf_relocate_section called for %B section %A, %ld relocations%s",
+ input_bfd, input_section,
+ (long) input_section->reloc_count,
+ (info->relocatable) ? " (relocatable)" : "");
#endif
if (!i370_elf_howto_table[ R_I370_ADDR31 ]) /* Initialize howto table if needed */
if ((unsigned)r_type >= (unsigned)R_I370_max
|| !i370_elf_howto_table[(int)r_type])
{
- (*_bfd_error_handler) ("%s: unknown relocation type %d",
- bfd_archive_filename (input_bfd),
+ (*_bfd_error_handler) ("%B: unknown relocation type %d",
+ input_bfd,
(int) r_type);
bfd_set_error (bfd_error_bad_value);
{
default:
(*_bfd_error_handler)
- ("%s: unknown relocation type %d for symbol %s",
- bfd_archive_filename (input_bfd),
- (int) r_type, sym_name);
+ ("%B: unknown relocation type %d for symbol %s",
+ input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
case (int)R_I370_COPY:
case (int)R_I370_RELATIVE:
(*_bfd_error_handler)
- ("%s: Relocation %s is not yet supported for symbol %s.",
- bfd_archive_filename (input_bfd),
+ ("%B: Relocation %s is not yet supported for symbol %s.",
+ input_bfd,
i370_elf_howto_table[(int) r_type]->name,
sym_name);
&& ((indx = r_type - R_386_vt_offset) - R_386_tls
>= R_386_vt - R_386_tls))
{
- (*_bfd_error_handler) (_("%s: invalid relocation type %d"),
- bfd_archive_filename (abfd), (int) r_type);
+ (*_bfd_error_handler) (_("%B: invalid relocation type %d"),
+ abfd, (int) r_type);
indx = R_386_NONE;
}
cache_ptr->howto = &elf_howto_table[indx];
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
- (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
- bfd_archive_filename (abfd),
+ (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
+ abfd,
r_symndx);
return FALSE;
}
else
{
(*_bfd_error_handler)
- (_("%s: `%s' accessed both as normal and "
+ (_("%B: `%s' accessed both as normal and "
"thread local symbol"),
- bfd_archive_filename (abfd),
+ abfd,
h ? h->root.root.string : "<local>");
return FALSE;
}
name + 4) != 0)
{
(*_bfd_error_handler)
- (_("%s: bad relocation section name `%s\'"),
- bfd_archive_filename (abfd), name);
+ (_("%B: bad relocation section name `%s\'"),
+ abfd, name);
}
if (htab->elf.dynobj == NULL)
&& ((indx = r_type - R_386_tls_offset) - R_386_ext
>= R_386_tls - R_386_ext))
{
- char *name = bfd_get_section_ident (input_section);
(*_bfd_error_handler)
- (_("%s: unrecognized relocation (0x%x) in section `%s'"),
- bfd_archive_filename (input_bfd), r_type,
- name ? name : input_section->name);
- if (name)
- free (name);
+ (_("%B: unrecognized relocation (0x%x) in section `%A'"),
+ input_bfd, input_section, r_type);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
h->root.root.string);
return FALSE;
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): reloc against `%s': error %d"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): reloc against `%s': error %d"),
+ input_bfd, input_section,
(long) rel->r_offset, name, (int) r);
return FALSE;
}
r_type = ELF32_R_TYPE (rel->r_info);
if (r_type < 0 || r_type >= (int) R_M32R_max)
{
- (*_bfd_error_handler) (_("%s: unknown relocation type %d"),
- bfd_archive_filename (input_bfd),
+ (*_bfd_error_handler) (_("%B: unknown relocation type %d"),
+ input_bfd,
(int) r_type);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
else
{
(*_bfd_error_handler)
- (_("%s: The target (%s) of an %s relocation is in the wrong section (%s)"),
- bfd_archive_filename (input_bfd),
+ (_("%B: The target (%s) of an %s relocation is in the wrong section (%A)"),
+ input_bfd,
+ sec,
sym_name,
- m32r_elf_howto_table[(int) r_type].name,
- bfd_get_section_name (abfd, sec));
+ m32r_elf_howto_table[(int) r_type].name);
/*bfd_set_error (bfd_error_bad_value); ??? why? */
ret = FALSE;
continue;
|| ((in_flags & EF_M32R_ARCH) == E_M32R2_ARCH))
{
(*_bfd_error_handler)
- (_("%s: Instruction set mismatch with previous modules"),
- bfd_archive_filename (ibfd));
+ (_("%B: Instruction set mismatch with previous modules"), ibfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
TRUE, FALSE);
if (stub_entry == NULL)
{
- (*_bfd_error_handler) (_("%s: cannot create stub entry %s"),
- bfd_archive_filename (section->owner),
- stub_name);
+ (*_bfd_error_handler) (_("%B: cannot create stub entry %s"),
+ section->owner, stub_name);
return NULL;
}
if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32))
{
(*_bfd_error_handler)
- (_("%s: linking files compiled for 16-bit integers (-mshort) "
- "and others for 32-bit integers"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking files compiled for 16-bit integers (-mshort) "
+ "and others for 32-bit integers"), ibfd);
ok = FALSE;
}
if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64))
{
(*_bfd_error_handler)
- (_("%s: linking files compiled for 32-bit double (-fshort-double) "
- "and others for 64-bit double"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking files compiled for 32-bit double (-fshort-double) "
+ "and others for 64-bit double"), ibfd);
ok = FALSE;
}
if (!EF_M68HC11_CAN_MERGE_MACH (new_flags, old_flags))
{
(*_bfd_error_handler)
- (_("%s: linking files compiled for HCS12 with "
- "others compiled for HC12"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking files compiled for HCS12 with "
+ "others compiled for HC12"), ibfd);
ok = FALSE;
}
new_flags = ((new_flags & ~EF_M68HC11_MACH_MASK)
if (new_flags != old_flags)
{
(*_bfd_error_handler)
- (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
- bfd_archive_filename (ibfd), (unsigned long) new_flags,
- (unsigned long) old_flags);
+ (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
+ ibfd, (unsigned long) new_flags, (unsigned long) old_flags);
ok = FALSE;
}
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
h->root.root.string);
return FALSE;
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): reloc against `%s': error %d"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): reloc against `%s': error %d"),
+ input_bfd, input_section,
(long) rel->r_offset, name, (int) r);
return FALSE;
}
{
BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
- _bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"),
- bfd_archive_filename (abfd),
+ _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"),
+ abfd,
reloc_entry->howto->name,
reloc_entry->howto->type);
bfd_boolean ret = TRUE;
#ifdef DEBUG
- fprintf (stderr,
- "mcore_elf_relocate_section called for %s section %s, %ld relocations%s\n",
- bfd_archive_filename (input_bfd),
- bfd_section_name(input_bfd, input_section),
- (long) input_section->reloc_count,
- (info->relocatable) ? " (relocatable)" : "");
+ _bfd_error_handler
+ ("mcore_elf_relocate_section called for %B section %A, %ld relocations%s",
+ input_bfd,
+ input_section,
+ (long) input_section->reloc_count,
+ (info->relocatable) ? " (relocatable)" : "");
#endif
if (info->relocatable)
if ((unsigned) r_type >= (unsigned) R_MCORE_max
|| ! mcore_elf_howto_table [(int)r_type])
{
- _bfd_error_handler (_("%s: Unknown relocation type %d\n"),
- bfd_archive_filename (input_bfd),
- (int) r_type);
+ _bfd_error_handler (_("%B: Unknown relocation type %d\n"),
+ input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
/* Complain about known relocation that are not yet supported. */
if (howto->special_function == mcore_elf_unsupported_reloc)
{
- _bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"),
- bfd_archive_filename (input_bfd),
+ _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"),
+ input_bfd,
howto->name,
(int)r_type);
{
error = TRUE;
(*_bfd_error_handler)
- (_("%s: compiled with -mrelocatable and linked with "
- "modules compiled normally"),
- bfd_archive_filename (ibfd));
+ (_("%B: compiled with -mrelocatable and linked with "
+ "modules compiled normally"), ibfd);
}
else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0
&& (old_flags & EF_PPC_RELOCATABLE) != 0)
{
error = TRUE;
(*_bfd_error_handler)
- (_("%s: compiled normally and linked with "
- "modules compiled with -mrelocatable"),
- bfd_archive_filename (ibfd));
+ (_("%B: compiled normally and linked with "
+ "modules compiled with -mrelocatable"), ibfd);
}
/* The output is -mrelocatable-lib iff both the input files are. */
{
error = TRUE;
(*_bfd_error_handler)
- (_("%s: uses different e_flags (0x%lx) fields "
+ (_("%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);
}
if (error)
bad_shared_reloc (bfd *abfd, enum elf_ppc_reloc_type r_type)
{
(*_bfd_error_handler)
- (_("%s: relocation %s cannot be used when making a shared object"),
- bfd_archive_filename (abfd),
+ (_("%B: relocation %s cannot be used when making a shared object"),
+ abfd,
ppc_elf_howto_table[r_type]->name);
bfd_set_error (bfd_error_bad_value);
}
return TRUE;
#ifdef DEBUG
- fprintf (stderr, "ppc_elf_check_relocs called for section %s in %s\n",
- bfd_get_section_name (abfd, sec),
- bfd_archive_filename (abfd));
+ _bfd_error_handler ("ppc_elf_check_relocs called for section %A in %B",
+ sec, abfd);
#endif
/* Initialize howto table if not already done. */
{
/* It does not make sense to have a procedure linkage
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"),
- bfd_archive_filename (abfd),
- sec->name,
+ abfd,
+ sec,
(long) rel->r_offset,
ppc_elf_howto_table[r_type]->name);
bfd_set_error (bfd_error_bad_value);
bfd_boolean ret = TRUE;
#ifdef DEBUG
- fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, "
- "%ld relocations%s\n",
- bfd_archive_filename (input_bfd),
- bfd_section_name(input_bfd, input_section),
- (long) input_section->reloc_count,
- (info->relocatable) ? " (relocatable)" : "");
+ _bfd_error_handler ("ppc_elf_relocate_section called for %B section %A, "
+ "%ld relocations%s",
+ input_bfd, input_section,
+ (long) input_section->reloc_count,
+ (info->relocatable) ? " (relocatable)" : "");
#endif
if (info->relocatable)
{
default:
(*_bfd_error_handler)
- (_("%s: unknown relocation type %d for symbol %s"),
- bfd_archive_filename (input_bfd), (int) r_type, sym_name);
+ (_("%B: unknown relocation type %d for symbol %s"),
+ input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
got at entry m+n bears little relation to the entry m. */
if (addend != 0)
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): non-zero addend on %s reloc against `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): non-zero addend on %s reloc against `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
howto->name,
sym_name);
&& (name[5] == 0 || name[5] == '.'))))
{
(*_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)"),
- bfd_archive_filename (input_bfd),
+ input_bfd,
sym_name,
howto->name,
name);
|| strncmp (name, ".sbss2", 6) == 0))
{
(*_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)"),
- bfd_archive_filename (input_bfd),
+ input_bfd,
sym_name,
howto->name,
name);
else
{
(*_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)"),
- bfd_archive_filename (input_bfd),
+ input_bfd,
sym_name,
howto->name,
name);
case R_PPC_EMB_RELST_HA:
case R_PPC_EMB_BIT_FLD:
(*_bfd_error_handler)
- (_("%s: relocation %s is not yet supported for symbol %s."),
- bfd_archive_filename (input_bfd),
+ (_("%B: relocation %s is not yet supported for symbol %s."),
+ input_bfd,
howto->name,
sym_name);
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
howto->name,
sym_name);
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): %s reloc against `%s': error %d"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): %s reloc against `%s': error %d"),
+ input_bfd, input_section,
(long) rel->r_offset, howto->name, sym_name, (int) r);
ret = FALSE;
}
length = asec->size;
if (length < 24)
{
- error_message = _("corrupt or empty %s section in %s");
+ error_message = _("corrupt or empty %s section in %B");
goto fail;
}
if (bfd_seek (ibfd, asec->filepos, SEEK_SET) != 0
|| (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;
}
/* Process the contents of the section. */
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
extract the values this way in order to allow for a
if (! bfd_set_section_size (abfd, asec, output_section_size))
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:
free (buffer);
if (error_message)
- (*_bfd_error_handler) (error_message, APUINFO_SECTION_NAME,
- bfd_archive_filename (ibfd));
+ (*_bfd_error_handler) (error_message, ibfd, APUINFO_SECTION_NAME);
}
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
- (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
- bfd_archive_filename (abfd),
- r_symndx);
+ (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
+ abfd, r_symndx);
return FALSE;
}
if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL)
{
(*_bfd_error_handler)
- (_("%s: `%s' accessed both as normal and thread local symbol"),
- bfd_archive_filename (abfd), h->root.root.string);
+ (_("%B: `%s' accessed both as normal and thread local symbol"),
+ abfd, h->root.root.string);
return FALSE;
}
if (old_tls_type > tls_type)
name + 5) != 0)
{
(*_bfd_error_handler)
- (_("%s: bad relocation section name `%s\'"),
- bfd_archive_filename (abfd), name);
+ (_("%B: bad relocation section name `%s\'"),
+ abfd, name);
}
if (htab->elf.dynobj == NULL)
howto = elf_howto_table + ELF32_R_TYPE (rel->r_info);
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): invalid instruction for TLS relocation %s"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): invalid instruction for TLS relocation %s"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
howto->name);
}
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
h->root.root.string);
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): reloc against `%s': error %d"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): reloc against `%s': error %d"),
+ input_bfd, input_section,
(long) rel->r_offset, name, (int) r);
return FALSE;
}
return TRUE;
bfd_set_error (bfd_error_invalid_operation);
- _bfd_error_handler (_("%s: IMPORT AS directive for %s conceals previous IMPORT AS"),
- bfd_archive_filename (abfd), current_name);
+ _bfd_error_handler (_("%B: IMPORT AS directive for %s conceals previous IMPORT AS"),
+ abfd, current_name);
return FALSE;
}
fprintf (stderr, "offset into .directive section: %d\n", directive - contents);
bfd_set_error (bfd_error_invalid_operation);
- _bfd_error_handler (_("%s: Unrecognised .directive command: %s"),
- bfd_archive_filename (abfd), directive);
+ _bfd_error_handler (_("%B: Unrecognised .directive command: %s"),
+ abfd, directive);
break;
}
}
& new_value, & new_hash, & skip, & override, & type_change_ok,
& size_change_ok))
{
- _bfd_error_handler (_("%s: Failed to add renamed symbol %s"),
- bfd_archive_filename (input_bfd), ptr->new_name);
+ _bfd_error_handler (_("%B: Failed to add renamed symbol %s"),
+ input_bfd, ptr->new_name);
continue;
}
/* XXX - should we check psec, skip, override etc ? */
laddr = irel->r_offset + 4 + irel->r_addend;
if (laddr >= sec->size)
{
- (*_bfd_error_handler) (_("%s: 0x%lx: warning: bad R_SH_USES offset"),
- bfd_archive_filename (abfd),
+ (*_bfd_error_handler) (_("%B: 0x%lx: warning: bad R_SH_USES offset"),
+ abfd,
(unsigned long) irel->r_offset);
continue;
}
if ((insn & 0xf000) != 0xd000)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"),
- bfd_archive_filename (abfd), (unsigned long) irel->r_offset, insn));
+ (_("%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"),
+ abfd, (unsigned long) irel->r_offset, insn));
continue;
}
if (paddr >= sec->size)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: warning: bad R_SH_USES load offset"),
- bfd_archive_filename (abfd), (unsigned long) irel->r_offset));
+ (_("%B: 0x%lx: warning: bad R_SH_USES load offset"),
+ abfd, (unsigned long) irel->r_offset));
continue;
}
if (irelfn >= irelend)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: warning: could not find expected reloc"),
- bfd_archive_filename (abfd), (unsigned long) paddr));
+ (_("%B: 0x%lx: warning: could not find expected reloc"),
+ abfd, (unsigned long) paddr));
continue;
}
!= (unsigned int) _bfd_elf_section_from_bfd_section (abfd, sec))
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: warning: symbol in unexpected section"),
- bfd_archive_filename (abfd), (unsigned long) paddr));
+ (_("%B: 0x%lx: warning: symbol in unexpected section"),
+ abfd, (unsigned long) paddr));
continue;
}
if (irelcount >= irelend)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: warning: could not find expected COUNT reloc"),
- bfd_archive_filename (abfd), (unsigned long) paddr));
+ (_("%B: 0x%lx: warning: could not find expected COUNT reloc"),
+ abfd, (unsigned long) paddr));
continue;
}
just deleted one. */
if (irelcount->r_addend == 0)
{
- ((*_bfd_error_handler) (_("%s: 0x%lx: warning: bad count"),
- bfd_archive_filename (abfd),
+ ((*_bfd_error_handler) (_("%B: 0x%lx: warning: bad count"),
+ abfd,
(unsigned long) paddr));
continue;
}
if (overflow)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: fatal: reloc overflow while relaxing"),
- bfd_archive_filename (abfd), (unsigned long) irel->r_offset));
+ (_("%B: 0x%lx: fatal: reloc overflow while relaxing"),
+ abfd, (unsigned long) irel->r_offset));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (overflow)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: fatal: reloc overflow while relaxing"),
- bfd_archive_filename (abfd), (unsigned long) irel->r_offset));
+ (_("%B: 0x%lx: fatal: reloc overflow while relaxing"),
+ abfd, (unsigned long) irel->r_offset));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (howto->rightshift || howto->src_mask != 0xffffffff)
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): %s relocation against SEC_MERGE section"),
+ input_bfd, input_section,
(long) rel->r_offset, howto->name);
return FALSE;
}
else if (sec->output_section == NULL)
{
(*_bfd_error_handler)
- (_("%s: unresolvable relocation against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd), h->root.root.string,
- bfd_get_section_name (input_bfd, input_section));
+ (_("%B(%A): unresolvable relocation against symbol `%s'"),
+ input_bfd, input_section, h->root.root.string);
return FALSE;
}
else
if (disp & mask)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: fatal: unaligned branch target for relax-support relocation"),
- bfd_archive_filename (input_section->owner),
+ (_("%B: 0x%lx: fatal: unaligned branch target for relax-support relocation"),
+ input_section->owner,
(unsigned long) rel->r_offset));
bfd_set_error (bfd_error_bad_value);
return FALSE;
if (relocation & 3)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: fatal: unaligned %s relocation 0x%lx"),
- bfd_archive_filename (input_section->owner),
+ (_("%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"),
+ input_section->owner,
(unsigned long) rel->r_offset, howto->name,
- (unsigned long)relocation));
+ (unsigned long) relocation));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (relocation & 1)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: fatal: unaligned %s relocation 0x%lx"),
- bfd_archive_filename (input_section->owner),
+ (_("%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"),
+ input_section->owner,
(unsigned long) rel->r_offset, howto->name,
- (unsigned long)relocation));
+ (unsigned long) relocation));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
|| (signed int)relocation > 32)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"),
- bfd_archive_filename (input_section->owner),
+ (_("%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"),
+ input_section->owner,
(unsigned long) rel->r_offset,
- (unsigned long)relocation));
+ (unsigned long) relocation));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
|| (signed int)relocation > 16)
{
((*_bfd_error_handler)
- (_("%s: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"),
- bfd_archive_filename (input_section->owner),
+ (_("%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"),
+ input_section->owner,
(unsigned long) rel->r_offset,
- (unsigned long)relocation));
+ (unsigned long) relocation));
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
else
{
(*_bfd_error_handler)
- (_("%s: `%s' accessed both as normal and thread local symbol"),
- bfd_archive_filename (abfd), h->root.root.string);
+ (_("%B: `%s' accessed both as normal and thread local symbol"),
+ abfd, h->root.root.string);
return FALSE;
}
}
case R_SH_TLS_LE_32:
if (info->shared)
{
- (*_bfd_error_handler) (_("%s: TLS local exec code cannot be linked into shared objects"),
- bfd_archive_filename (abfd));
+ (*_bfd_error_handler)
+ (_("%B: TLS local exec code cannot be linked into shared objects"),
+ abfd);
return FALSE;
}
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",
- bfd_archive_filename (ibfd));
+ ibfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
- (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
- bfd_archive_filename (abfd),
- r_symndx);
+ (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
+ abfd, r_symndx);
return FALSE;
}
else
{
(*_bfd_error_handler)
- (_("%s: `%s' accessed both as normal and thread local symbol"),
- bfd_archive_filename (abfd),
- h ? h->root.root.string : "<local>");
+ (_("%B: `%s' accessed both as normal and thread local symbol"),
+ abfd, h ? h->root.root.string : "<local>");
return FALSE;
}
}
{
BFD_FAIL ();
(*_bfd_error_handler)
- (_("%s: probably compiled without -fPIC?"),
- bfd_archive_filename (input_bfd));
+ (_("%B: probably compiled without -fPIC?"),
+ input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
h->root.root.string);
{
error = TRUE;
(*_bfd_error_handler)
- (_("%s: compiled for a 64 bit system and target is 32 bit"),
- bfd_archive_filename (ibfd));
+ (_("%B: compiled for a 64 bit system and target is 32 bit"), ibfd);
}
else if ((ibfd->flags & DYNAMIC) == 0)
{
&& previous_ibfd_e_flags != (unsigned long) -1)
{
(*_bfd_error_handler)
- (_("%s: linking little endian files with big endian files"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking little endian files with big endian files"), ibfd);
error = TRUE;
}
previous_ibfd_e_flags = elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA;
return TRUE;
#ifdef DEBUG
- fprintf (stderr, "v850_elf_check_relocs called for section %s in %s\n",
- bfd_get_section_name (abfd, sec),
- bfd_archive_filename (abfd));
+ _bfd_error_handler ("v850_elf_check_relocs called for section %A in %B",
+ sec, abfd);
#endif
dynobj = elf_hash_table (info)->dynobj;
return TRUE;
}
- _bfd_error_handler (_("%s: Architecture mismatch with previous modules"),
- bfd_archive_filename (ibfd));
+ _bfd_error_handler (_("%B: Architecture mismatch with previous modules"),
+ ibfd);
}
return TRUE;
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
- (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
- bfd_archive_filename (abfd),
- r_symndx);
+ (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
+ abfd, r_symndx);
return FALSE;
}
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
h->root.root.string);
if (out_mach != in_mach)
{
(*_bfd_error_handler)
- ("%s: incompatible machine type. Output is 0x%x. Input is 0x%x",
- bfd_archive_filename (ibfd), out_mach, in_mach);
+ ("%B: incompatible machine type. Output is 0x%x. Input is 0x%x",
+ ibfd, out_mach, in_mach);
bfd_set_error (bfd_error_wrong_format);
return FALSE;
}
if (lit_insn >> 26 != OP_LDQ)
{
((*_bfd_error_handler)
- ("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn",
- bfd_archive_filename (info->abfd), info->sec->name,
+ ("%B: %A+0x%lx: warning: LITERAL relocation against unexpected insn",
+ info->abfd, info->sec,
(unsigned long) irel->r_offset));
return TRUE;
}
{
reloc_howto_type *howto = elf64_alpha_howto_table + r_type;
((*_bfd_error_handler)
- ("%s: %s+0x%lx: warning: %s relocation against unexpected insn",
- bfd_archive_filename (info->abfd), info->sec->name,
+ ("%B: %A+0x%lx: warning: %s relocation against unexpected insn",
+ info->abfd, info->sec,
(unsigned long) irel->r_offset, howto->name));
return TRUE;
}
{
/* Yikes! A single object file has too many entries. */
(*_bfd_error_handler)
- (_("%s: .got subsegment exceeds 64K (size %d)"),
- bfd_archive_filename (i),
- alpha_elf_tdata (this_got)->total_got_size);
+ (_("%B: .got subsegment exceeds 64K (size %d)"),
+ i, alpha_elf_tdata (this_got)->total_got_size);
return FALSE;
}
if (r_type >= R_ALPHA_max)
{
(*_bfd_error_handler)
- (_("%s: unknown relocation type %d"),
- bfd_archive_filename (input_bfd), (int)r_type);
+ (_("%B: unknown relocation type %d"),
+ input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value);
ret_val = FALSE;
continue;
if (r_type >= R_ALPHA_max)
{
(*_bfd_error_handler)
- (_("%s: unknown relocation type %d"),
- bfd_archive_filename (input_bfd), (int)r_type);
+ (_("%B: unknown relocation type %d"),
+ input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value);
ret_val = FALSE;
continue;
if (dynamic_symbol_p)
{
(*_bfd_error_handler)
- (_("%s: gp-relative relocation against dynamic symbol %s"),
- bfd_archive_filename (input_bfd), h->root.root.root.string);
+ (_("%B: gp-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
ret_val = FALSE;
}
BFD_ASSERT(gp != 0);
if (dynamic_symbol_p)
{
(*_bfd_error_handler)
- (_("%s: gp-relative relocation against dynamic symbol %s"),
- bfd_archive_filename (input_bfd), h->root.root.root.string);
+ (_("%B: gp-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
ret_val = FALSE;
}
BFD_ASSERT(gp != 0);
if (dynamic_symbol_p)
{
(*_bfd_error_handler)
- (_("%s: pc-relative relocation against dynamic symbol %s"),
- bfd_archive_filename (input_bfd), h->root.root.root.string);
+ (_("%B: pc-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
ret_val = FALSE;
}
/* The regular PC-relative stuff measures from the start of
&& gotobj != alpha_elf_tdata (sec->owner)->gotobj)
{
(*_bfd_error_handler)
- (_("%s: change in gp: BRSGP %s"),
- bfd_archive_filename (input_bfd), h->root.root.root.string);
+ (_("%B: change in gp: BRSGP %s"),
+ input_bfd, h->root.root.root.string);
ret_val = FALSE;
}
name = bfd_section_name (input_bfd, sec);
}
(*_bfd_error_handler)
- (_("%s: !samegp reloc against symbol without .prologue: %s"),
- bfd_archive_filename (input_bfd), name);
+ (_("%B: !samegp reloc against symbol without .prologue: %s"),
+ input_bfd, name);
ret_val = FALSE;
break;
}
if (r_type == R_ALPHA_REFLONG)
{
(*_bfd_error_handler)
- (_("%s: unhandled dynamic relocation against %s"),
- bfd_archive_filename (input_bfd),
+ (_("%B: unhandled dynamic relocation against %s"),
+ input_bfd,
h->root.root.root.string);
ret_val = FALSE;
}
if (dynamic_symbol_p)
{
(*_bfd_error_handler)
- (_("%s: pc-relative relocation against dynamic symbol %s"),
- bfd_archive_filename (input_bfd), h->root.root.root.string);
+ (_("%B: pc-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
ret_val = FALSE;
}
if (dynamic_symbol_p)
{
(*_bfd_error_handler)
- (_("%s: dtp-relative relocation against dynamic symbol %s"),
- bfd_archive_filename (input_bfd), h->root.root.root.string);
+ (_("%B: dtp-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
ret_val = FALSE;
}
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
if (info->shared)
{
(*_bfd_error_handler)
- (_("%s: TLS local exec code cannot be linked into shared objects"),
- bfd_archive_filename (input_bfd));
+ (_("%B: TLS local exec code cannot be linked into shared objects"),
+ input_bfd);
ret_val = FALSE;
}
else if (dynamic_symbol_p)
{
(*_bfd_error_handler)
- (_("%s: tp-relative relocation against dynamic symbol %s"),
- bfd_archive_filename (input_bfd), h->root.root.root.string);
+ (_("%B: tp-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
ret_val = FALSE;
}
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
Elf_Internal_Ehdr *ehdrp;
ehdrp = elf_elfheader (abfd);
- (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"),
- bfd_archive_filename (abfd),
- ehdrp->e_machine);
+ (*_bfd_error_handler) (_("%B: Relocations in generic ELF (EM: %d)"),
+ abfd, ehdrp->e_machine);
bfd_set_error (bfd_error_wrong_format);
return FALSE;
const char *msg;
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");
else
- msg = _("%s: compiled for a little endian system "
+ 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);
return FALSE;
TRUE, FALSE);
if (stub_entry == NULL)
{
- (*_bfd_error_handler) (_("%s: cannot create stub entry %s"),
- bfd_archive_filename (section->owner),
- stub_name);
+ (*_bfd_error_handler) (_("%B: cannot create stub entry %s"),
+ section->owner, stub_name);
return NULL;
}
name + 5) != 0)
{
(*_bfd_error_handler)
- (_("%s: bad relocation section name `%s\'"),
- bfd_archive_filename (abfd), name);
+ (_("%B: bad relocation section name `%s\'"),
+ abfd, name);
bfd_set_error (bfd_error_bad_value);
}
something silly in .opd with the assembler. No .opd
optimization for them! */
(*_bfd_error_handler)
- (_("%s: .opd is not a regular array of opd entries"),
- bfd_archive_filename (ibfd));
+ (_("%B: .opd is not a regular array of opd entries"), ibfd);
need_edit = FALSE;
break;
}
|| (r_type = ELF64_R_TYPE ((rel + 1)->r_info)) != R_PPC64_TOC)
{
(*_bfd_error_handler)
- (_("%s: unexpected reloc type %u in .opd section"),
- bfd_archive_filename (ibfd), r_type);
+ (_("%B: unexpected reloc type %u in .opd section"),
+ ibfd, r_type);
need_edit = FALSE;
break;
}
sym_name = bfd_elf_local_sym_name (ibfd, sym);
(*_bfd_error_handler)
- (_("%s: undefined sym `%s' in .opd section"),
- bfd_archive_filename (ibfd),
- sym_name);
+ (_("%B: undefined sym `%s' in .opd section"),
+ ibfd, sym_name);
need_edit = FALSE;
break;
}
else
(*_bfd_error_handler)
(sym_type == STT_TLS
- ? _("%s(%s+0x%lx): %s used with TLS symbol %s")
- : _("%s(%s+0x%lx): %s used with non-TLS symbol %s"),
- bfd_archive_filename (input_bfd),
- input_section->name,
+ ? _("%B(%A+0x%lx): %s used with TLS symbol %s")
+ : _("%B(%A+0x%lx): %s used with non-TLS symbol %s"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
ppc64_elf_howto_table[r_type]->name,
sym_name);
|| strcmp (input_section->output_section->name,
".fini") == 0)
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): automatic multiple TOCs "
+ (_("%B(%A+0x%lx): automatic multiple TOCs "
"not supported using your crt files; "
"recompile with -mminimal-toc or upgrade gcc"),
- bfd_archive_filename (input_bfd),
- input_section->name,
+ input_bfd,
+ input_section,
(long) rel->r_offset);
else
(*_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; "
"recompile with -mminimal-toc or "
"-fno-optimize-sibling-calls, "
"or make `%s' extern"),
- bfd_archive_filename (input_bfd),
- input_section->name,
+ input_bfd,
+ input_section,
(long) rel->r_offset,
sym_name,
sym_name);
{
default:
(*_bfd_error_handler)
- (_("%s: unknown relocation type %d for symbol %s"),
- bfd_archive_filename (input_bfd), (int) r_type, sym_name);
+ (_("%B: unknown relocation type %d for symbol %s"),
+ input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
/* These ones haven't been implemented yet. */
(*_bfd_error_handler)
- (_("%s: relocation %s is not supported for symbol %s."),
- bfd_archive_filename (input_bfd),
+ (_("%B: relocation %s is not supported for symbol %s."),
+ input_bfd,
ppc64_elf_howto_table[r_type]->name, sym_name);
bfd_set_error (bfd_error_invalid_operation);
if (((relocation + addend) & mask) != 0)
{
(*_bfd_error_handler)
- (_("%s: error: relocation %s not a multiple of %d"),
- bfd_archive_filename (input_bfd),
+ (_("%B: error: relocation %s not a multiple of %d"),
+ input_bfd,
ppc64_elf_howto_table[r_type]->name,
mask + 1);
bfd_set_error (bfd_error_bad_value);
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
ppc64_elf_howto_table[(int) r_type]->name,
h->root.root.string);
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): %s reloc against `%s': error %d"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): %s reloc against `%s': error %d"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
ppc64_elf_howto_table[r_type]->name,
sym_name,
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
- (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
- bfd_archive_filename (abfd),
+ (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
+ abfd,
r_symndx);
return FALSE;
}
if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL)
{
(*_bfd_error_handler)
- (_("%s: `%s' accessed both as normal and thread local symbol"),
- bfd_archive_filename (abfd), h->root.root.string);
+ (_("%B: `%s' accessed both as normal and thread local symbol"),
+ abfd, h->root.root.string);
return FALSE;
}
if (old_tls_type > tls_type)
name + 5) != 0)
{
(*_bfd_error_handler)
- (_("%s: bad relocation section name `%s\'"),
- bfd_archive_filename (abfd), name);
+ (_("%B: bad relocation section name `%s\'"),
+ abfd, name);
}
if (htab->elf.dynobj == NULL)
howto = elf_howto_table + ELF64_R_TYPE (rel->r_info);
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): invalid instruction for TLS relocation %s"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): invalid instruction for TLS relocation %s"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
howto->name);
}
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
h->root.root.string);
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): reloc against `%s': error %d"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): reloc against `%s': error %d"),
+ input_bfd, input_section,
(long) rel->r_offset, name, (int) r);
return FALSE;
}
if (howto->rightshift || howto->src_mask != 0xffffffff)
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): %s relocation against SEC_MERGE section"),
+ input_bfd, input_section,
(long) rel->r_offset, howto->name);
return FALSE;
}
break;
default:
- (*_bfd_error_handler) (_("%s: check_relocs: unhandled reloc type %d"),
- bfd_archive_filename (abfd),
- ELF64_R_TYPE_ID (rel->r_info));
+ (*_bfd_error_handler) (_("%B: check_relocs: unhandled reloc type %d"),
+ abfd, ELF64_R_TYPE_ID (rel->r_info));
return FALSE;
}
}
case 6: reg -= 4; break;
default:
(*_bfd_error_handler)
- (_("%s: Only registers %%g[2367] can be declared using STT_REGISTER"),
- bfd_archive_filename (abfd));
+ (_("%B: Only registers %%g[2367] can be declared using STT_REGISTER"),
+ abfd);
return FALSE;
}
if (p->name != NULL && strcmp (p->name, *namep))
{
(*_bfd_error_handler)
- (_("Register %%g%d used incompatibly: %s in %s, previously %s in %s"),
- (int) sym->st_value,
- **namep ? *namep : "#scratch", bfd_archive_filename (abfd),
- *p->name ? p->name : "#scratch", bfd_archive_filename (p->abfd));
+ (_("Register %%g%d used incompatibly: %s in %B, previously %s in %B"),
+ abfd, p->abfd, (int) sym->st_value,
+ **namep ? *namep : "#scratch",
+ *p->name ? p->name : "#scratch");
return FALSE;
}
if (type > STT_FUNC)
type = 0;
(*_bfd_error_handler)
- (_("Symbol `%s' has differing types: REGISTER in %s, previously %s in %s"),
- *namep, bfd_archive_filename (abfd),
- stt_types[type], bfd_archive_filename (p->abfd));
+ (_("Symbol `%s' has differing types: REGISTER in %B, previously %s in %B"),
+ abfd, p->abfd, *namep, stt_types[type]);
return FALSE;
}
if (type > STT_FUNC)
type = 0;
(*_bfd_error_handler)
- (_("Symbol `%s' has differing types: %s in %s, previously REGISTER in %s"),
- *namep, stt_types[type], bfd_archive_filename (abfd),
- bfd_archive_filename (p->abfd));
+ (_("Symbol `%s' has differing types: %s in %B, previously REGISTER in %B"),
+ abfd, p->abfd, *namep, stt_types[type]);
return FALSE;
}
}
{
BFD_FAIL ();
(*_bfd_error_handler)
- (_("%s: probably compiled without -fPIC?"),
- bfd_archive_filename (input_bfd));
+ (_("%B: probably compiled without -fPIC?"),
+ input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+ input_bfd, input_section,
(long) rel->r_offset,
h->root.root.string);
{
error = TRUE;
(*_bfd_error_handler)
- (_("%s: linking UltraSPARC specific with HAL specific code"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking UltraSPARC specific with HAL specific code"),
+ ibfd);
}
/* Choose the most restrictive memory ordering. */
old_mm = (old_flags & EF_SPARCV9_MM);
{
error = TRUE;
(*_bfd_error_handler)
- (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
- bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags);
+ (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
+ ibfd, (long) new_flags, (long) old_flags);
}
elf_elfheader (obfd)->e_flags = old_flags;
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
- (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
- bfd_archive_filename (abfd),
- r_symndx);
+ (*_bfd_error_handler) (_("%B: bad symbol index: %d"),
+ abfd, r_symndx);
return FALSE;
}
if (info->shared)
{
(*_bfd_error_handler)
- (_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
- bfd_archive_filename (abfd),
+ (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
+ abfd,
x86_64_elf_howto_table[r_type].name,
(h) ? h->root.root.string : "a local symbol");
bfd_set_error (bfd_error_bad_value);
else
{
(*_bfd_error_handler)
- (_("%s: %s' accessed both as normal and thread local symbol"),
- bfd_archive_filename (abfd),
- h ? h->root.root.string : "<local>");
+ (_("%B: %s' accessed both as normal and thread local symbol"),
+ abfd, h ? h->root.root.string : "<local>");
return FALSE;
}
}
&& (sec->flags & SEC_READONLY) != 0)
{
(*_bfd_error_handler)
- (_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
- bfd_archive_filename (abfd),
+ (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
+ abfd,
x86_64_elf_howto_table[r_type].name,
(h) ? h->root.root.string : "a local symbol");
bfd_set_error (bfd_error_bad_value);
name + 5) != 0)
{
(*_bfd_error_handler)
- (_("%s: bad relocation section name `%s\'"),
- bfd_archive_filename (abfd), name);
+ (_("%B: bad relocation section name `%s\'"),
+ abfd, name);
}
if (htab->elf.dynobj == NULL)
&& (input_section->flags & SEC_READONLY) != 0)
{
(*_bfd_error_handler)
- (_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
- bfd_archive_filename (input_bfd),
+ (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
+ input_bfd,
x86_64_elf_howto_table[r_type].name,
(h) ? h->root.root.string : "a local symbol");
bfd_set_error (bfd_error_bad_value);
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
(long) rel->r_offset,
h->root.root.string);
else
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): reloc against `%s': error %d"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (input_bfd, input_section),
+ (_("%B(%A+0x%lx): reloc against `%s': error %d"),
+ input_bfd, input_section,
(long) rel->r_offset, name, (int) r);
return FALSE;
}
if (hi->root.type != bfd_link_hash_defined
&& hi->root.type != bfd_link_hash_defweak)
(*_bfd_error_handler)
- (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"),
- bfd_archive_filename (abfd), shortname);
+ (_("%B: unexpected redefinition of indirect versioned symbol `%s'"),
+ abfd, shortname);
}
else
{
/* We could not find the version for a symbol when
generating a shared archive. Return an error. */
(*_bfd_error_handler)
- (_("%s: undefined versioned symbol name %s"),
- bfd_get_filename (sinfo->output_bfd), h->root.root.string);
+ (_("%B: undefined versioned symbol name %s"),
+ sinfo->output_bfd, h->root.root.string);
bfd_set_error (bfd_error_bad_value);
sinfo->failed = TRUE;
return FALSE;
r_symndx >>= 24;
if ((size_t) r_symndx >= nsyms)
{
- char *sec_name = bfd_get_section_ident (sec);
(*_bfd_error_handler)
- (_("%s: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%s'"),
- bfd_archive_filename (abfd), (unsigned long) r_symndx,
- (unsigned long) nsyms, irela->r_offset,
- sec_name ? sec_name : sec->name);
- if (sec_name)
- free (sec_name);
+ (_("%B: bad reloc symbol index (0x%lx >= 0x%lx)"
+ " for offset 0x%lx in section `%A'"),
+ abfd, sec,
+ (unsigned long) r_symndx, (unsigned long) nsyms, irela->r_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
}
else
{
- char *sec_name = bfd_get_section_ident (input_section);
(*_bfd_error_handler)
- (_("%s: relocation size mismatch in %s section %s"),
- bfd_get_filename (output_bfd),
- bfd_archive_filename (input_section->owner),
- sec_name ? sec_name : input_section->name);
- if (sec_name)
- free (sec_name);
+ (_("%B: relocation size mismatch in %B section %A"),
+ output_bfd, input_section->owner, input_section);
bfd_set_error (bfd_error_wrong_object_format);
return FALSE;
}
if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
{
(*_bfd_error_handler)
- (_("%s: %s: invalid version %u (max %d)"),
- bfd_archive_filename (abfd), name, vernum,
+ (_("%B: %s: invalid version %u (max %d)"),
+ abfd, name, vernum,
elf_tdata (abfd)->dynverdef_hdr.sh_info);
bfd_set_error (bfd_error_bad_value);
goto error_free_vers;
if (verstr == NULL)
{
(*_bfd_error_handler)
- (_("%s: %s: invalid needed version %d"),
- bfd_archive_filename (abfd), name, vernum);
+ (_("%B: %s: invalid needed version %d"),
+ abfd, name, vernum);
bfd_set_error (bfd_error_bad_value);
goto error_free_vers;
}
if (normal_align < common_align)
(*_bfd_error_handler)
- (_("Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s"),
- 1 << normal_align,
- name,
- bfd_archive_filename (normal_bfd),
- 1 << common_align,
- bfd_archive_filename (common_bfd));
+ (_("Warning: alignment %u of symbol `%s' in %B"
+ " is smaller than %u in %B"),
+ normal_bfd, common_bfd,
+ 1 << normal_align, name, 1 << common_align);
}
/* Remember the symbol size and type. */
{
if (h->size != 0 && h->size != isym->st_size && ! size_change_ok)
(*_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,
- bfd_archive_filename (old_bfd),
- (unsigned long) isym->st_size,
- bfd_archive_filename (abfd));
+ (unsigned long) isym->st_size);
h->size = isym->st_size;
}
&& h->type != ELF_ST_TYPE (isym->st_info)
&& ! type_change_ok)
(*_bfd_error_handler)
- (_("Warning: type of symbol `%s' changed from %d to %d in %s"),
- name, h->type, ELF_ST_TYPE (isym->st_info),
- bfd_archive_filename (abfd));
+ (_("Warning: type of symbol `%s' changed"
+ " from %d to %d in %B"),
+ abfd, name, h->type, ELF_ST_TYPE (isym->st_info));
h->type = ELF_ST_TYPE (isym->st_info);
}
{
(*_bfd_error_handler)
(_("%s: invalid DSO for symbol `%s' definition"),
- bfd_archive_filename (abfd), name);
+ abfd, name);
bfd_set_error (bfd_error_bad_value);
goto error_free_vers;
}
== SHT_PREINIT_ARRAY)
{
(*_bfd_error_handler)
- (_("%s: .preinit_array section is not allowed in DSO"),
- bfd_archive_filename (sub));
+ (_("%B: .preinit_array section is not allowed in DSO"),
+ sub);
break;
}
&& ! elf_link_check_versioned_symbol (finfo->info, bed, h))
{
(*_bfd_error_handler)
- (_("%s: %s symbol `%s' in %s is referenced by DSO"),
- bfd_get_filename (finfo->output_bfd),
+ (_("%B: %s symbol `%s' in %B is referenced by DSO"),
+ finfo->output_bfd, h->root.u.def.section->owner,
ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
? "internal"
: ELF_ST_VISIBILITY (h->other) == STV_HIDDEN
- ? "hidden" : "local",
- h->root.root.string,
- bfd_archive_filename (h->root.u.def.section->owner));
+ ? "hidden" : "local",
+ h->root.root.string);
eoinfo->failed = TRUE;
return FALSE;
}
input_sec->output_section);
if (sym.st_shndx == SHN_BAD)
{
- char *sec_name = bfd_get_section_ident (input_sec);
(*_bfd_error_handler)
- (_("%s: could not find output section %s for input section %s"),
- bfd_get_filename (finfo->output_bfd),
- input_sec->output_section->name,
- sec_name ? sec_name : input_sec->name);
- if (sec_name)
- free (sec_name);
+ (_("%B: could not find output section %A for input section %A"),
+ finfo->output_bfd, input_sec->output_section, input_sec);
eoinfo->failed = TRUE;
return FALSE;
}
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{
(*_bfd_error_handler)
- (_("%s: %s symbol `%s' isn't defined"),
- bfd_get_filename (finfo->output_bfd),
- ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED
- ? "protected"
- : ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL
- ? "internal" : "hidden",
- h->root.root.string);
+ (_("%B: %s symbol `%s' isn't defined"),
+ finfo->output_bfd,
+ ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED
+ ? "protected"
+ : ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL
+ ? "internal" : "hidden",
+ h->root.root.string);
eoinfo->failed = TRUE;
return FALSE;
}
}
else if (complain)
{
- char *r_sec = bfd_get_section_ident (o);
- char *d_sec = bfd_get_section_ident (sec);
-
- finfo->info->callbacks->error_handler
- (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);
+ (*_bfd_error_handler)
+ (_("`%s' referenced in section `%A' of %B: "
+ "defined in discarded section `%A' of %B\n"),
+ o, input_bfd, sec, sec->owner, sym_name);
}
/* Remove the symbol reference from the reloc, but
const struct elf_backend_data *bed
= get_elf_backend_data (s->owner);
if (bed->link_order_error_handler)
- {
- char *name = bfd_get_section_ident (s);
- bed->link_order_error_handler
- (_("%s: warning: sh_link not set for section `%s'"),
- bfd_archive_filename (s->owner),
- name ? name : s->name);
- if (name)
- free (name);
- }
+ bed->link_order_error_handler
+ (_("%B: warning: sh_link not set for section `%A'"), s->owner, s);
return 0;
}
else
if (seen_other && seen_linkorder)
{
- (*_bfd_error_handler) (_("%s: has both ordered and unordered sections"),
- o->name);
+ (*_bfd_error_handler) (_("%A has both ordered and unordered sections"),
+ o);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (o == NULL)
{
(*_bfd_error_handler)
- (_("%s: could not find output section %s"),
- bfd_get_filename (abfd), name);
+ (_("%B: could not find output section %s"), abfd, name);
goto error_return;
}
if (o->size == 0)
if (o == NULL)
{
(*_bfd_error_handler)
- (_("%s: could not find output section %s"),
- bfd_get_filename (abfd), name);
+ (_("%B: could not find output section %s"), abfd, name);
goto error_return;
}
dyn.d_un.d_ptr = o->vma;
struct elf_link_hash_entry **search, *child;
bfd_size_type extsymcount;
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
external symbols start. We don't care about the local symbols at
goto win;
}
- sec_name = bfd_get_section_ident (sec);
- (*_bfd_error_handler) ("%s: %s+%lu: No symbol found for INHERIT",
- bfd_archive_filename (abfd),
- sec_name ? sec_name : sec->name,
- (unsigned long) offset);
+ (*_bfd_error_handler) ("%B: %A+%lu: No symbol found for INHERIT",
+ abfd, sec, (unsigned long) offset);
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
case SEC_LINK_DUPLICATES_ONE_ONLY:
(*_bfd_error_handler)
- (_("%s: %s: warning: ignoring duplicate section `%s'\n"),
- bfd_archive_filename (abfd), name);
+ (_("%B: ignoring duplicate section `%A'\n"),
+ abfd, sec);
break;
case SEC_LINK_DUPLICATES_SAME_SIZE:
if (sec->size != l->sec->size)
(*_bfd_error_handler)
- (_("%s: %s: warning: duplicate section `%s' has different size\n"),
- bfd_archive_filename (abfd), name);
+ (_("%B: duplicate section `%A' has different size\n"),
+ abfd, sec);
break;
}
|| strcmp (sec->output_section->name, ".fini") == 0)
{
(*_bfd_error_handler)
- (_("%s: Can't relax br at 0x%lx in section `%s'. Please use brl or indirect branch."),
- bfd_archive_filename (sec->owner),
- (unsigned long) roff, sec->name);
+ (_("%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."),
+ sec->owner, sec, (unsigned long) roff);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (r_type > R_IA64_MAX_RELOC_CODE)
{
(*_bfd_error_handler)
- (_("%s: unknown relocation type %d"),
- bfd_archive_filename (input_bfd), (int)r_type);
+ (_("%B: unknown relocation type %d"),
+ input_bfd, (int) r_type);
bfd_set_error (bfd_error_bad_value);
ret_val = FALSE;
continue;
/* ??? People shouldn't be doing non-pic code in
shared libraries nor dynamic executables. */
(*_bfd_error_handler)
- (_("%s: non-pic code with imm relocation against dynamic symbol `%s'"),
- bfd_archive_filename (input_bfd),
+ (_("%B: non-pic code with imm relocation against dynamic symbol `%s'"),
+ input_bfd,
h->root.root.string);
ret_val = FALSE;
continue;
if (dynamic_symbol_p)
{
(*_bfd_error_handler)
- (_("%s: @gprel relocation against dynamic symbol %s"),
- bfd_archive_filename (input_bfd), h->root.root.string);
+ (_("%B: @gprel relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.string);
ret_val = FALSE;
continue;
}
/* ??? People shouldn't be doing non-pic code in
shared libraries. Hork. */
(*_bfd_error_handler)
- (_("%s: linking non-pic code in a position independent executable"),
- bfd_archive_filename (input_bfd));
+ (_("%B: linking non-pic code in a position independent executable"),
+ input_bfd);
ret_val = FALSE;
continue;
}
const char *msg;
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)
- msg = _("%s: speculation fixup to dynamic symbol %s");
+ msg = _("%B: speculation fixup to dynamic symbol %s");
else
- msg = _("%s: @pcrel relocation against dynamic symbol %s");
- (*_bfd_error_handler) (msg, bfd_archive_filename (input_bfd),
- h->root.root.string);
+ msg = _("%B: @pcrel relocation against dynamic symbol %s");
+ (*_bfd_error_handler) (msg, input_bfd, h->root.root.string);
ret_val = FALSE;
continue;
}
if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL))
{
(*_bfd_error_handler)
- (_("%s: linking trap-on-NULL-dereference with non-trapping files"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking trap-on-NULL-dereference with non-trapping files"),
+ ibfd);
bfd_set_error (bfd_error_bad_value);
ok = FALSE;
if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE))
{
(*_bfd_error_handler)
- (_("%s: linking big-endian files with little-endian files"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking big-endian files with little-endian files"),
+ ibfd);
bfd_set_error (bfd_error_bad_value);
ok = FALSE;
if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64))
{
(*_bfd_error_handler)
- (_("%s: linking 64-bit files with 32-bit files"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking 64-bit files with 32-bit files"),
+ ibfd);
bfd_set_error (bfd_error_bad_value);
ok = FALSE;
if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP))
{
(*_bfd_error_handler)
- (_("%s: linking constant-gp files with non-constant-gp files"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking constant-gp files with non-constant-gp files"),
+ ibfd);
bfd_set_error (bfd_error_bad_value);
ok = FALSE;
!= (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP))
{
(*_bfd_error_handler)
- (_("%s: linking auto-pic files with non-auto-pic files"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking auto-pic files with non-auto-pic files"),
+ ibfd);
bfd_set_error (bfd_error_bad_value);
ok = FALSE;
if (!ok)
{
(*_bfd_error_handler)
- (_("%s: %s+0x%lx: jump to stub routine which is not jal"),
- bfd_archive_filename (input_bfd),
- input_section->name,
+ (_("%B: %A+0x%lx: jump to stub routine which is not jal"),
+ input_bfd,
+ input_section,
(unsigned long) relocation->r_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr))
{
(*_bfd_error_handler)
- (_("%s: Malformed reloc detected for section %s"),
- bfd_archive_filename (abfd), name);
+ (_("%B: Malformed reloc detected for section %s"),
+ abfd, name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (h == NULL)
{
(*_bfd_error_handler)
- (_("%s: CALL16 reloc at 0x%lx not against global symbol"),
- bfd_archive_filename (abfd), (unsigned long) rel->r_offset);
+ (_("%B: CALL16 reloc at 0x%lx not against global symbol"),
+ abfd, (unsigned long) rel->r_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
{
(*_bfd_error_handler)
- (_("%s: endianness incompatible with that of the selected emulation"),
- bfd_archive_filename (ibfd));
+ (_("%B: endianness incompatible with that of the selected emulation"),
+ ibfd);
return FALSE;
}
if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0)
{
(*_bfd_error_handler)
- (_("%s: ABI is incompatible with that of the selected emulation"),
- bfd_archive_filename (ibfd));
+ (_("%B: ABI is incompatible with that of the selected emulation"),
+ ibfd);
return FALSE;
}
!= ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0))
{
(*_bfd_error_handler)
- (_("%s: warning: linking PIC files with non-PIC files"),
- bfd_archive_filename (ibfd));
+ (_("%B: warning: linking PIC files with non-PIC files"),
+ ibfd);
ok = TRUE;
}
if (mips_32bit_flags_p (old_flags) != mips_32bit_flags_p (new_flags))
{
(*_bfd_error_handler)
- (_("%s: linking 32-bit code with 64-bit code"),
- bfd_archive_filename (ibfd));
+ (_("%B: linking 32-bit code with 64-bit code"),
+ ibfd);
ok = FALSE;
}
else if (!mips_mach_extends_p (bfd_get_mach (ibfd), bfd_get_mach (obfd)))
{
/* The ISAs aren't compatible. */
(*_bfd_error_handler)
- (_("%s: linking %s module with previous %s modules"),
- bfd_archive_filename (ibfd),
+ (_("%B: linking %s module with previous %s modules"),
+ ibfd,
bfd_printable_name (ibfd),
bfd_printable_name (obfd));
ok = FALSE;
!= elf_elfheader (obfd)->e_ident[EI_CLASS]))
{
(*_bfd_error_handler)
- (_("%s: ABI mismatch: linking %s module with previous %s modules"),
- bfd_archive_filename (ibfd),
+ (_("%B: ABI mismatch: linking %s module with previous %s modules"),
+ ibfd,
elf_mips_abi_name (ibfd),
elf_mips_abi_name (obfd));
ok = FALSE;
if (new_flags != old_flags)
{
(*_bfd_error_handler)
- (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
- bfd_archive_filename (ibfd), (unsigned long) new_flags,
+ (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
+ ibfd, (unsigned long) new_flags,
(unsigned long) old_flags);
ok = FALSE;
}
break;
default:
(*_bfd_error_handler)
- (_("%s: unimplemented ATI record %u for symbol %u"),
- bfd_archive_filename (abfd), symbol_attribute_def,
- symbol_name_index);
+ (_("%B: unimplemented ATI record %u for symbol %u"),
+ abfd, symbol_attribute_def, symbol_name_index);
bfd_set_error (bfd_error_bad_value);
return FALSE;
break;
if (value != 0x3f)
{
(*_bfd_error_handler)
- (_("%s: unexpected ATN type %d in external part"),
- bfd_archive_filename (abfd), (int) value);
+ (_("%B: unexpected ATN type %d in external part"),
+ abfd, (int) value);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
default:
(*_bfd_error_handler)
- (_("%s: unexpected type after ATN"),
- bfd_archive_filename (abfd));
+ (_("%B: unexpected type after ATN"), abfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
buf[1] = '\0';
}
(*_bfd_error_handler)
- (_("%s:%d: unexpected character `%s' in Intel Hex file\n"),
- bfd_archive_filename (abfd), lineno, buf);
+ (_("%B:%d: unexpected character `%s' in Intel Hex file"),
+ abfd, lineno, buf);
bfd_set_error (bfd_error_bad_value);
}
}
if (((- chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i))
{
(*_bfd_error_handler)
- (_("%s:%u: bad checksum in Intel Hex file (expected %u, found %u)"),
- bfd_archive_filename (abfd), lineno,
+ (_("%B:%u: bad checksum in Intel Hex file (expected %u, found %u)"),
+ abfd, lineno,
(- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i));
bfd_set_error (bfd_error_bad_value);
goto error_return;
if (len != 2)
{
(*_bfd_error_handler)
- (_("%s:%u: bad extended address record length in Intel Hex file"),
- bfd_archive_filename (abfd), lineno);
+ (_("%B:%u: bad extended address record length in Intel Hex file"),
+ abfd, lineno);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (len != 4)
{
(*_bfd_error_handler)
- (_("%s:%u: bad extended start address length in Intel Hex file"),
- bfd_archive_filename (abfd), lineno);
+ (_("%B:%u: bad extended start address length in Intel Hex file"),
+ abfd, lineno);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (len != 2)
{
(*_bfd_error_handler)
- (_("%s:%u: bad extended linear address record length in Intel Hex file"),
- bfd_archive_filename (abfd), lineno);
+ (_("%B:%u: bad extended linear address record length in Intel Hex file"),
+ abfd, lineno);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (len != 2 && len != 4)
{
(*_bfd_error_handler)
- (_("%s:%u: bad extended linear start address length in Intel Hex file"),
- bfd_archive_filename (abfd), lineno);
+ (_("%B:%u: bad extended linear start address length in Intel Hex file"),
+ abfd, lineno);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
default:
(*_bfd_error_handler)
- (_("%s:%u: unrecognized ihex type %u in Intel Hex file\n"),
- bfd_archive_filename (abfd), lineno, type);
+ (_("%B:%u: unrecognized ihex type %u in Intel Hex file"),
+ abfd, lineno, type);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (type != 0)
{
(*_bfd_error_handler)
- (_("%s: internal error in ihex_read_section"),
- bfd_archive_filename (abfd));
+ (_("%B: internal error in ihex_read_section"), abfd);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if ((bfd_size_type) (p - contents) < section->size)
{
(*_bfd_error_handler)
- (_("%s: bad section length in ihex_read_section"),
- bfd_archive_filename (abfd));
+ (_("%B: bad section length in ihex_read_section"), abfd);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
const char *msg;
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
- 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);
return FALSE;
&& inh->u.i.link == h)
{
(*_bfd_error_handler)
- (_("%s: indirect symbol `%s' to `%s' is a loop"),
- bfd_archive_filename (abfd), name, string);
+ (_("%B: indirect symbol `%s' to `%s' is a loop"),
+ abfd, name, string);
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
break;
case SEC_LINK_DUPLICATES_ONE_ONLY:
- if (s_comdat == NULL)
- (*_bfd_error_handler)
- (_("%s: %s: warning: ignoring duplicate section `%s'\n"),
- bfd_archive_filename (abfd), name);
- else
- (*_bfd_error_handler)
- (_("%s: %s: warning: ignoring duplicate `%s' section symbol `%s'\n"),
- bfd_archive_filename (abfd), name, s_comdat->name);
+ (*_bfd_error_handler)
+ (_("%B: warning: ignoring duplicate section `%A'\n"),
+ abfd, sec);
break;
case SEC_LINK_DUPLICATES_SAME_CONTENTS:
case SEC_LINK_DUPLICATES_SAME_SIZE:
if (sec->size != l->sec->size)
(*_bfd_error_handler)
- (_("%s: %s: warning: duplicate section `%s' has different size\n"),
- bfd_archive_filename (abfd), name);
+ (_("%B: warning: duplicate section `%A' has different size\n"),
+ abfd, sec);
break;
}
/* This case occurs, e.g., for the *DEBUG* section of a COFF
file. */
(*_bfd_error_handler)
- ("%s: can not represent section for symbol `%s' in a.out object file format",
- bfd_archive_filename (abfd),
- cache_ptr->name != NULL ? cache_ptr->name : "*unknown*");
+ ("%B: can not represent section for symbol `%s' in a.out object file format",
+ abfd, cache_ptr->name != NULL ? cache_ptr->name : "*unknown*");
bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE;
}
else
{
(*_bfd_error_handler)
- ("%s: can not represent section `%s' in a.out object file format",
- bfd_archive_filename (abfd), bfd_get_section_name (abfd, sec));
+ ("%B: can not represent section `%A' in a.out object file format",
+ abfd, sec);
bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE;
}
/* BFD back-end for MIPS PE COFF files.
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
This file is part of BFD, the Binary File Descriptor library.
if (info->relocatable)
{
- (*_bfd_error_handler) (_("\
-%s: `ld -r' not supported with PE MIPS objects\n"),
- bfd_archive_filename (input_bfd));
+ (*_bfd_error_handler)
+ (_("%B: `ld -r' not supported with PE MIPS objects\n"), input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
val = VMA of what we need to refer to
*/
-#define UI(x) (*_bfd_error_handler) (_("%s: unimplemented %s\n"), \
- bfd_archive_filename (input_bfd), x); \
+#define UI(x) (*_bfd_error_handler) (_("%B: unimplemented %s\n"), \
+ input_bfd, x); \
bfd_set_error (bfd_error_bad_value);
switch (rel->r_type)
targ = val + (tmp&0x03ffffff)*4;
if ((src & 0xf0000000) != (targ & 0xf0000000))
{
- (*_bfd_error_handler) (_("%s: jump too far away\n"),
- bfd_archive_filename (input_bfd));
+ (*_bfd_error_handler) (_("%B: jump too far away\n"), input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
targ = val + low + ((tmp & 0xffff) << 16);
break;
default:
- (*_bfd_error_handler) (_("%s: bad pair/reflo after refhi\n"),
- bfd_archive_filename (input_bfd));
+ (*_bfd_error_handler) (_("%B: bad pair/reflo after refhi\n"),
+ input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
/* 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.
Written by Cygnus Solutions.
case IMPORT_CONST:
/* XXX code yet to be written. */
- _bfd_error_handler (_("%s: Unhandled import type; %x"),
- bfd_archive_filename (abfd), import_type);
+ _bfd_error_handler (_("%B: Unhandled import type; %x"),
+ abfd, import_type);
return FALSE;
default:
- _bfd_error_handler (_("%s: Unrecognised import type; %x"),
- bfd_archive_filename (abfd), import_type);
+ _bfd_error_handler (_("%B: Unrecognised import type; %x"),
+ abfd, import_type);
return FALSE;
}
break;
default:
- _bfd_error_handler (_("%s: Unrecognised import name type; %x"),
- bfd_archive_filename (abfd), import_name_type);
+ _bfd_error_handler (_("%B: Unrecognised import name type; %x"),
+ abfd, import_name_type);
return FALSE;
}
/* We no longer support PowerPC. */
default:
_bfd_error_handler
- (
-_("%s: Unrecognised machine type (0x%x) in Import Library Format archive"),
- bfd_archive_filename (abfd), machine);
+ (_("%B: Unrecognised machine type (0x%x)"
+ " in Import Library Format archive"),
+ abfd, machine);
bfd_set_error (bfd_error_malformed_archive);
return NULL;
if (magic == 0)
{
_bfd_error_handler
- (
-_("%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive"),
- bfd_archive_filename (abfd), machine);
+ (_("%B: Recognised but unhandled machine type (0x%x)"
+ " in Import Library Format archive"),
+ abfd, machine);
bfd_set_error (bfd_error_wrong_format);
return NULL;
if (size == 0)
{
_bfd_error_handler
- (_("%s: size field is zero in Import Library Format header"),
- bfd_archive_filename (abfd));
+ (_("%B: size field is zero in Import Library Format header"), abfd);
bfd_set_error (bfd_error_malformed_archive);
return NULL;
if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size))
{
_bfd_error_handler
- (_("%s: string not null terminated in ILF object file."),
- bfd_archive_filename (abfd));
+ (_("%B: string not null terminated in ILF object file."), abfd);
bfd_set_error (bfd_error_malformed_archive);
bfd_release (abfd, ptr);
return NULL;
buf[1] = '\0';
}
(*_bfd_error_handler)
- (_("%s:%d: Unexpected character `%s' in S-record file\n"),
- bfd_archive_filename (abfd), lineno, buf);
+ (_("%B:%d: Unexpected character `%s' in S-record file\n"),
+ abfd, lineno, buf);
bfd_set_error (bfd_error_bad_value);
}
}
if (symstroff >= stabstrsec->size)
{
(*_bfd_error_handler)
- (_("%s(%s+0x%lx): Stabs entry has invalid string index."),
- bfd_archive_filename (abfd),
- bfd_get_section_name (abfd, stabsec),
- (long) (sym - stabbuf));
+ (_("%B(%A+0x%lx): Stabs entry has invalid string index."),
+ abfd, stabsec, (long) (sym - stabbuf));
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (enclosing == NULL)
{
(*_bfd_error_handler)
- (_("%s: `%s' has line numbers but no enclosing section"),
- bfd_archive_filename (abfd), name);
+ (_("%B: `%s' has line numbers but no enclosing section"),
+ abfd, name);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (sym.n_numaux == 0)
{
(*_bfd_error_handler)
- (_("%s: class %d symbol `%s' has no aux entries"),
- bfd_archive_filename (abfd), sym.n_sclass, name);
+ (_("%B: class %d symbol `%s' has no aux entries"),
+ abfd, sym.n_sclass, name);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
{
default:
(*_bfd_error_handler)
- (_("%s: symbol `%s' has unrecognized csect type %d"),
- bfd_archive_filename (abfd), name, smtyp);
+ (_("%B: symbol `%s' has unrecognized csect type %d"),
+ abfd, name, smtyp);
bfd_set_error (bfd_error_bad_value);
goto error_return;
|| aux.x_csect.x_scnlen.l != 0)
{
(*_bfd_error_handler)
- (_("%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"),
- bfd_archive_filename (abfd), name, sym.n_sclass, sym.n_scnum,
+ (_("%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"),
+ abfd, name, sym.n_sclass, sym.n_scnum,
aux.x_csect.x_scnlen.l);
bfd_set_error (bfd_error_bad_value);
goto error_return;
|| aux.x_csect.x_scnlen.l != 0)
{
(*_bfd_error_handler)
- (_("%s: XMC_TC0 symbol `%s' is class %d scnlen %d"),
- bfd_archive_filename (abfd), name, sym.n_sclass,
- aux.x_csect.x_scnlen.l);
+ (_("%B: XMC_TC0 symbol `%s' is class %d scnlen %d"),
+ abfd, name, sym.n_sclass, aux.x_csect.x_scnlen.l);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
> enclosing->vma + enclosing->size)))
{
(*_bfd_error_handler)
- (_("%s: csect `%s' not in enclosing section"),
- bfd_archive_filename (abfd), name);
+ (_("%B: csect `%s' not in enclosing section"),
+ abfd, name);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (bad)
{
(*_bfd_error_handler)
- (_("%s: misplaced XTY_LD `%s'"),
- bfd_archive_filename (abfd), name);
+ (_("%B: misplaced XTY_LD `%s'"),
+ abfd, name);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (*rel_csect == NULL)
{
(*_bfd_error_handler)
- (_("%s: reloc %s:%d not in csect"),
- bfd_archive_filename (abfd), o->name, i);
+ (_("%B: reloc %s:%d not in csect"),
+ abfd, o->name, i);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
else
{
(*_bfd_error_handler)
- (_("%s: loader reloc in unrecognized section `%s'"),
- bfd_archive_filename (input_bfd),
- sec->name);
+ (_("%B: loader reloc in unrecognized section `%A'"),
+ input_bfd, sec);
bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE;
}
if (h->ldindx < 0 && ! quiet)
{
(*_bfd_error_handler)
- (_("%s: `%s' in loader reloc but not loader sym"),
- bfd_archive_filename (input_bfd),
+ (_("%B: `%s' in loader reloc but not loader sym"),
+ input_bfd,
h->root.root.string);
bfd_set_error (bfd_error_bad_value);
return FALSE;
&& ! quiet)
{
(*_bfd_error_handler)
- (_("%s: loader reloc in read-only section %s"),
- bfd_archive_filename (input_bfd),
- bfd_get_section_name (finfo->output_bfd,
- o->output_section));
+ (_("%B: loader reloc in read-only section %A"),
+ input_bfd, o->output_section);
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
+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>
* libiberty.h (XDELETE, XDELETEVEC, XRESIZEVEC): Remove any
bfd_boolean (*notice)
(struct bfd_link_info *, const char *name,
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
};
\f
/* The linker builds link_order structures which tell the code how to
+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>
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Call
reloc_overflow,
reloc_dangerous,
unattached_reloc,
- notice,
- error_handler
+ notice
};
struct bfd_link_info link_info;
/* ldmisc.c
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2002, 2003
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
#include "ldlex.h"
#include "ldmain.h"
#include "ldfile.h"
+#include "elf-bfd.h"
/*
%% literal %
+ %A section name from a section
+ %B filename from a bfd
+ %C clever filename:linenumber with function
+ %D like %C, but no function name
+ %E current bfd error or errno
%F error is fatal
+ %G like %D, but only function name
+ %I filename from a lang_input_statement_type
%P print program name
+ %R info about a relent
%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
%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
- %D like %C, but no function name
- %G like %D, but only function name
- %R info about a relent
- %s arbitrary string, like printf
+ %X no object output, fail return
%d integer, like printf
+ %s arbitrary string, like printf
%u integer, like printf
+ %v hex bfd_vma, no leading zeros
*/
static void
}
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':
/* filename from a bfd */
{
const char *functionname;
unsigned int linenumber;
bfd_boolean discard_last;
- char *sec_name;
abfd = va_arg (arg, bfd *);
section = va_arg (arg, asection *);
}
}
- sec_name = bfd_get_section_ident (section);
- lfinfo (fp, "%B(%s+0x%v)", abfd,
- sec_name ? sec_name : section->name, offset);
- if (sec_name)
- free (sec_name);
+ lfinfo (fp, "%B(%A+0x%v)", abfd, section, offset);
discard_last = TRUE;
if (bfd_find_nearest_line (abfd, section, asymbols, offset,
einfo (_("%P%F: please report this bug\n"));
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;
-}
/* 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.
This file is part of GLD, the Gnu Linker.
#ifndef LDMISC_H
#define LDMISC_H
-extern bfd_boolean error_handler (int, const char *, ...);
extern void einfo (const char *, ...);
extern void minfo (const char *, ...);
extern void info_msg (const char *, ...);