]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use %A and %B in more error messages
authorAlan Modra <amodra@gmail.com>
Thu, 13 Apr 2017 03:50:15 +0000 (13:20 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 13 Apr 2017 07:37:24 +0000 (17:07 +0930)
* aoutx.h: Use %B and %A in error messages throughout file.
* aout-cris.c: Likewise.
* archive.c: Likewise.
* binary.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-tic4x.c: Likewise.
* coffcode.h: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* coffswap.h: Likewise.
* cpu-arm.c: Likewise.
* elf-eh-frame.c: Likewise.
* elf-m10300.c: Likewise.
* elf.c: Likewise.
* elf32-arc.c: Likewise.
* elf32-arm.c: Likewise.
* elf32-bfin.c: Likewise.
* elf32-frv.c: Likewise.
* elf32-iq2000.c: Likewise.
* elf32-m32c.c: Likewise.
* elf32-microblaze.c: Likewise.
* elf32-nds32.c: Likewise.
* elf32-rl78.c: Likewise.
* elf32-rx.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-sh64.c: Likewise.
* elf32-v850.c: Likewise.
* elf32-vax.c: Likewise.
* elf32-visium.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-sh64.c: Likewise.
* elfcode.h: Likewise.
* elfnn-aarch64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.
* hpux-core.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* linker.c: Likewise.
* merge.c: Likewise.
* mmo.c: Likewise.
* oasys.c: Likewise.
* pdp11.c: Likewise.
* peXXigen.c: Likewise.
* rs6000-core.c: Likewise.
* vms-alpha.c: Likewise.
* xcofflink.c: Likewise.

50 files changed:
bfd/ChangeLog
bfd/aout-cris.c
bfd/aoutx.h
bfd/archive.c
bfd/binary.c
bfd/coff-rs6000.c
bfd/coff-tic4x.c
bfd/coffcode.h
bfd/coffgen.c
bfd/cofflink.c
bfd/coffswap.h
bfd/cpu-arm.c
bfd/elf-eh-frame.c
bfd/elf-m10300.c
bfd/elf.c
bfd/elf32-arc.c
bfd/elf32-arm.c
bfd/elf32-bfin.c
bfd/elf32-frv.c
bfd/elf32-iq2000.c
bfd/elf32-m32c.c
bfd/elf32-microblaze.c
bfd/elf32-nds32.c
bfd/elf32-rl78.c
bfd/elf32-rx.c
bfd/elf32-score.c
bfd/elf32-score7.c
bfd/elf32-sh64.c
bfd/elf32-v850.c
bfd/elf32-vax.c
bfd/elf32-visium.c
bfd/elf64-ia64-vms.c
bfd/elf64-mmix.c
bfd/elf64-sh64.c
bfd/elfcode.h
bfd/elfnn-aarch64.c
bfd/elfnn-ia64.c
bfd/elfxx-mips.c
bfd/hpux-core.c
bfd/ieee.c
bfd/ihex.c
bfd/linker.c
bfd/merge.c
bfd/mmo.c
bfd/oasys.c
bfd/pdp11.c
bfd/peXXigen.c
bfd/rs6000-core.c
bfd/vms-alpha.c
bfd/xcofflink.c

index b8a218f31c7356a4f1681a6ab596d262d9d04e4a..f46aaae07e842d7202bc569ae2a2ef0ba76aad65 100644 (file)
@@ -1,3 +1,55 @@
+2017-04-13  Alan Modra  <amodra@gmail.com>
+
+       * aoutx.h: Use %B and %A in error messages throughout file.
+       * aout-cris.c: Likewise.
+       * archive.c: Likewise.
+       * binary.c: Likewise.
+       * coff-rs6000.c: Likewise.
+       * coff-tic4x.c: Likewise.
+       * coffcode.h: Likewise.
+       * coffgen.c: Likewise.
+       * cofflink.c: Likewise.
+       * coffswap.h: Likewise.
+       * cpu-arm.c: Likewise.
+       * elf-eh-frame.c: Likewise.
+       * elf-m10300.c: Likewise.
+       * elf.c: Likewise.
+       * elf32-arc.c: Likewise.
+       * elf32-arm.c: Likewise.
+       * elf32-bfin.c: Likewise.
+       * elf32-frv.c: Likewise.
+       * elf32-iq2000.c: Likewise.
+       * elf32-m32c.c: Likewise.
+       * elf32-microblaze.c: Likewise.
+       * elf32-nds32.c: Likewise.
+       * elf32-rl78.c: Likewise.
+       * elf32-rx.c: Likewise.
+       * elf32-score.c: Likewise.
+       * elf32-score7.c: Likewise.
+       * elf32-sh64.c: Likewise.
+       * elf32-v850.c: Likewise.
+       * elf32-vax.c: Likewise.
+       * elf32-visium.c: Likewise.
+       * elf64-ia64-vms.c: Likewise.
+       * elf64-mmix.c: Likewise.
+       * elf64-sh64.c: Likewise.
+       * elfcode.h: Likewise.
+       * elfnn-aarch64.c: Likewise.
+       * elfnn-ia64.c: Likewise.
+       * elfxx-mips.c: Likewise.
+       * hpux-core.c: Likewise.
+       * ieee.c: Likewise.
+       * ihex.c: Likewise.
+       * linker.c: Likewise.
+       * merge.c: Likewise.
+       * mmo.c: Likewise.
+       * oasys.c: Likewise.
+       * pdp11.c: Likewise.
+       * peXXigen.c: Likewise.
+       * rs6000-core.c: Likewise.
+       * vms-alpha.c: Likewise.
+       * xcofflink.c: Likewise.
+
 2017-04-13  Alan Modra  <amodra@gmail.com>
 
        * bfd.c (PRINT_TYPE): Define.
index 2e36e9d554652e66f72edf565b1d2807b4cd1826..6cd14e3d5870500169274d489eaebadb5ad83a9a 100644 (file)
@@ -197,8 +197,8 @@ MY (swap_ext_reloc_out) (bfd *abfd,
   if (r_type > 2)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%s: Invalid relocation type exported: %d"),
-                         bfd_get_filename (abfd), r_type);
+      _bfd_error_handler (_("%B: Invalid relocation type exported: %d"),
+                         abfd, r_type);
 
       bfd_set_error (bfd_error_wrong_format);
     }
