From 871b3ab29e87cf0de15f7e49ad19acc4f7f6f84c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 19 Feb 2018 15:21:40 +1030 Subject: Use %pA and %pB in messages rather than %A and %B First step towards compiler verification of _bfd_error_handler arguments, and better verification of translated messages. bfd/ * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place of %A and %B. * aout-adobe.c: Update all messages using %A and %B. * aout-cris.c: Likewise. * aoutx.h: Likewise. * archive.c: Likewise. * binary.c: Likewise. * cache.c: Likewise. * coff-alpha.c: Likewise. * coff-arm.c: Likewise. * coff-i860.c: Likewise. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic4x.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * coffswap.h: Likewise. * compress.c: Likewise. * cpu-arm.c: Likewise. * ecoff.c: Likewise. * elf-attrs.c: Likewise. * elf-eh-frame.c: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-properties.c: Likewise. * elf-s390-common.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-avr.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-d10v.c: Likewise. * elf32-d30v.c: Likewise. * elf32-epiphany.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-gen.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-i960.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc12.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-mep.c: Likewise. * elf32-metag.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-moxie.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-or1k.c: Likewise. * elf32-pj.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-sparc.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf32-wasm32.c: Likewise. * elf32-xgate.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-gen.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfnn-riscv.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * elfxx-x86.c: Likewise. * hpux-core.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * libbfd.c: Likewise. * linker.c: Likewise. * mach-o.c: Likewise. * merge.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * peXXigen.c: Likewise. * peicode.h: Likewise. * reloc.c: Likewise. * rs6000-core.c: Likewise. * srec.c: Likewise. * stabs.c: Likewise. * vms-alpha.c: Likewise. * xcofflink.c: Likewise. ld/ * ldmisc.c (vfinfo): Handle %pA and %pB in place of %A and %B. * ldcref.c: Update all messages using %A and %B. * ldexp.c: Likewise. * ldlang.c: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * pe-dll.c: Likewise. * plugin.c: Likewise. * emultempl/beos.em: Likewise. * emultempl/cr16elf.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/xtensaelf.em: Likewise. --- ld/ldmain.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'ld/ldmain.c') diff --git a/ld/ldmain.c b/ld/ldmain.c index c473ed2..d23c6d1 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -481,7 +481,7 @@ main (int argc, char **argv) else { if (!bfd_close (link_info.output_bfd)) - einfo (_("%F%B: final close failed: %E\n"), link_info.output_bfd); + einfo (_("%F%pB: final close failed: %E\n"), link_info.output_bfd); /* If the --force-exe-suffix is enabled, and we're making an executable file and it doesn't end in .exe, copy it to one @@ -904,7 +904,7 @@ add_archive_element (struct bfd_link_info *info, } if (from != NULL) - minfo ("%B ", from); + minfo ("%pB ", from); if (h != NULL) minfo ("(%T)\n", h->root.string); else @@ -1038,43 +1038,43 @@ multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED, || ntype == bfd_link_hash_indirect) { ASSERT (otype == bfd_link_hash_common); - einfo (_("%B: warning: definition of `%T' overriding common\n"), + einfo (_("%pB: warning: definition of `%T' overriding common\n"), nbfd, name); if (obfd != NULL) - einfo (_("%B: warning: common is here\n"), obfd); + einfo (_("%pB: warning: common is here\n"), obfd); } else if (otype == bfd_link_hash_defined || otype == bfd_link_hash_defweak || otype == bfd_link_hash_indirect) { ASSERT (ntype == bfd_link_hash_common); - einfo (_("%B: warning: common of `%T' overridden by definition\n"), + einfo (_("%pB: warning: common of `%T' overridden by definition\n"), nbfd, name); if (obfd != NULL) - einfo (_("%B: warning: defined here\n"), obfd); + einfo (_("%pB: warning: defined here\n"), obfd); } else { ASSERT (otype == bfd_link_hash_common && ntype == bfd_link_hash_common); if (osize > nsize) { - einfo (_("%B: warning: common of `%T' overridden by larger common\n"), + einfo (_("%pB: warning: common of `%T' overridden by larger common\n"), nbfd, name); if (obfd != NULL) - einfo (_("%B: warning: larger common is here\n"), obfd); + einfo (_("%pB: warning: larger common is here\n"), obfd); } else if (nsize > osize) { - einfo (_("%B: warning: common of `%T' overriding smaller common\n"), + einfo (_("%pB: warning: common of `%T' overriding smaller common\n"), nbfd, name); if (obfd != NULL) - einfo (_("%B: warning: smaller common is here\n"), obfd); + einfo (_("%pB: warning: smaller common is here\n"), obfd); } else { - einfo (_("%B: warning: multiple common of `%T'\n"), nbfd, name); + einfo (_("%pB: warning: multiple common of `%T'\n"), nbfd, name); if (obfd != NULL) - einfo (_("%B: warning: previous common is here\n"), obfd); + einfo (_("%pB: warning: previous common is here\n"), obfd); } } } @@ -1183,7 +1183,7 @@ symbol_warning (const char *warning, const char *symbol, bfd *abfd) struct warning_callback_info cinfo; if (!bfd_generic_link_read_symbols (abfd)) - einfo (_("%B%F: could not read symbols: %E\n"), abfd); + einfo (_("%pB%F: could not read symbols: %E\n"), abfd); cinfo.found = FALSE; cinfo.warning = warning; @@ -1214,7 +1214,7 @@ warning_callback (struct bfd_link_info *info ATTRIBUTE_UNUSED, else if (abfd == NULL) einfo ("%P: %s%s\n", _("warning: "), warning); else if (symbol == NULL) - einfo ("%B: %s%s\n", abfd, _("warning: "), warning); + einfo ("%pB: %s%s\n", abfd, _("warning: "), warning); else if (!symbol_warning (warning, symbol, abfd)) { bfd *b; @@ -1222,7 +1222,7 @@ warning_callback (struct bfd_link_info *info ATTRIBUTE_UNUSED, for (b = info->input_bfds; b; b = b->link.next) if (b != abfd && symbol_warning (warning, symbol, b)) return; - einfo ("%B: %s%s\n", abfd, _("warning: "), warning); + einfo ("%pB: %s%s\n", abfd, _("warning: "), warning); } } @@ -1245,14 +1245,14 @@ warning_find_reloc (bfd *abfd, asection *sec, void *iarg) relsize = bfd_get_reloc_upper_bound (abfd, sec); if (relsize < 0) - einfo (_("%B%F: could not read relocs: %E\n"), abfd); + einfo (_("%pB%F: could not read relocs: %E\n"), abfd); if (relsize == 0) return; relpp = (arelent **) xmalloc (relsize); relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols); if (relcount < 0) - einfo (_("%B%F: could not read relocs: %E\n"), abfd); + einfo (_("%pB%F: could not read relocs: %E\n"), abfd); p = relpp; pend = p + relcount; @@ -1341,19 +1341,19 @@ undefined_symbol (struct bfd_link_info *info, if (error_count < MAX_ERRORS_IN_A_ROW) { if (error) - einfo (_("%X%B: undefined reference to `%T'\n"), + einfo (_("%X%pB: undefined reference to `%T'\n"), abfd, name); else - einfo (_("%B: warning: undefined reference to `%T'\n"), + einfo (_("%pB: warning: undefined reference to `%T'\n"), abfd, name); } else if (error_count == MAX_ERRORS_IN_A_ROW) { if (error) - einfo (_("%X%B: more undefined references to `%T' follow\n"), + einfo (_("%X%pB: more undefined references to `%T' follow\n"), abfd, name); else - einfo (_("%B: warning: more undefined references to `%T' follow\n"), + einfo (_("%pB: warning: more undefined references to `%T' follow\n"), abfd, name); } else if (error) @@ -1410,7 +1410,7 @@ reloc_overflow (struct bfd_link_info *info, case bfd_link_hash_defined: case bfd_link_hash_defweak: einfo (_(" relocation truncated to fit: " - "%s against symbol `%T' defined in %A section in %B"), + "%s against symbol `%T' defined in %pA section in %pB"), reloc_name, entry->root.string, entry->u.def.section, entry->u.def.section == bfd_abs_section_ptr @@ -1486,9 +1486,9 @@ notice (struct bfd_link_info *info, && bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL) { if (bfd_is_und_section (section)) - einfo (_("%B: reference to %s\n"), abfd, name); + einfo (_("%pB: reference to %s\n"), abfd, name); else - einfo (_("%B: definition of %s\n"), abfd, name); + einfo (_("%pB: definition of %s\n"), abfd, name); } if (command_line.cref || nocrossref_list != NULL) -- cgit v1.1