index d30e8b8fbcc5af3fc947110ac162d9dea063ef77..9a5f7ce9cd2366773f2538234497abbd02a3927e 100644 (file)
@@ -1279,8 +1279,8 @@ NAME (aout, set_section_contents) (bfd *abfd,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-          (_("%s: can not represent section `%s' in a.out object file format"),
-            bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
+          (_("%B: can not represent section `%A' in a.out object file format"),
+            abfd, section);
           bfd_set_error (bfd_error_nonrepresentable_section);
           return FALSE;
        }
@@ -1580,9 +1580,9 @@ translate_to_native_sym_flags (bfd *abfd,
         file.  */
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: can not represent section for symbol `%s' in a.out "
+       (_("%B: can not represent section for symbol `%s' in a.out "
           "object file format"),
-        bfd_get_filename (abfd),
+        abfd,
         cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*"));
       bfd_set_error (bfd_error_nonrepresentable_section);
       return FALSE;
@@ -1616,8 +1616,8 @@ translate_to_native_sym_flags (bfd *abfd,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-          (_("%s: can not represent section `%s' in a.out object file format"),
-            bfd_get_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;
        }
@@ -5419,9 +5419,8 @@ NAME (aout, final_link) (bfd *abfd,
                 by the reloc size.  */
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%s: relocatable link from %s to %s not supported"),
-                bfd_get_filename (abfd),
-                sub->xvec->name, abfd->xvec->name);
+               (_("%B: relocatable link from %s to %s not supported"),
+                abfd, sub->xvec->name, abfd->xvec->name);
              bfd_set_error (bfd_error_invalid_operation);
              goto error_return;
            }
index d96c8667eb5f539551c4af2dbc11de117dc13ab3..f209babe149f3f5b302da64f593e039c9c79ea8c 100644 (file)
@@ -2402,8 +2402,8 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
 
                      if (strcmp (syms[src_count]->name, "__gnu_lto_slim") == 0)
                        _bfd_error_handler
-                         (_("%s: plugin needed to handle lto object"),
-                          bfd_get_filename (current));
+                         (_("%B: plugin needed to handle lto object"),
+                          current);
                      namelen = strlen (syms[src_count]->name);
                      amt = sizeof (char *);
                      map[orl_count].name = (char **) bfd_alloc (arch, amt);
index f6304744b658318e187fad2014f8a9fc459a6979..ff52f1423b3fbf47c6b0211f6d96e47231c6a04d 100644 (file)
@@ -271,10 +271,9 @@ binary_set_section_contents (bfd *abfd,
          if (s->filepos < 0)
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("Warning: Writing section `%s' at huge (ie negative) "
+             (_("warning: writing section `%A' at huge (ie negative) "
                 "file offset 0x%lx."),
-              bfd_get_section_name (abfd, s),
-              (unsigned long) s->filepos);
+              s, (unsigned long) s->filepos);
        }
 
       abfd->output_has_begun = TRUE;
index 511f0c1695b8f97984d061418831e56b466cfc5d..e2b149bddeb43219987725e830a5ad14b11b2a0a 100644 (file)
@@ -2738,8 +2738,8 @@ xcoff_reloc_type_fail (bfd *input_bfd,
 {
   _bfd_error_handler
     /* xgettext: c-format */
-    (_("%s: unsupported relocation type 0x%02x"),
-     bfd_get_filename (input_bfd), (unsigned int) rel->r_type);
+    (_("%B: unsupported relocation type 0x%02x"),
+     input_bfd, (unsigned int) rel->r_type);
   bfd_set_error (bfd_error_bad_value);
   return FALSE;
 }
@@ -2824,9 +2824,8 @@ xcoff_reloc_type_toc (bfd *input_bfd,
        {
          _bfd_error_handler
            /* xgettext: c-format */
-           (_("%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"),
-            bfd_get_filename (input_bfd), rel->r_vaddr,
-            h->root.root.string);
+           (_("%B: TOC reloc at 0x%x to symbol `%s' with no TOC entry"),
+            input_bfd, rel->r_vaddr, h->root.root.string);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
        }
index aae05915958c418602053e2d7c608e03fe878c6e..89dc36b0b698a3a58a3eadc0ad1a4bff720e4154 100644 (file)
@@ -224,8 +224,8 @@ tic4x_reloc_processing (arelent *relent,
         {
          _bfd_error_handler
            /* xgettext: c-format */
-            (_("%s: warning: illegal symbol index %ld in relocs"),
-             bfd_get_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;
         }
index 975d249b703f7cf604244ffae80526bf99047eb8..2716b508295516f62dccd8344a35d27928c4da9c 100644 (file)
@@ -1942,8 +1942,8 @@ coff_set_alignment_hook (bfd * abfd ATTRIBUTE_UNUSED,
     }
   else if (hdr->s_nreloc == 0xffff)
     _bfd_error_handler
-      (_("%s: warning: claims to have 0xffff relocs, without overflow"),
-       bfd_get_filename (abfd));
+      (_("%B: warning: claims to have 0xffff relocs, without overflow"),
+       abfd);
 }
 #undef ALIGN_SET
 #undef ELIFALIGN_SET
@@ -3767,8 +3767,8 @@ coff_write_object_contents (bfd * abfd)
                  bfd_set_error (bfd_error_file_too_big);
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%B: section %s: string table overflow at offset %ld"),
-                   abfd, current->name, string_size);
+                   (_("%B: section %A: string table overflow at offset %ld"),
+                   abfd, current, string_size);
                  return FALSE;
                }
 
index 18f423ba89f8e5ba92d380e75f893e538838e91f..31c2c5a1baa620fb181dd49d6dab7e954627729c 100644 (file)
@@ -3004,7 +3004,8 @@ coff_gc_sweep (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
 
          if (info->print_gc_sections && o->size != 0)
            /* xgettext: c-format */
-            _bfd_error_handler (_("Removing unused section '%s' in file '%B'"), sub, o->name);
+           _bfd_error_handler (_("Removing unused section '%A' in file '%B'"),
+                               o, sub);
 
 #if 0
          /* But we also have to update some of the relocation
index 033b64ed3be934a53ee8b7967b2459d3f5a39f87..aa84a3512805c8a0c65a370c3959db930fdcd5a9 100644 (file)
@@ -2727,20 +2727,16 @@ _bfd_coff_write_global_sym (struct bfd_hash_entry *bh, void *data)
                      || bfd_link_relocatable (flaginfo->info)))
                _bfd_error_handler
                  /* xgettext: c-format */
-                 (_("%s: %s: reloc overflow: 0x%lx > 0xffff"),
-                  bfd_get_filename (output_bfd),
-                  bfd_get_section_name (output_bfd, sec),
-                  sec->reloc_count);
+                 (_("%B: %A: reloc overflow: 0x%lx > 0xffff"),
+                  output_bfd, sec, sec->reloc_count);
 
              if (sec->lineno_count > 0xffff
                  && (! obj_pe (output_bfd)
                      || bfd_link_relocatable (flaginfo->info)))
                _bfd_error_handler
                  /* xgettext: c-format */
-                 (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
-                  bfd_get_filename (output_bfd),
-                  bfd_get_section_name (output_bfd, sec),
-                  sec->lineno_count);
+                 (_("%B: warning: %A: line number overflow: 0x%lx > 0xffff"),
+                  output_bfd, sec, sec->lineno_count);
 
              auxp->x_scn.x_nreloc = sec->reloc_count;
              auxp->x_scn.x_nlinno = sec->lineno_count;
index 7f2505191354116c88cbcce16529aacc3e2ff357..3c147f532288c38f36a01e21fde10efdaeadad4d 100644 (file)
@@ -808,9 +808,8 @@ coff_swap_scnhdr_out (bfd * abfd, void * in, void * out)
       buf[sizeof (scnhdr_int->s_name)] = '\0';
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
-        bfd_get_filename (abfd),
-        buf, scnhdr_int->s_nlnno);
+       (_("%B: warning: %s: line number overflow: 0x%lx > 0xffff"),
+        abfd, buf, scnhdr_int->s_nlnno);
       PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno);
     }
 
@@ -823,9 +822,8 @@ coff_swap_scnhdr_out (bfd * abfd, void * in, void * out)
       memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
       buf[sizeof (scnhdr_int->s_name)] = '\0';
       /* xgettext:c-format */
-      _bfd_error_handler (_("%s: %s: reloc overflow: 0x%lx > 0xffff"),
-                         bfd_get_filename (abfd),
-                         buf, scnhdr_int->s_nreloc);
+      _bfd_error_handler (_("%B: %s: reloc overflow: 0x%lx > 0xffff"),
+                         abfd, buf, scnhdr_int->s_nreloc);
       bfd_set_error (bfd_error_file_truncated);
       PUT_SCNHDR_NRELOC (abfd, 0xffff, scnhdr_ext->s_nreloc);
       ret = 0;
index 80bd29687d73fdf452a869b09cc4059b14eb73d8..3d4ed5dffffe2c3f9442e4702e7e82ea97c5defb 100644 (file)
@@ -335,8 +335,8 @@ bfd_arm_update_notes (bfd *abfd, const char *note_section)
        {
          _bfd_error_handler
            /* xgettext: c-format */
-           (_("warning: unable to update contents of %s section in %s"),
-            note_section, bfd_get_filename (abfd));
+           (_("warning: unable to update contents of %s section in %B"),
+            note_section, abfd);
          goto FAIL;
        }
     }
index 6967f37395f69b14fccbe2e990f28ad7e44230a6..1743823891541545a5e380536c56cd25ac7ded90 100644 (file)
@@ -1724,7 +1724,7 @@ _bfd_elf_write_section_eh_frame_entry (bfd *abfd, struct bfd_link_info *info,
       if (addr <= last_addr)
        {
          /* xgettext:c-format */
-         _bfd_error_handler (_("%B: %s not in order"), sec->owner, sec->name);
+         _bfd_error_handler (_("%B: %A not in order"), sec->owner, sec);
          return FALSE;
        }
 
@@ -1738,16 +1738,16 @@ _bfd_elf_write_section_eh_frame_entry (bfd *abfd, struct bfd_link_info *info,
   if (addr & 1)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%B: %s invalid input section size"),
-                         sec->owner, sec->name);
+      _bfd_error_handler (_("%B: %A invalid input section size"),
+                         sec->owner, sec);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
   if (last_addr >= addr + sec->rawsize)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%B: %s points past end of text section"),
-                         sec->owner, sec->name);
+      _bfd_error_handler (_("%B: %A points past end of text section"),
+                         sec->owner, sec);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
@@ -2165,8 +2165,8 @@ _bfd_elf_fixup_eh_frame_hdr (struct bfd_link_info *info)
       if (sec->output_section != osec)
        {
          _bfd_error_handler
-           (_("Invalid output section for .eh_frame_entry: %s"),
-            sec->output_section->name);
+           (_("Invalid output section for .eh_frame_entry: %A"),
+            sec->output_section);
          return FALSE;
        }
       sec->output_offset = offset;
@@ -2188,7 +2188,7 @@ _bfd_elf_fixup_eh_frame_hdr (struct bfd_link_info *info)
   if (i != 0)
     {
       _bfd_error_handler
-       (_("Invalid contents in %s section"), osec->name);
+       (_("Invalid contents in %A section"), osec);
       return FALSE;
     }
 
index e7d466b1224d2064c9520fb3e1435c2ae86218a0..f9d8089704087b8df5d06439d43e1cbbd11f151b 100644 (file)
@@ -1025,8 +1025,8 @@ mn10300_do_tls_transition (bfd *         input_bfd,
     default:
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: Unsupported transition from %s to %s"),
-        bfd_get_filename (input_bfd),
+       (_("%B: Unsupported transition from %s to %s"),
+        input_bfd,
         elf_mn10300_howto_table[r_type].name,
         elf_mn10300_howto_table[tls_r_type].name);
       break;
index 802a3393cacc42ad998978b6aa81a0766339e0dd..6b5e42b0a9fcfa1b80b3a38ce100b481dde67fff 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -894,14 +894,14 @@ _bfd_elf_setup_sections (bfd *abfd)
            /* There are some unknown sections in the group.  */
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%B: unknown [%d] section `%s' in group [%s]"),
+             (_("%B: unknown [%d] section `%s' in group [%A]"),
               abfd,
               (unsigned int) idx->shdr->sh_type,
               bfd_elf_string_from_elf_section (abfd,
                                                (elf_elfheader (abfd)
                                                 ->e_shstrndx),
                                                idx->shdr->sh_name),
-              shdr->bfd_section->name);
+              shdr->bfd_section);
            result = FALSE;
          }
     }
index f31aeff93e7e3b1b7917b0c9c779f0267349f012..5f1505e7e987de60eb10b3c17e3c26b701ff178b 100644 (file)
@@ -565,8 +565,8 @@ arc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
        {
          /* xgettext:c-format */
          _bfd_error_handler (_("ERROR: Attempting to link %B "
-                               "with a binary %s of different architecture"),
-                             ibfd, bfd_get_filename (obfd));
+                               "with a binary %B of different architecture"),
+                             ibfd, obfd);
          return FALSE;
        }
       else if (in_flags != out_flags)
@@ -574,9 +574,9 @@ arc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
          /* Warn if different flags.  */
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: uses different e_flags (0x%lx) fields than "
+           (_("%B: uses different e_flags (0x%lx) fields than "
               "previous modules (0x%lx)"),
-            bfd_get_filename (ibfd), (long)in_flags, (long)out_flags);
+            ibfd, (long) in_flags, (long) out_flags);
          if (in_flags && out_flags)
            return FALSE;
          /* MWDT doesnt set the eflags hence make sure we choose the
index e0ae9231e373461056e4665d2f4799ead34ae393..61cadf7a84445a3f60ea6be6b2a4494d2389cae0 100644 (file)
@@ -4493,7 +4493,7 @@ elf32_arm_add_stub (const char *stub_name, asection *section,
     {
       if (section == NULL)
        section = stub_sec;
-      _bfd_error_handler (_("%s: cannot create stub entry %s"),
+      _bfd_error_handler (_("%B: cannot create stub entry %s"),
                          section->owner, stub_name);
       return NULL;
     }
@@ -6630,7 +6630,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
                                             TRUE, FALSE);
          if (stub_entry == NULL)
            {
-             _bfd_error_handler (_("%s: cannot create stub entry %s"),
+             _bfd_error_handler (_("%B: cannot create stub entry %s"),
                                  section->owner, stub_name);
              return FALSE;
            }
@@ -16023,8 +16023,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
       if (!bfd_elf32_arm_process_before_allocation (ibfd, info)
          || !bfd_elf32_arm_vfp11_erratum_scan (ibfd, info)
          || !bfd_elf32_arm_stm32l4xx_erratum_scan (ibfd, info))
-       _bfd_error_handler (_("Errors encountered processing file %s"),
-                           ibfd->filename);
+       _bfd_error_handler (_("Errors encountered processing file %B"), ibfd);
     }
 
   /* Allocate space for the glue sections now that we've sized them.  */
index 2a5390385cce8e51a5b3117c18ab60c0b0ec0373..ff1bcc6f43ffc84047f76b11d0b425113be69af0 100644 (file)
@@ -4949,9 +4949,8 @@ elf32_bfin_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
   if (0)
 #endif
   _bfd_error_handler
-    ("old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s, filename = %s",
-     old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no",
-     bfd_get_filename (ibfd));
+    ("old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s, filename = %B",
+     old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no", ibfd);
 
   if (!elf_flags_init (obfd))                  /* First call, no flags set.  */
     {
@@ -4964,12 +4963,12 @@ elf32_bfin_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
       error = TRUE;
       if (IS_FDPIC (obfd))
        _bfd_error_handler
-         (_("%s: cannot link non-fdpic object file into fdpic executable"),
-          bfd_get_filename (ibfd));
+         (_("%B: cannot link non-fdpic object file into fdpic executable"),
+          ibfd);
       else
        _bfd_error_handler
-         (_("%s: cannot link fdpic object file into non-fdpic executable"),
-          bfd_get_filename (ibfd));
+         (_("%B: cannot link fdpic object file into non-fdpic executable"),
+          ibfd);
     }
 
   if (error)
index f99869099aed5b562b80b97061361e37c9181ea9..d4b77275d5b36b2ab6258e61265f71aeaa39b18e 100644 (file)
@@ -6507,9 +6507,9 @@ frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
              error = TRUE;
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%s: compiled with %s and linked with modules that use non-pic relocations"),
-                bfd_get_filename (ibfd),
-                (new_flags & EF_FRV_BIGPIC) ? "-fPIC" : "-fpic");
+               (_("%B: compiled with %s and linked with modules"
+                  " that use non-pic relocations"),
+                ibfd, (new_flags & EF_FRV_BIGPIC) ? "-fPIC" : "-fpic");
 #endif
            }
        }
@@ -6561,8 +6561,8 @@ frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
          error = TRUE;
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: compiled with %s and linked with modules compiled with %s"),
-            bfd_get_filename (ibfd), new_opt, old_opt);
+           (_("%B: compiled with %s and linked with modules compiled with %s"),
+            ibfd, new_opt, old_opt);
        }
 
       /* Warn about any other mismatches */
@@ -6574,8 +6574,9 @@ frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
          error = TRUE;
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)"),
-            bfd_get_filename (ibfd), (long)new_partial, (long)old_partial);
+           (_("%B: uses different unknown e_flags (0x%lx) fields"
+              " than previous modules (0x%lx)"),
+            ibfd, (long) new_partial, (long) old_partial);
        }
     }
 
@@ -6595,12 +6596,12 @@ frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
       error = TRUE;
       if (IS_FDPIC (obfd))
        _bfd_error_handler
-         (_("%s: cannot link non-fdpic object file into fdpic executable"),
-          bfd_get_filename (ibfd));
+         (_("%B: cannot link non-fdpic object file into fdpic executable"),
+          ibfd);
       else
        _bfd_error_handler
-         (_("%s: cannot link fdpic object file into non-fdpic executable"),
-          bfd_get_filename (ibfd));
+         (_("%B: cannot link fdpic object file into non-fdpic executable"),
+          ibfd);
     }
 
   if (error)
index f28e7519bc0edcb35f9177bcb8f4f6f0f0de79a3..1f88726e33f40c87d684147d233225e7333b3007 100644 (file)
@@ -829,8 +829,8 @@ iq2000_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
          error = TRUE;
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: compiled with %s and linked with modules compiled with %s"),
-            bfd_get_filename (ibfd), new_opt, old_opt);
+           (_("%B: compiled with %s and linked with modules compiled with %s"),
+            ibfd, new_opt, old_opt);
        }
 
       new_flags &= ~ EF_IQ2000_ALL_FLAGS;
@@ -843,8 +843,8 @@ iq2000_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
-            bfd_get_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);
        }
     }
 
index b5e2474bdaebf9783e8678cbd053444250f330ef..1944465aac47062b6a0c613ad3c8db3c6ec97b0c 100644 (file)
@@ -874,8 +874,8 @@ m32c_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
          error = TRUE;
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: compiled with %s and linked with modules compiled with %s"),
-            bfd_get_filename (ibfd), new_opt, old_opt);
+           (_("%B: compiled with %s and linked with modules compiled with %s"),
+            ibfd, new_opt, old_opt);
        }
 
       new_flags &= ~ EF_M32C_ALL_FLAGS;
@@ -887,8 +887,9 @@ m32c_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
          error = TRUE;
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
-            bfd_get_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);
        }
     }
 
index 325a0d64c36ec9197596879f47374df298eacba4..f2796b4aa783d657988ebf28900203e70a70dca2 100644 (file)
@@ -949,8 +949,8 @@ microblaze_elf_relocate_section (bfd *output_bfd,
       if (r_type < 0 || r_type >= (int) R_MICROBLAZE_max)
        {
          /* xgettext:c-format */
-         _bfd_error_handler (_("%s: unknown relocation type %d"),
-                             bfd_get_filename (input_bfd), (int) r_type);
+         _bfd_error_handler (_("%B: unknown relocation type %d"),
+                             input_bfd, (int) r_type);
          bfd_set_error (bfd_error_bad_value);
          ret = FALSE;
          continue;
@@ -1077,12 +1077,12 @@ microblaze_elf_relocate_section (bfd *output_bfd,
                      {
                        _bfd_error_handler
                          /* xgettext:c-format */
-                         (_("%s: The target (%s) of an %s relocation "
-                            "is in the wrong section (%s)"),
-                          bfd_get_filename (input_bfd),
+                         (_("%B: The target (%s) of an %s relocation"
+                            " is in the wrong section (%A)"),
+                          input_bfd,
                           sym_name,
                           microblaze_elf_howto_table[(int) r_type]->name,
-                          bfd_get_section_name (sec->owner, sec));
+                          sec);
                        /*bfd_set_error (bfd_error_bad_value); ??? why? */
                        ret = FALSE;
                        continue;
@@ -1125,12 +1125,12 @@ microblaze_elf_relocate_section (bfd *output_bfd,
                      {
                        _bfd_error_handler
                          /* xgettext:c-format */
-                         (_("%s: The target (%s) of an %s relocation "
-                            "is in the wrong section (%s)"),
-                          bfd_get_filename (input_bfd),
+                         (_("%B: The target (%s) of an %s relocation"
+                            " is in the wrong section (%A)"),
+                          input_bfd,
                           sym_name,
                           microblaze_elf_howto_table[(int) r_type]->name,
-                          bfd_get_section_name (sec->owner, sec));
+                          sec);
                        /*bfd_set_error (bfd_error_bad_value); ??? why? */
                        ret = FALSE;
                        continue;
index 982816089e5c927406041e0b891dd6b6aa735dd4..17951753b3a42bcf908e13d6c40bd923d808af74 100644 (file)
@@ -4969,8 +4969,8 @@ nds32_elf_relocate_section (bfd *                  output_bfd ATTRIBUTE_UNUSED,
          if (bfd_link_pic (info))
            {
              _bfd_error_handler
-               (_("%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared "
-                  "mode."), bfd_get_filename (input_bfd));
+               (_("%B: warning: cannot deal R_NDS32_25_ABS_RELA in shared "
+                  "mode."), input_bfd);
              return FALSE;
            }
          break;
@@ -15433,9 +15433,9 @@ nds32_elf_ex9_build_hash_table (bfd *abfd, asection *sec,
                          /* Incorrect alignment.  */
                          _bfd_error_handler
                            /* xgettext:c-format */
-                           (_("%s: warning: unaligned small data access. "
+                           (_("%B: warning: unaligned small data access. "
                               "For entry: {%d, %d, %d}, addr = 0x%x, align = 0x%x."),
-                            bfd_get_filename (abfd), irel->r_offset,
+                            abfd, irel->r_offset,
                             irel->r_info, irel->r_addend, relocation, align);
                          off += 4;
                          continue;
index 42e25685e677878df1810fd5e93bb7acdc7415ec..0326445bead8a71314ef1670e16704efd319c2fb 100644 (file)
@@ -1198,9 +1198,9 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("RL78 ABI conflict: G10 file %s cannot be linked with %s file %s"),
-                    bfd_get_filename (ibfd),
-                    rl78_cpu_name (out_cpu), bfd_get_filename (obfd));
+                   (_("RL78 ABI conflict: G10 file %B cannot be linked"
+                      " with %s file %B"),
+                    ibfd, rl78_cpu_name (out_cpu), obfd);
                }
              else
                {
@@ -1215,9 +1215,9 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("RL78 ABI conflict: cannot link %s file %s with %s file %s"),
-                rl78_cpu_name (in_cpu),  bfd_get_filename (ibfd),
-                rl78_cpu_name (out_cpu), bfd_get_filename (obfd));
+               (_("RL78 ABI conflict: cannot link %s file %B with %s file %B"),
+                rl78_cpu_name (in_cpu),  ibfd,
+                rl78_cpu_name (out_cpu), obfd);
            }
        }
 
@@ -1228,12 +1228,12 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 
          if (old_flags & E_FLAG_RL78_64BIT_DOUBLES)
            /* xgettext:c-format */
-           _bfd_error_handler (_("- %s is 64-bit, %s is not"),
-                               bfd_get_filename (obfd), bfd_get_filename (ibfd));
+           _bfd_error_handler (_("- %B is 64-bit, %B is not"),
+                               obfd, ibfd);
          else
            /* xgettext:c-format */
-           _bfd_error_handler (_("- %s is 64-bit, %s is not"),
-                               bfd_get_filename (ibfd), bfd_get_filename (obfd));
+           _bfd_error_handler (_("- %B is 64-bit, %B is not"),
+                               ibfd, obfd);
          error = TRUE;
        }
     }
index c09fd9fc052de886da26711b216c6a40e240b13d..bb2b3079c172138efbc4279bb252d43abe4e3b8f 100644 (file)
@@ -3142,8 +3142,9 @@ rx_elf_merge_private_bfd_data (bfd * ibfd, struct bfd_link_info *info)
            }
          else
            {
-             _bfd_error_handler (_("There is a conflict merging the ELF header flags from %s"),
-                                 bfd_get_filename (ibfd));
+             _bfd_error_handler (_("There is a conflict merging the"
+                                   " ELF header flags from %B"),
+                                 ibfd);
              _bfd_error_handler (_("  the input  file's flags: %s"),
                                  describe_flags (new_flags));
              _bfd_error_handler (_("  the output file's flags: %s"),
index 98170df793eb0a0cd5100ae66618254b70316192..98856e8e009df5f0be3e52f00cc2adfb689b6998 100644 (file)
@@ -2769,7 +2769,6 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
                                asection *sec,
                                const Elf_Internal_Rela *relocs)
 {
-  const char *name;
   bfd *dynobj;
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
@@ -2789,8 +2788,6 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
   sym_hashes = elf_sym_hashes (abfd);
   extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info;
 
-  name = bfd_get_section_name (abfd, sec);
-
   if (dynobj == NULL)
     {
       sgot = NULL;
@@ -2829,7 +2826,7 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
         {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: Malformed reloc detected for section %s"), abfd, name);
+           (_("%B: Malformed reloc detected for section %A"), abfd, sec);
           bfd_set_error (bfd_error_bad_value);
           return FALSE;
         }
index 91b25d99bc0929f6ee3490862989c05aa10dd5f8..2698c10aa2589377ed740d1ccb150696d529d4fb 100644 (file)
@@ -2578,7 +2578,6 @@ s7_bfd_score_elf_check_relocs (bfd *abfd,
                                asection *sec,
                                const Elf_Internal_Rela *relocs)
 {
-  const char *name;
   bfd *dynobj;
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
@@ -2598,8 +2597,6 @@ s7_bfd_score_elf_check_relocs (bfd *abfd,
   sym_hashes = elf_sym_hashes (abfd);
   extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info;
 
-  name = bfd_get_section_name (abfd, sec);
-
   if (dynobj == NULL)
     {
       sgot = NULL;
@@ -2638,7 +2635,7 @@ s7_bfd_score_elf_check_relocs (bfd *abfd,
         {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: Malformed reloc detected for section %s"), abfd, name);
+           (_("%B: Malformed reloc detected for section %A"), abfd, sec);
           bfd_set_error (bfd_error_bad_value);
           return FALSE;
         }
index 47ca44d0b132adde69e4f6fe32c27f81fc17af0c..de7ce95d0349d8941453ef9bead2483b175a542f 100644 (file)
@@ -222,17 +222,16 @@ sh64_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
       if (bfd_get_arch_size (ibfd) == 32
          && bfd_get_arch_size (obfd) == 64)
        /* xgettext:c-format */
-       msg = _("%s: compiled as 32-bit object and %s is 64-bit");
+       msg = _("%B: compiled as 32-bit object and %B is 64-bit");
       else if (bfd_get_arch_size (ibfd) == 64
               && bfd_get_arch_size (obfd) == 32)
        /* xgettext:c-format */
-       msg = _("%s: compiled as 64-bit object and %s is 32-bit");
+       msg = _("%B: compiled as 64-bit object and %B is 32-bit");
       else
        /* xgettext:c-format */
-       msg = _("%s: object size does not match that of target %s");
+       msg = _("%B: object size does not match that of target %B");
 
-      _bfd_error_handler (msg, bfd_get_filename (ibfd),
-                         bfd_get_filename (obfd));
+      _bfd_error_handler (msg, ibfd, obfd);
       bfd_set_error (bfd_error_wrong_format);
       return FALSE;
     }
@@ -249,8 +248,9 @@ sh64_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
   else if ((new_flags & EF_SH_MACH_MASK) != EF_SH5)
     {
       _bfd_error_handler
-       ("%s: uses non-SH64 instructions while previous modules use SH64 instructions",
-        bfd_get_filename (ibfd));
+       ("%B: uses non-SH64 instructions while previous modules"
+        " use SH64 instructions",
+        ibfd);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
@@ -452,8 +452,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
        {
          /* Make sure we don't get confused on invalid input.  */
          _bfd_error_handler
-           (_("%s: encountered datalabel symbol in input"),
-            bfd_get_filename (abfd));
+           (_("%B: encountered datalabel symbol in input"), abfd);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
        }
@@ -548,8 +547,8 @@ shmedia_prepare_reloc (struct bfd_link_info *info, bfd *abfd,
            if ((insn & SHMEDIA_PTB_BIT) != 0)
              {
                _bfd_error_handler
-                 (_("%s: GAS error: unexpected PTB insn with R_SH_PT_16"),
-                  bfd_get_filename (input_section->owner));
+                 (_("%B: GAS error: unexpected PTB insn with R_SH_PT_16"),
+                  input_section->owner);
                return FALSE;
              }
 
@@ -674,8 +673,7 @@ sh64_elf_final_write_processing (bfd *abfd,
        {
          bfd_set_error (bfd_error_file_truncated);
          _bfd_error_handler
-           (_("%s: could not write out added .cranges entries"),
-            bfd_get_filename (abfd));
+           (_("%B: could not write out added .cranges entries"), abfd);
        }
     }
 
@@ -734,8 +732,7 @@ sh64_elf_final_write_processing (bfd *abfd,
            {
              bfd_set_error (bfd_error_file_truncated);
              _bfd_error_handler
-               (_("%s: could not write out sorted .cranges entries"),
-                bfd_get_filename (abfd));
+               (_("%B: could not write out sorted .cranges entries"), abfd);
            }
        }
     }
index e97d1d1aa6451fae129cb5a32365dc82e5ed119a..823ba982aa5cc22ec4c8d006799d223442c300fe 100644 (file)
@@ -3600,9 +3600,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: 0x%lx: warning: R_V850_LONGCALL points to "
+                   (_("%B: 0x%lx: warning: R_V850_LONGCALL points to "
                       "unrecognized insns"),
-                    bfd_get_filename (abfd), (unsigned long) irel->r_offset);
+                    abfd, (unsigned long) irel->r_offset);
                  continue;
                }
 
@@ -3610,9 +3610,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: 0x%lx: warning: R_V850_LONGCALL points to "
+                   (_("%B: 0x%lx: warning: R_V850_LONGCALL points to "
                       "unrecognized insn 0x%x"),
-                    bfd_get_filename (abfd),
+                    abfd,
                     (unsigned long) irel->r_offset + no_match,
                     insn[no_match]);
                  continue;
@@ -3655,9 +3655,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: 0x%lx: warning: R_V850_LONGCALL points to "
+                   (_("%B: 0x%lx: warning: R_V850_LONGCALL points to "
                       "unrecognized reloc"),
-                    bfd_get_filename (abfd), (unsigned long) irel->r_offset);
+                    abfd, (unsigned long) irel->r_offset);
 
                  continue;
                }
@@ -3695,9 +3695,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: 0x%lx: warning: R_V850_LONGCALL points to "
+                   (_("%B: 0x%lx: warning: R_V850_LONGCALL points to "
                       "unrecognized reloc 0x%lx"),
-                    bfd_get_filename (abfd), (unsigned long) irel->r_offset,
+                    abfd, (unsigned long) irel->r_offset,
                     irelcall->r_offset);
                  continue;
                }
@@ -3838,9 +3838,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: 0x%lx: warning: R_V850_LONGJUMP points to "
+                   (_("%B: 0x%lx: warning: R_V850_LONGJUMP points to "
                       "unrecognized insns"),
-                    bfd_get_filename (abfd), (unsigned long) irel->r_offset);
+                    abfd, (unsigned long) irel->r_offset);
                  continue;
                }
 
@@ -3848,9 +3848,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: 0x%lx: warning: R_V850_LONGJUMP points to "
+                   (_("%B: 0x%lx: warning: R_V850_LONGJUMP points to "
                       "unrecognized insn 0x%x"),
-                    bfd_get_filename (abfd),
+                    abfd,
                     (unsigned long) irel->r_offset + no_match,
                     insn[no_match]);
                  continue;
@@ -3882,9 +3882,9 @@ v850_elf_relax_section (bfd *abfd,
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: 0x%lx: warning: R_V850_LONGJUMP points to "
+                   (_("%B: 0x%lx: warning: R_V850_LONGJUMP points to "
                       "unrecognized reloc"),
-                    bfd_get_filename (abfd), (unsigned long) irel->r_offset);
+                    abfd, (unsigned long) irel->r_offset);
                  continue;
                }
 
index 41bd7724beb37521d9415b5065964b9502a66705..0e4d2e4d9d22709a9a5d96dd0f91f9a3ea15c21e 100644 (file)
@@ -632,10 +632,9 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
                  if (eh->got_addend != (bfd_vma) rel->r_addend)
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: warning: GOT addend of %ld to `%s' does"
+                     (_("%B: warning: GOT addend of %ld to `%s' does"
                         " not match previous GOT addend of %ld"),
-                        bfd_get_filename (abfd), rel->r_addend,
-                        h->root.root.string,
+                        abfd, rel->r_addend, h->root.root.string,
                         eh->got_addend);
 
                }
@@ -1509,10 +1508,9 @@ elf_vax_relocate_section (bfd *output_bfd,
          else if (rel->r_addend != 0)
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: warning: PLT addend of %d to `%s' from %s section ignored"),
-                     bfd_get_filename (input_bfd), rel->r_addend,
-                     h->root.root.string,
-                     bfd_get_section_name (input_bfd, input_section));
+             (_("%B: warning: PLT addend of %d to `%s'"
+                " from %A section ignored"),
+              input_bfd, rel->r_addend, h->root.root.string, input_section);
          rel->r_addend = 0;
 
          break;
@@ -1635,17 +1633,16 @@ elf_vax_relocate_section (bfd *output_bfd,
                  if (h != NULL)
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: warning: %s relocation against symbol `%s' from %s section"),
-                     bfd_get_filename (input_bfd), howto->name,
-                     h->root.root.string,
-                     bfd_get_section_name (input_bfd, input_section));
+                     (_("%B: warning: %s relocation against symbol `%s'"
+                        " from %A section"),
+                     input_bfd, howto->name, h->root.root.string,
+                     input_section);
                  else
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: warning: %s relocation to 0x%x from %s section"),
-                     bfd_get_filename (input_bfd), howto->name,
-                     outrel.r_addend,
-                     bfd_get_section_name (input_bfd, input_section));
+                     (_("%B: warning: %s relocation to 0x%x from %A section"),
+                     input_bfd, howto->name, outrel.r_addend,
+                     input_section);
                }
              loc = sreloc->contents;
              loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
index 2a2e93012f71da29ac7dfa6d799386e924f9af64..e92a99af417bf9ed611893624f5539f1e8f68f04 100644 (file)
@@ -814,10 +814,9 @@ visium_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
       if (mismatch)
        _bfd_error_handler
          /* xgettext:c-format */
-         (_("%s: compiled %s -mtune=%s and linked with modules"
+         (_("%B: compiled %s -mtune=%s and linked with modules"
             " compiled %s -mtune=%s"),
-          bfd_get_filename (ibfd), new_opt_with, opt_arch, old_opt_with,
-          opt_arch);
+          ibfd, new_opt_with, opt_arch, old_opt_with, opt_arch);
     }
 
   return TRUE;
index 7c4dfb36504b618fc8322ef2d1d76c23a14a9b0e..4d35a5dcc4b49572fb93fce65a5871be2af22bd8 100644 (file)
@@ -3279,9 +3279,8 @@ elf64_ia64_choose_gp (bfd *abfd, struct bfd_link_info *info, bfd_boolean final)
 overflow:
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
-            bfd_get_filename (abfd),
-            (unsigned long) (max_short_vma - min_short_vma));
+           (_("%B: short data segment overflowed (0x%lx >= 0x400000)"),
+            abfd, (unsigned long) (max_short_vma - min_short_vma));
          return FALSE;
        }
       else if ((gp_val > min_short_vma
@@ -3290,8 +3289,7 @@ overflow:
                   && max_short_vma - gp_val >= 0x200000))
        {
          _bfd_error_handler
-           (_("%s: __gp does not cover short data segment"),
-            bfd_get_filename (abfd));
+           (_("%B: __gp does not cover short data segment"), abfd);
          return FALSE;
        }
     }
index 91aa4c58836295688beab8108a420d50b580f7c3..2ebe0aa3b95460d845250c6cd8020e00cc661455 100644 (file)
@@ -1192,9 +1192,9 @@ mmix_elf_perform_relocation (asection *isec, reloc_howto_type *howto,
          {
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: Internal inconsistency error for value for\n\
+             (_("%B: Internal inconsistency error for value for\n\
  linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n"),
-              bfd_get_filename (isec->owner),
+              isec->owner,
               (unsigned long) (value >> 32), (unsigned long) value,
               (unsigned long) (gregdata->reloc_request[bpo_index].value
                                >> 32),
@@ -1615,15 +1615,15 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
          if (symname == NULL || *symname == 0)
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: base-plus-offset relocation against register symbol: (unknown) in %s"),
-              bfd_get_filename (input_section->owner),
-              bfd_get_section_name (symsec->owner, symsec));
+             (_("%B: base-plus-offset relocation against register symbol:"
+                " (unknown) in %A"),
+              input_section->owner, symsec);
          else
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: base-plus-offset relocation against register symbol: %s in %s"),
-              bfd_get_filename (input_section->owner), symname,
-              bfd_get_section_name (symsec->owner, symsec));
+             (_("%B: base-plus-offset relocation against register symbol:"
+                " %s in %A"),
+              input_section->owner, symname, symsec);
          return bfd_reloc_overflow;
        }
       goto do_mmix_reloc;
@@ -1666,15 +1666,15 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
          if (symname == NULL || *symname == 0)
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: register relocation against non-register symbol: (unknown) in %s"),
-              bfd_get_filename (input_section->owner),
-              bfd_get_section_name (symsec->owner, symsec));
+             (_("%B: register relocation against non-register symbol:"
+                " (unknown) in %A"),
+              input_section->owner, symsec);
          else
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: register relocation against non-register symbol: %s in %s"),
-              bfd_get_filename (input_section->owner), symname,
-              bfd_get_section_name (symsec->owner, symsec));
+             (_("%B: register relocation against non-register symbol:"
+                " %s in %A"),
+              input_section->owner, symname, symsec);
 
          /* The bfd_reloc_outofrange return value, though intuitively a
             better value, will not get us an error.  */
@@ -1709,8 +1709,8 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
                       MMIX_REG_SECTION_NAME) != 0)
        {
          _bfd_error_handler
-           (_("%s: directive LOCAL valid only with a register or absolute value"),
-            bfd_get_filename (input_section->owner));
+           (_("%B: directive LOCAL valid only with a register or absolute value"),
+            input_section->owner);
 
          return bfd_reloc_overflow;
        }
@@ -1740,8 +1740,9 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
            /* FIXME: Better error message.  */
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: LOCAL directive: Register $%ld is not a local register.  First global register is $%ld."),
-              bfd_get_filename (input_section->owner), (long) srel, (long) first_global);
+             (_("%B: LOCAL directive: Register $%ld is not a local register."
+                "  First global register is $%ld."),
+              input_section->owner, (long) srel, (long) first_global);
 
            return bfd_reloc_overflow;
          }
@@ -2198,9 +2199,9 @@ mmix_elf_add_symbol_hook (bfd *abfd,
             h->u.def.section->owner is NULL.  */
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: Error: multiple definition of `%s'; start of %s "
+           (_("%B: Error: multiple definition of `%s'; start of %s "
               "is set in a earlier linked file\n"),
-            bfd_get_filename (abfd), *namep,
+            abfd, *namep,
             *namep + strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX));
           bfd_set_error (bfd_error_bad_value);
           return FALSE;
index 5de67b211c8013f162bdff6d7c42020b6ad8d86d..e38333dd191d7f16337a268de4319bc900716832 100644 (file)
@@ -1677,8 +1677,9 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: error: unaligned relocation type %d at %08x reloc %08x\n"),
-            bfd_get_filename (input_bfd), (int)r_type, (unsigned)rel->r_offset, (unsigned)relocation);
+           (_("%B: error: unaligned relocation type %d at %08x reloc %08x\n"),
+            input_bfd, (int) r_type, (unsigned) rel->r_offset,
+            (unsigned) relocation);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
        }
@@ -2273,17 +2274,16 @@ sh_elf64_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
       if (bfd_get_arch_size (ibfd) == 32
          && bfd_get_arch_size (obfd) == 64)
        /* xgettext:c-format */
-       msg = _("%s: compiled as 32-bit object and %s is 64-bit");
+       msg = _("%B: compiled as 32-bit object and %B is 64-bit");
       else if (bfd_get_arch_size (ibfd) == 64
               && bfd_get_arch_size (obfd) == 32)
        /* xgettext:c-format */
-       msg = _("%s: compiled as 64-bit object and %s is 32-bit");
+       msg = _("%B: compiled as 64-bit object and %B is 32-bit");
       else
        /* xgettext:c-format */
-       msg = _("%s: object size does not match that of target %s");
+       msg = _("%B: object size does not match that of target %B");
 
-      _bfd_error_handler (msg, bfd_get_filename (ibfd),
-                         bfd_get_filename (obfd));
+      _bfd_error_handler (msg, ibfd, obfd);
       bfd_set_error (bfd_error_wrong_format);
       return FALSE;
     }
@@ -2302,8 +2302,7 @@ sh_elf64_merge_private_data (bfd *ibfd, struct bfd_link_info *info)
   else if ((new_flags & EF_SH_MACH_MASK) != EF_SH5)
     {
       _bfd_error_handler
-       ("%s: does not use the SH64 64-bit ABI as previous modules do",
-        bfd_get_filename (ibfd));
+       ("%B: does not use the SH64 64-bit ABI as previous modules do", ibfd);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
@@ -2774,8 +2773,7 @@ sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
        {
          /* Make sure we don't get confused on invalid input.  */
          _bfd_error_handler
-           (_("%s: encountered datalabel symbol in input"),
-            bfd_get_filename (abfd));
+           (_("%B: encountered datalabel symbol in input"), abfd);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
        }
index 5142273c05470d35046452f05d8675017b3cd200..ef097f739cddc7e06c3a0e3a6fb65b348e0a3603 100644 (file)
@@ -756,8 +756,9 @@ elf_object_p (bfd *abfd)
             So we are kind, and reset the string index value to 0
             so that at least some processing can be done.  */
          i_ehdrp->e_shstrndx = SHN_UNDEF;
-         _bfd_error_handler (_("warning: %s has a corrupt string table index - ignoring"),
-                             abfd->filename);
+         _bfd_error_handler
+           (_("warning: %B has a corrupt string table index - ignoring"),
+            abfd);
        }
     }
   else if (i_ehdrp->e_shstrndx != SHN_UNDEF)
@@ -1189,8 +1190,8 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic)
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: version count (%ld) does not match symbol count (%ld)"),
-            abfd->filename,
+           (_("%B: version count (%ld) does not match symbol count (%ld)"),
+            abfd,
             (long) (verhdr->sh_size / sizeof (Elf_External_Versym)),
             symcount);
 
@@ -1444,8 +1445,8 @@ elf_slurp_reloc_table_from_section (bfd *abfd,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s(%s): relocation %d has invalid symbol index %ld"),
-            abfd->filename, asect->name, i, ELF_R_SYM (rela.r_info));
+           (_("%B(%A): relocation %d has invalid symbol index %ld"),
+            abfd, asect, i, ELF_R_SYM (rela.r_info));
          relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
        }
       else
index 9976638d3e79cec790ad2b44d0843f0d3d027837..00f19e930dde1cd64cbce08de9207826af1d131a 100644 (file)
@@ -2849,7 +2849,7 @@ _bfd_aarch64_add_stub_entry_in_group (const char *stub_name,
   if (stub_entry == NULL)
     {
       /* xgettext:c-format */
-      _bfd_error_handler (_("%s: cannot create stub entry %s"),
+      _bfd_error_handler (_("%B: cannot create stub entry %s"),
                          section->owner, stub_name);
       return NULL;
     }
index 3c27f5de93d8ff073af253ada7296cb9db65d525..92ff8d727788511a0dbf68f16d8b537260aaa9e6 100644 (file)
@@ -3685,9 +3685,8 @@ elfNN_ia64_choose_gp (bfd *abfd, struct bfd_link_info *info, bfd_boolean final)
 overflow:
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
-            bfd_get_filename (abfd),
-            (unsigned long) (max_short_vma - min_short_vma));
+           (_("%B: short data segment overflowed (0x%lx >= 0x400000)"),
+            abfd, (unsigned long) (max_short_vma - min_short_vma));
          return FALSE;
        }
       else if ((gp_val > min_short_vma
@@ -3696,8 +3695,7 @@ overflow:
                   && max_short_vma - gp_val >= 0x200000))
        {
          _bfd_error_handler
-           (_("%s: __gp does not cover short data segment"),
-            bfd_get_filename (abfd));
+           (_("%B: __gp does not cover short data segment"), abfd);
          return FALSE;
        }
     }
index 4efa513dfef62416716879c3039357b07f2b3853..08151c133b905f422952c4a6cc98e48bc386759f 100644 (file)
@@ -14685,8 +14685,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%s: illegal section name `%s'"),
-                bfd_get_filename (abfd), o->name);
+               (_("%B: illegal section name `%A'"), abfd, o);
              bfd_set_error (bfd_error_nonrepresentable_section);
              return FALSE;
            }
index 11dc9d543c58e00a40de2237e1ae6ff8a2d12aaf..ae627c78646d8e7ca4eef128b6ae6e93fa68bb6f 100644 (file)
@@ -337,8 +337,10 @@ hpux_core_core_file_p (bfd *abfd)
      */
   if ((unknown_sections > 0) && (good_sections > 0))
     _bfd_error_handler
-      ("%s appears to be a core file,\nbut contains unknown sections.  It may have been created on an incompatible\nversion of HP-UX.  As a result, some information may be unavailable.\n",
-       abfd->filename);
+      ("%B appears to be a core file,\nbut contains unknown sections."
+       "  It may have been created on an incompatible\nversion of HP-UX."
+       "  As a result, some information may be unavailable.\n",
+       abfd);
 
   return abfd->xvec;
 
index aac86608d55d29d528833fb07f653292c7e4eba7..a2d38352db44a04c8c58afe2081aaf640c319d87 100644 (file)
@@ -156,8 +156,7 @@ ieee_write_id (bfd *abfd, const char *id)
     {
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: string too long (%d chars, max 65535)"),
-        bfd_get_filename (abfd), length);
+       (_("%B: string too long (%d chars, max 65535)"), abfd, length);
       bfd_set_error (bfd_error_invalid_operation);
       return FALSE;
     }
@@ -291,9 +290,8 @@ ieee_write_expression (bfd *abfd,
            {
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%s: unrecognized symbol `%s' flags 0x%x"),
-                bfd_get_filename (abfd), bfd_asymbol_name (symbol),
-                symbol->flags);
+               (_("%B: unrecognized symbol `%s' flags 0x%x"),
+                abfd, bfd_asymbol_name (symbol), symbol->flags);
              bfd_set_error (bfd_error_invalid_operation);
              return FALSE;
            }
index fd3da3972ab242de2ce74cfb2f6d6aece6f3ef4e..6dda98fd2994cfba36a6c0daddc5a92ee6713e88 100644 (file)
@@ -830,8 +830,8 @@ ihex_write_object_contents (bfd *abfd)
                      sprintf_vma (buf, where);
                      _bfd_error_handler
                        /* xgettext:c-format */
-                       (_("%s: address 0x%s out of range for Intel Hex file"),
-                        bfd_get_filename (abfd), buf);
+                       (_("%B: address 0x%s out of range for Intel Hex file"),
+                        abfd, buf);
                      bfd_set_error (bfd_error_bad_value);
                      return FALSE;
                    }
index 12c9fb0d870d451399c803bc4aa2721f38b645b5..2f56b465cb3982c4dfdefac038a0372c3c60867f 100644 (file)
@@ -1405,8 +1405,7 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
       if (!bfd_link_relocatable (info)
          && strcmp (name, "__gnu_lto_slim") == 0)
        _bfd_error_handler
-         (_("%s: plugin needed to handle lto object"),
-          bfd_get_filename (abfd));
+         (_("%B: plugin needed to handle lto object"), abfd);
     }
   else
     row = DEF_ROW;
index 3cddeff51ee5a1a19bdd5275afac3cf02f618e57..553de8eae5e2faaf869501e94caf4a033ecc663b 100644 (file)
@@ -861,8 +861,8 @@ _bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec,
       if (offset > sec->rawsize)
        _bfd_error_handler
          /* xgettext:c-format */
-         (_("%s: access beyond end of merged section (%ld)"),
-          bfd_get_filename (sec->owner), (long) offset);
+         (_("%B: access beyond end of merged section (%ld)"),
+          sec->owner, (long) offset);
       return secinfo->first_str ? sec->size : 0;
     }
 
index 3e436a51b4175b8d8e3a4e46654eac44e27b9b3b..6b2772b4ea7d741c5aeb476265b2e5aaf06b63d4 100644 (file)
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -465,8 +465,8 @@ mmo_make_section (bfd *abfd, const char *secname)
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: No core to allocate section name %s\n"),
-            bfd_get_filename (abfd), secname);
+           (_("%B: No core to allocate section name %s\n"),
+            abfd, secname);
          bfd_set_error (bfd_error_system_call);
          return NULL;
        }
@@ -541,8 +541,8 @@ mmo_object_p (bfd *abfd)
     {
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: No core to allocate a symbol %d bytes long\n"),
-        bfd_get_filename (abfd), abfd->tdata.mmo_data->max_symbol_length);
+       (_("%B: No core to allocate a symbol %d bytes long\n"),
+        abfd, abfd->tdata.mmo_data->max_symbol_length);
       goto bad_final;
     }
 
@@ -955,8 +955,9 @@ mmo_write_loc_chunk (bfd *abfd, bfd_vma vma, const bfd_byte *loc,
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: attempt to emit contents at non-multiple-of-4 address 0x%lx\n"),
-            bfd_get_filename (abfd), (unsigned long) vma);
+           (_("%B: attempt to emit contents at non-multiple-of-4"
+              " address 0x%lx\n"),
+            abfd, (unsigned long) vma);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
        }
@@ -1251,8 +1252,9 @@ mmo_create_symbol (bfd *abfd, const char *symname, bfd_vma addr, enum
       && !mmo_ignore_symbol_consistency (abfd))
     {
       _bfd_error_handler
-       (_("%s: invalid mmo file: initialization value for $255 is not `Main'\n"),
-        bfd_get_filename (abfd));
+       (_("%B: invalid mmo file: initialization value for $255"
+          " is not `Main'\n"),
+        abfd);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
@@ -1397,10 +1399,9 @@ SUBSECTION
 
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%s: unsupported wide character sequence"
+               (_("%B: unsupported wide character sequence"
                   " 0x%02X 0x%02X after symbol name starting with `%s'\n"),
-                bfd_get_filename (abfd), c, c2,
-                abfd->tdata.mmo_data->lop_stab_symbol);
+                abfd, c, c2, abfd->tdata.mmo_data->lop_stab_symbol);
              bfd_set_error (bfd_error_bad_value);
              abfd->tdata.mmo_data->have_error = TRUE;
              return FALSE;
@@ -1632,8 +1633,8 @@ mmo_scan (bfd *abfd)
            default:
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%s: invalid mmo file: unsupported lopcode `%d'\n"),
-                bfd_get_filename (abfd), buf[1]);
+               (_("%B: invalid mmo file: unsupported lopcode `%d'\n"),
+                abfd, buf[1]);
              bfd_set_error (bfd_error_bad_value);
              goto error_return;
 
@@ -1643,8 +1644,9 @@ mmo_scan (bfd *abfd)
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n"),
-                    bfd_get_filename (abfd), y*256+z);
+                   (_("%B: invalid mmo file: expected YZ = 1"
+                      " got YZ = %d for lop_quote\n"),
+                    abfd, y*256+z);
                  bfd_set_error (bfd_error_bad_value);
                  goto error_return;
                }
@@ -1680,8 +1682,9 @@ mmo_scan (bfd *abfd)
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n"),
-                    bfd_get_filename (abfd), z);
+                   (_("%B: invalid mmo file: expected z = 1 or z = 2,"
+                      " got z = %d for lop_loc\n"),
+                    abfd, z);
                  bfd_set_error (bfd_error_bad_value);
                  goto error_return;
                }
@@ -1730,8 +1733,9 @@ mmo_scan (bfd *abfd)
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n"),
-                      bfd_get_filename (abfd), z);
+                     (_("%B: invalid mmo file: expected z = 1 or z = 2,"
+                        " got z = %d for lop_fixo\n"),
+                      abfd, z);
                    bfd_set_error (bfd_error_bad_value);
                    goto error_return;
                  }
@@ -1770,8 +1774,9 @@ mmo_scan (bfd *abfd)
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n"),
-                      bfd_get_filename (abfd), y);
+                     (_("%B: invalid mmo file: expected y = 0,"
+                        " got y = %d for lop_fixrx\n"),
+                      abfd, y);
                    bfd_set_error (bfd_error_bad_value);
                    goto error_return;
                  }
@@ -1780,8 +1785,9 @@ mmo_scan (bfd *abfd)
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n"),
-                      bfd_get_filename (abfd), z);
+                     (_("%B: invalid mmo file: expected z = 16 or z = 24,"
+                        " got z = %d for lop_fixrx\n"),
+                      abfd, z);
                    bfd_set_error (bfd_error_bad_value);
                    goto error_return;
                  }
@@ -1804,8 +1810,9 @@ mmo_scan (bfd *abfd)
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n"),
-                      bfd_get_filename (abfd), buf[0]);
+                     (_("%B: invalid mmo file: leading byte of operand word"
+                        " must be 0 or 1, got %d for lop_fixrx\n"),
+                      abfd, buf[0]);
                    bfd_set_error (bfd_error_bad_value);
                    goto error_return;
                  }
@@ -1828,8 +1835,9 @@ mmo_scan (bfd *abfd)
                    {
                      _bfd_error_handler
                        /* xgettext:c-format */
-                       (_("%s: cannot allocate file name for file number %d, %d bytes\n"),
-                        bfd_get_filename (abfd), y, z * 4 + 1);
+                       (_("%B: cannot allocate file name for file number %d,"
+                          " %d bytes\n"),
+                        abfd, y, z * 4 + 1);
                      bfd_set_error (bfd_error_system_call);
                      goto error_return;
                    }
@@ -1849,9 +1857,9 @@ mmo_scan (bfd *abfd)
                    {
                      _bfd_error_handler
                        /* xgettext:c-format */
-                       (_("%s: invalid mmo file: file number %d `%s',"
+                       (_("%B: invalid mmo file: file number %d `%s',"
                           " was already entered as `%s'\n"),
-                        bfd_get_filename (abfd), y, fname, file_names[y]);
+                        abfd, y, fname, file_names[y]);
                      bfd_set_error (bfd_error_bad_value);
                      goto error_return;
                    }
@@ -1863,9 +1871,9 @@ mmo_scan (bfd *abfd)
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: invalid mmo file: file name for number %d"
+                   (_("%B: invalid mmo file: file name for number %d"
                       " was not specified before use\n"),
-                    bfd_get_filename (abfd), y);
+                    abfd, y);
                  bfd_set_error (bfd_error_bad_value);
                  goto error_return;
                }
@@ -1970,9 +1978,9 @@ mmo_scan (bfd *abfd)
                {
                  _bfd_error_handler
                    /* xgettext:c-format */
-                   (_("%s: invalid mmo file: fields y and z of lop_stab"
+                   (_("%B: invalid mmo file: fields y and z of lop_stab"
                       " non-zero, y: %d, z: %d\n"),
-                    bfd_get_filename (abfd), y, z);
+                    abfd, y, z);
                  bfd_set_error (bfd_error_bad_value);
                  goto error_return;
                }
@@ -2007,9 +2015,9 @@ mmo_scan (bfd *abfd)
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: invalid mmo file: lop_end not last item in"
+                     (_("%B: invalid mmo file: lop_end not last item in"
                         " file\n"),
-                      bfd_get_filename (abfd));
+                      abfd);
                    bfd_set_error (bfd_error_bad_value);
                    goto error_return;
                  }
@@ -2021,10 +2029,10 @@ mmo_scan (bfd *abfd)
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
-                     (_("%s: invalid mmo file: YZ of lop_end (%ld)"
+                     (_("%B: invalid mmo file: YZ of lop_end (%ld)"
                         " not equal to the number of tetras to the preceding"
                         " lop_stab (%ld)\n"),
-                      bfd_get_filename (abfd), (long) (y * 256 + z),
+                      abfd, (long) (y * 256 + z),
                       (curpos - stab_loc - 4)/4);
                    bfd_set_error (bfd_error_bad_value);
                    goto error_return;
@@ -2732,8 +2740,8 @@ mmo_internal_add_3_sym (bfd *abfd, struct mmo_symbol_trie *rootp,
     {
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: invalid symbol table: duplicate symbol `%s'\n"),
-        bfd_get_filename (abfd), trie->sym.name);
+       (_("%B: invalid symbol table: duplicate symbol `%s'\n"),
+        abfd, trie->sym.name);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
@@ -2975,9 +2983,9 @@ mmo_write_symbols_and_terminator (bfd *abfd)
 
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: Bad symbol definition: `Main' set to %s rather"
+             (_("%B: Bad symbol definition: `Main' set to %s rather"
                 " than the start address %s\n"),
-              bfd_get_filename (abfd), vmas_main, vmas_start);
+              abfd, vmas_main, vmas_start);
            bfd_set_error (bfd_error_bad_value);
            return FALSE;
          }
@@ -3074,9 +3082,9 @@ mmo_write_symbols_and_terminator (bfd *abfd)
 
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: warning: symbol table too large for mmo, larger than 65535"
+       (_("%B: warning: symbol table too large for mmo, larger than 65535"
           " 32-bit words: %d.  Only `Main' will be emitted.\n"),
-        bfd_get_filename (abfd), trie_len);
+        abfd, trie_len);
 
       memset (&sym, 0, sizeof (sym));
       sym.sym_type = mmo_abs_sym;
@@ -3120,9 +3128,9 @@ mmo_write_symbols_and_terminator (bfd *abfd)
         diagnostic and fail "normally".  */
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: internal error, symbol table changed size from %d to %d"
+       (_("%B: internal error, symbol table changed size from %d to %d"
           " words\n"),
-        bfd_get_filename (abfd), trie_len,
+        abfd, trie_len,
         (abfd->tdata.mmo_data->byte_no + 3)/4);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
@@ -3173,9 +3181,9 @@ mmo_write_section_unless_reg_contents (bfd *abfd, asection *sec, void *p)
             this.  */
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: internal error, internal register section %s had"
+           (_("%B: internal error, internal register section %A had"
               " contents\n"),
-            bfd_get_filename (abfd), sec->name);
+            abfd, sec);
          bfd_set_error (bfd_error_bad_value);
          infop->retval = FALSE;
          return;
@@ -3224,23 +3232,21 @@ mmo_write_object_contents (bfd *abfd)
          if (sec->size == 0)
            /* There must always be at least one such register.  */
            _bfd_error_handler
-             (_("%s: no initialized registers; section length 0\n"),
-              bfd_get_filename (abfd));
+             (_("%B: no initialized registers; section length 0\n"),
+              abfd);
          else if (sec->vma > (256 - 32) * 8)
            /* Provide better error message for the case of too many
               global registers.  */
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: too many initialized registers; section length %ld\n"),
-              bfd_get_filename (abfd),
-              (long) sec->size);
+             (_("%B: too many initialized registers; section length %ld\n"),
+              abfd, (long) sec->size);
          else
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%s: invalid start address for initialized registers of"
+             (_("%B: invalid start address for initialized registers of"
                 " length %ld: 0x%lx%08lx\n"),
-              bfd_get_filename (abfd),
-              (long) sec->size,
+              abfd, (long) sec->size,
               (unsigned long) (sec->vma >> 32), (unsigned long) (sec->vma));
 
          return FALSE;
index 04796797a2a40364a526bad8ffc44135d55d6bce..06491aaeb77a1f1726b2c5e93e031719d775e687 100644 (file)
@@ -878,8 +878,7 @@ oasys_write_sections (bfd *abfd)
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%s: can not represent section `%s' in oasys"),
-            bfd_get_filename (abfd), s->name);
+           (_("%B: can not represent section `%A' in oasys"), abfd, s);
          bfd_set_error (bfd_error_nonrepresentable_section);
          return FALSE;
        }
index 168dde0ba297ac971c1707a919d5d9bafd782ea8..3f3eb6856ffe2247f14311e0d205b066c706be3c 100644 (file)
@@ -1149,8 +1149,8 @@ NAME (aout, set_section_contents) (bfd *abfd,
     {
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%s: can not represent section `%s' in a.out object file format"),
-        bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
+       (_("%B: can not represent section `%A' in a.out object file format"),
+        abfd, section);
       bfd_set_error (bfd_error_nonrepresentable_section);
       return FALSE;
     }
@@ -3705,9 +3705,8 @@ NAME (aout, final_link) (bfd *abfd,
                 by the reloc size.  */
              _bfd_error_handler
                /* xgettext:c-format */
-               (_("%s: relocatable link from %s to %s not supported"),
-                bfd_get_filename (abfd),
-                sub->xvec->name, abfd->xvec->name);
+               (_("%B: relocatable link from %s to %s not supported"),
+                abfd, sub->xvec->name, abfd->xvec->name);
              bfd_set_error (bfd_error_invalid_operation);
              goto error_return;
            }
index eb9c879492491b274985072712e27e3385b061c0..38571cc1051d8a46f61684e5f452994cadc1fb18 100644 (file)
@@ -1086,9 +1086,8 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out)
       else
        {
          /* xgettext:c-format */
-         _bfd_error_handler (_("%s: line number overflow: 0x%lx > 0xffff"),
-                             bfd_get_filename (abfd),
-                             scnhdr_int->s_nlnno);
+         _bfd_error_handler (_("%B: line number overflow: 0x%lx > 0xffff"),
+                             abfd, scnhdr_int->s_nlnno);
          bfd_set_error (bfd_error_file_truncated);
          H_PUT_16 (abfd, 0xffff, scnhdr_ext->s_nlnno);
          ret = 0;
@@ -4220,16 +4219,16 @@ rsrc_process_section (bfd * abfd,
       if (data > dataend)
        {
          /* Corrupted .rsrc section - cannot merge.  */
-         _bfd_error_handler (_("%s: .rsrc merge failure: corrupt .rsrc section"),
-                             bfd_get_filename (abfd));
+         _bfd_error_handler (_("%B: .rsrc merge failure: corrupt .rsrc section"),
+                             abfd);
          bfd_set_error (bfd_error_file_truncated);
          goto end;
        }
 
       if ((data - p) > rsrc_sizes [num_resource_sets])
        {
-         _bfd_error_handler (_("%s: .rsrc merge failure: unexpected .rsrc size"),
-                             bfd_get_filename (abfd));
+         _bfd_error_handler (_("%B: .rsrc merge failure: unexpected .rsrc size"),
+                             abfd);
          bfd_set_error (bfd_error_file_truncated);
          goto end;
        }
index 6951e671e5a7b1b8698d9d5f14e20aed68267ee8..00cc3c0a891bcd92ed3fad079f70e9cc4f78c446 100644 (file)
@@ -468,8 +468,7 @@ rs6000coff_core_p (bfd *abfd)
 
   /* Issue warning if the core file was truncated during writing.  */
   if (c_flag & CORE_TRUNC)
-    _bfd_error_handler (_("%s: warning core file truncated"),
-                       bfd_get_filename (abfd));
+    _bfd_error_handler (_("%B: warning core file truncated"), abfd);
 
   /* Allocate core file header.  */
 #ifndef BFD64
index fcfc243660969a2b40763641cf07145df28f2485..4a9881be552f064cade5776176fd2f647d72b973 100644 (file)
@@ -3672,7 +3672,7 @@ _bfd_vms_write_etir (bfd * abfd, int objtype ATTRIBUTE_UNUSED)
 
          if (section->reloc_count == 0)
            _bfd_error_handler
-             (_("SEC_RELOC with no relocs in section %s"), section->name);
+             (_("SEC_RELOC with no relocs in section %A"), section);
 
 #if VMS_DEBUG
          else
@@ -3724,8 +3724,8 @@ _bfd_vms_write_etir (bfd * abfd, int objtype ATTRIBUTE_UNUSED)
 
                  /* Regular relocs are intertwined with binary data.  */
                  if (curr_addr > addr)
-                   _bfd_error_handler (_("Size error in section %s"),
-                                       section->name);
+                   _bfd_error_handler (_("Size error in section %A"),
+                                       section);
                  size = addr - curr_addr;
                  sto_imm (abfd, section, size, curr_data, curr_addr);
                  curr_data += size;
@@ -3937,8 +3937,7 @@ _bfd_vms_write_etir (bfd * abfd, int objtype ATTRIBUTE_UNUSED)
            {
              /* Output rest of section.  */
              if (curr_addr > section->size)
-               _bfd_error_handler (_("Size error in section %s"),
-                                   section->name);
+               _bfd_error_handler (_("Size error in section %A"), section);
              size = section->size - curr_addr;
              sto_imm (abfd, section, size, curr_data, curr_addr);
              curr_data += size;
index 9944f23e1c6e81a09f704c8182b47cad00c16c0a..8121c7e2ef279be8362ea84cf3fe91124135b795 100644 (file)
@@ -829,8 +829,8 @@ xcoff_link_add_dynamic_symbols (bfd *abfd, struct bfd_link_info *info)
    if (info->output_bfd->xvec != abfd->xvec)
     {
       _bfd_error_handler
-       (_("%s: XCOFF shared object when not producing XCOFF output"),
-        bfd_get_filename (abfd));
+       (_("%B: XCOFF shared object when not producing XCOFF output"),
+        abfd);
       bfd_set_error (bfd_error_invalid_operation);
       return FALSE;
     }
@@ -850,8 +850,8 @@ xcoff_link_add_dynamic_symbols (bfd *abfd, struct bfd_link_info *info)
   if (lsec == NULL)
     {
       _bfd_error_handler
-       (_("%s: dynamic object with no .loader section"),
-        bfd_get_filename (abfd));
+       (_("%B: dynamic object with no .loader section"),
+        abfd);
       bfd_set_error (bfd_error_no_symbols);
       return FALSE;
     }