Use %pI, %pR, %pS, %pT in place of %I, %R, %S and %T.

bfd/
	* elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c,
	* elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c,
	* elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c,
	* elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c,
	* elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c,
	* reloc.c: Replace use of %R and %T in format strings passed to
	einfo and friends by %pR and %pT.
ld/
	* ldmisc.c (vfinfo) Handle %pI, %pR, %pS and %pT in place of
	%I, %R, %S and %T.
	* ldcref.c, * ldctor.c, * ldemul.c, * ldexp.c, * ldgram.y,
	* ldlang.c, * ldlex.l, * ldmain.c, * ldmisc.c, * pe-dll.c,
	* emultempl/sh64elf.em: Replace use of of %I, %R, %S and %T in
	format strings passed to einfo and friends by %pI, %pR, %pS and %pT.
This commit is contained in:
Alan Modra 2018-02-19 18:30:41 +10:30
parent 871b3ab29e
commit c1c8c1ef9a
34 changed files with 204 additions and 189 deletions

View File

@ -1,3 +1,13 @@
2018-02-19 Alan Modra <amodra@gmail.com>
* elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c,
* elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c,
* elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c,
* elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c,
* elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c,
* reloc.c: Replace use of %R and %T in format strings passed to
einfo and friends by %pR and %pT.
2018-02-19 Alan Modra <amodra@gmail.com>
* bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place

View File

@ -15633,7 +15633,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -2079,7 +2079,7 @@ maybe_set_textrel (struct elf_link_hash_entry *eh, void *inf)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, eh->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -1986,7 +1986,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -2094,7 +2094,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -2789,7 +2789,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -3841,7 +3841,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */
@ -12827,7 +12827,7 @@ nds32_elf_get_relocated_section_contents (bfd *abfd,
message instead. */
link_info->callbacks->einfo
/* xgettext:c-format */
(_("%X%P: %pB(%pA): relocation \"%R\" goes out of range\n"),
(_("%X%P: %pB(%pA): relocation \"%pR\" goes out of range\n"),
abfd, input_section, * parent);
goto error_return;

View File

@ -2278,7 +2278,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -6163,7 +6163,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -1848,7 +1848,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -3286,7 +3286,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -3202,7 +3202,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -2234,7 +2234,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -7262,7 +7262,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
sections. Allow them to proceed, but warn that this might
break at runtime. */
info->callbacks->einfo
(_("%P: copy reloc against `%T' requires lazy plt linking; "
(_("%P: copy reloc against `%pT' requires lazy plt linking; "
"avoid setting LD_BIND_NOW=1 or upgrade gcc\n"),
h->root.root.string);
}
@ -9933,7 +9933,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *inf)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */
@ -10780,7 +10780,7 @@ get_r2off (struct bfd_link_info *info,
if (strcmp (opd->name, ".opd") != 0
|| opd->reloc_count != 0)
{
info->callbacks->einfo (_("%P: cannot find opd entry toc for `%T'\n"),
info->callbacks->einfo (_("%P: cannot find opd entry toc for `%pT'\n"),
stub_entry->h->elf.root.root.string);
bfd_set_error (bfd_error_bad_value);
return (bfd_vma) -1;
@ -10991,7 +10991,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
if (off + 0x80008000 > 0xffffffff || (off & 7) != 0)
{
info->callbacks->einfo
(_("%P: linkage table error against `%T'\n"),
(_("%P: linkage table error against `%pT'\n"),
stub_entry->root.string);
bfd_set_error (bfd_error_bad_value);
htab->stub_error = TRUE;
@ -11137,7 +11137,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
{
info->callbacks->einfo
/* xgettext:c-format */
(_("%P: linkage table error against `%T'\n"),
(_("%P: linkage table error against `%pT'\n"),
stub_entry->h != NULL
? stub_entry->h->elf.root.root.string
: "<local sym>");
@ -13006,7 +13006,7 @@ build_global_entry_stubs (struct elf_link_hash_entry *h, void *inf)
if (off + 0x80008000 > 0xffffffff || (off & 3) != 0)
{
info->callbacks->einfo
(_("%P: linkage table error against `%T'\n"),
(_("%P: linkage table error against `%pT'\n"),
h->root.root.string);
bfd_set_error (bfd_error_bad_value);
htab->stub_error = TRUE;
@ -13608,9 +13608,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
info->callbacks->einfo
(!IS_PPC64_TLS_RELOC (r_type)
/* xgettext:c-format */
? _("%H: %s used with TLS symbol `%T'\n")
? _("%H: %s used with TLS symbol `%pT'\n")
/* xgettext:c-format */
: _("%H: %s used with non-TLS symbol `%T'\n"),
: _("%H: %s used with non-TLS symbol `%pT'\n"),
input_bfd, input_section, rel->r_offset,
ppc64_elf_howto_table[r_type]->name,
sym_name);
@ -14220,13 +14220,13 @@ ppc64_elf_relocate_section (bfd *output_bfd,
|| stub_entry->stub_type == ppc_stub_plt_call_r2save)
info->callbacks->einfo
/* xgettext:c-format */
(_("%H: call to `%T' lacks nop, can't restore toc; "
(_("%H: call to `%pT' lacks nop, can't restore toc; "
"recompile with -fPIC\n"),
input_bfd, input_section, rel->r_offset, sym_name);
else
info->callbacks->einfo
/* xgettext:c-format */
(_("%H: call to `%T' lacks nop, can't restore toc; "
(_("%H: call to `%pT' lacks nop, can't restore toc; "
"(-mcmodel=small toc adjust stub)\n"),
input_bfd, input_section, rel->r_offset, sym_name);
@ -14354,7 +14354,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
default:
info->callbacks->einfo
/* xgettext:c-format */
(_("%P: %pB: unknown relocation type %d for `%T'\n"),
(_("%P: %pB: unknown relocation type %d for `%pT'\n"),
input_bfd, (int) r_type, sym_name);
bfd_set_error (bfd_error_bad_value);
@ -14904,7 +14904,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
info->callbacks->einfo
/* xgettext:c-format */
(_("%H: %s for indirect "
"function `%T' unsupported\n"),
"function `%pT' unsupported\n"),
input_bfd, input_section, rel->r_offset,
ppc64_elf_howto_table[r_type]->name,
sym_name);
@ -15015,7 +15015,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
info->callbacks->einfo
/* xgettext:c-format */
(_("%P: %pB: %s is not supported for `%T'\n"),
(_("%P: %pB: %s is not supported for `%pT'\n"),
input_bfd,
ppc64_elf_howto_table[r_type]->name, sym_name);
@ -15225,7 +15225,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
{
info->callbacks->einfo
/* xgettext:c-format */
(_("%H: unresolvable %s against `%T'\n"),
(_("%H: unresolvable %s against `%pT'\n"),
input_bfd, input_section, rel->r_offset,
howto->name,
h->elf.root.root.string);
@ -15322,7 +15322,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
{
info->callbacks->einfo
/* xgettext:c-format */
(_("%H: %s against `%T': error %d\n"),
(_("%H: %s against `%pT': error %d\n"),
input_bfd, input_section, rel->r_offset,
reloc_name, sym_name, (int) r);
ret = FALSE;

View File

@ -1782,7 +1782,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -3023,7 +3023,7 @@ _bfd_elf_adjust_dynamic_copy (struct bfd_link_info *info,
|| (info->extern_protected_data < 0
&& !get_elf_backend_data (dynbss->owner)->extern_protected_data)))
info->callbacks->einfo
(_("%P: copy reloc against protected `%T' is dangerous\n"),
(_("%P: copy reloc against protected `%pT' is dangerous\n"),
h->root.root.string);
return TRUE;

View File

@ -8440,7 +8440,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -1109,7 +1109,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -2415,7 +2415,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -2476,7 +2476,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
info->flags |= DF_TEXTREL;
info->callbacks->minfo
(_("%pB: dynamic relocation against `%T' in read-only section `%pA'\n"),
(_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
/* Not an error, just cut short the traversal. */

View File

@ -568,7 +568,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *inf)
info->flags |= DF_TEXTREL;
/* xgettext:c-format */
info->callbacks->minfo (_("%pB: dynamic relocation against `%T' "
info->callbacks->minfo (_("%pB: dynamic relocation against `%pT' "
"in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);

View File

@ -8307,7 +8307,7 @@ bfd_generic_get_relocated_section_contents (bfd *abfd,
message instead. */
link_info->callbacks->einfo
/* xgettext:c-format */
(_("%X%P: %pB(%pA): relocation \"%R\" goes out of range\n"),
(_("%X%P: %pB(%pA): relocation \"%pR\" goes out of range\n"),
abfd, input_section, * parent);
goto error_return;
@ -8317,7 +8317,7 @@ bfd_generic_get_relocated_section_contents (bfd *abfd,
Do not abort. Issue an error message instead. */
link_info->callbacks->einfo
/* xgettext:c-format */
(_("%X%P: %pB(%pA): relocation \"%R\" is not supported\n"),
(_("%X%P: %pB(%pA): relocation \"%pR\" is not supported\n"),
abfd, input_section, * parent);
goto error_return;
@ -8326,7 +8326,7 @@ bfd_generic_get_relocated_section_contents (bfd *abfd,
Report unexpected results, without aborting. */
link_info->callbacks->einfo
/* xgettext:c-format */
(_("%X%P: %pB(%pA): relocation \"%R\" returns an unrecognized value %x\n"),
(_("%X%P: %pB(%pA): relocation \"%pR\" returns an unrecognized value %x\n"),
abfd, input_section, * parent, r);
break;
}

View File

@ -1,3 +1,12 @@
2018-02-19 Alan Modra <amodra@gmail.com>
* ldmisc.c (vfinfo) Handle %pI, %pR, %pS and %pT in place of
%I, %R, %S and %T.
* ldcref.c, * ldctor.c, * ldemul.c, * ldexp.c, * ldgram.y,
* ldlang.c, * ldlex.l, * ldmain.c, * ldmisc.c, * pe-dll.c,
* emultempl/sh64elf.em: Replace use of of %I, %R, %S and %T in
format strings passed to einfo and friends by %pI, %pR, %pS and %pT.
2018-02-19 Alan Modra <amodra@gmail.com>
* ldmisc.c (vfinfo): Handle %pA and %pB in place of %A and %B.

View File

@ -76,7 +76,7 @@ sh64_elf_${EMULATION_NAME}_before_allocation (void)
= bfd_get_section_by_name (f->the_bfd,
SH64_CRANGES_SECTION_NAME);
if (input_cranges != NULL)
einfo (" %I\n", f);
einfo (" %pI\n", f);
}
}
@ -105,7 +105,7 @@ sh64_elf_${EMULATION_NAME}_before_allocation (void)
& (SHF_SH5_ISA32 | SHF_SH5_ISA32_MIXED))
{
einfo (_("%P: Sorry, turning off relaxing: SHmedia sections present.\n"));
einfo (" %I\n", f);
einfo (" %pI\n", f);
DISABLE_RELAXATION;
goto done_scanning_shmedia_sections;
}

View File

@ -410,7 +410,7 @@ output_one_cref (FILE *fp, struct cref_hash_entry *h)
hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE,
FALSE, TRUE);
if (hl == NULL)
einfo (_("%P: symbol `%T' missing from main hash table\n"),
einfo (_("%P: symbol `%pT' missing from main hash table\n"),
h->root.string);
else
{
@ -562,7 +562,7 @@ check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED)
FALSE, TRUE);
if (hl == NULL)
{
einfo (_("%P: symbol `%T' missing from main hash table\n"),
einfo (_("%P: symbol `%pT' missing from main hash table\n"),
h->root.string);
return TRUE;
}
@ -721,7 +721,7 @@ check_reloc_refs (bfd *abfd, asection *sec, void *iarg)
in OUTSECNAME. This reloc is from a section which is
mapped into a section from which references to OUTSECNAME
are prohibited. We must report an error. */
einfo (_("%X%C: prohibited cross reference from %s to `%T' in %s\n"),
einfo (_("%X%C: prohibited cross reference from %s to `%pT' in %s\n"),
abfd, sec, q->address, outsecname,
bfd_asymbol_name (*q->sym_ptr_ptr), outdefsecname);
}

View File

@ -360,7 +360,7 @@ ldctor_build_sets (void)
}
if (e->name != NULL)
minfo ("%T\n", e->name);
minfo ("%pT\n", e->name);
else
minfo ("%G\n", e->section->owner, e->section, e->value);
}

View File

@ -271,13 +271,13 @@ set_output_arch_default (void)
void
syslib_default (char *ignore ATTRIBUTE_UNUSED)
{
info_msg (_("%S SYSLIB ignored\n"), NULL);
info_msg (_("%pS SYSLIB ignored\n"), NULL);
}
void
hll_default (char *ignore ATTRIBUTE_UNUSED)
{
info_msg (_("%S HLL ignored\n"), NULL);
info_msg (_("%pS HLL ignored\n"), NULL);
}
ld_emulation_xfer_type *ld_emulations[] = { EMULATION_LIST };

View File

@ -624,7 +624,7 @@ fold_binary (etree_type *tree)
expld.result.value = ((bfd_signed_vma) lhs.value
% (bfd_signed_vma) expld.result.value);
else if (expld.phase != lang_mark_phase_enum)
einfo (_("%F%S %% by zero\n"), tree->binary.rhs);
einfo (_("%F%pS %% by zero\n"), tree->binary.rhs);
arith_result_section (&lhs);
break;
@ -633,7 +633,7 @@ fold_binary (etree_type *tree)
expld.result.value = ((bfd_signed_vma) lhs.value
/ (bfd_signed_vma) expld.result.value);
else if (expld.phase != lang_mark_phase_enum)
einfo (_("%F%S / by zero\n"), tree->binary.rhs);
einfo (_("%F%pS / by zero\n"), tree->binary.rhs);
arith_result_section (&lhs);
break;
@ -754,7 +754,7 @@ fold_name (etree_type *tree)
if (expld.phase <= lang_mark_phase_enum)
new_rel (h->u.def.value, h->u.def.section);
else
einfo (_("%X%S: unresolvable symbol `%s'"
einfo (_("%X%pS: unresolvable symbol `%s'"
" referenced in expression\n"),
tree, tree->name.name);
}
@ -769,7 +769,7 @@ fold_name (etree_type *tree)
else if (expld.phase == lang_final_phase_enum
|| (expld.phase != lang_mark_phase_enum
&& expld.assigning_to_dot))
einfo (_("%F%S: undefined symbol `%s'"
einfo (_("%F%pS: undefined symbol `%s'"
" referenced in expression\n"),
tree, tree->name.name);
else if (h->type == bfd_link_hash_new)
@ -795,7 +795,7 @@ fold_name (etree_type *tree)
if (os == NULL)
{
if (expld.phase == lang_final_phase_enum)
einfo (_("%F%S: undefined section `%s'"
einfo (_("%F%pS: undefined section `%s'"
" referenced in expression\n"),
tree, tree->name.name);
}
@ -813,7 +813,7 @@ fold_name (etree_type *tree)
if (os == NULL)
{
if (expld.phase == lang_final_phase_enum)
einfo (_("%F%S: undefined section `%s'"
einfo (_("%F%pS: undefined section `%s'"
" referenced in expression\n"),
tree, tree->name.name);
}
@ -841,7 +841,7 @@ fold_name (etree_type *tree)
if (os == NULL)
{
if (expld.phase == lang_final_phase_enum)
einfo (_("%F%S: undefined section `%s'"
einfo (_("%F%pS: undefined section `%s'"
" referenced in expression\n"),
tree, tree->name.name);
new_number (0);
@ -873,7 +873,7 @@ fold_name (etree_type *tree)
if (mem != NULL)
new_number (mem->length);
else
einfo (_("%F%S: undefined MEMORY region `%s'"
einfo (_("%F%pS: undefined MEMORY region `%s'"
" referenced in expression\n"),
tree, tree->name.name);
}
@ -889,7 +889,7 @@ fold_name (etree_type *tree)
if (mem != NULL)
new_rel_from_abs (mem->origin);
else
einfo (_("%F%S: undefined MEMORY region `%s'"
einfo (_("%F%pS: undefined MEMORY region `%s'"
" referenced in expression\n"),
tree, tree->name.name);
}
@ -901,7 +901,7 @@ fold_name (etree_type *tree)
else if (strcmp (tree->name.name, "COMMONPAGESIZE") == 0)
new_number (config.commonpagesize);
else
einfo (_("%F%S: unknown constant `%s' referenced in expression\n"),
einfo (_("%F%pS: unknown constant `%s' referenced in expression\n"),
tree, tree->name.name);
break;
@ -1049,7 +1049,7 @@ exp_fold_tree_1 (etree_type *tree)
if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0)
{
if (tree->type.node_class != etree_assign)
einfo (_("%F%S can not PROVIDE assignment to"
einfo (_("%F%pS can not PROVIDE assignment to"
" location counter\n"), tree);
if (expld.phase != lang_first_phase_enum)
{
@ -1082,11 +1082,11 @@ exp_fold_tree_1 (etree_type *tree)
|| expld.section == bfd_und_section_ptr)
{
if (expld.phase != lang_mark_phase_enum)
einfo (_("%F%S invalid assignment to"
einfo (_("%F%pS invalid assignment to"
" location counter\n"), tree);
}
else if (expld.dotp == NULL)
einfo (_("%F%S assignment to location counter"
einfo (_("%F%pS assignment to location counter"
" invalid outside of SECTIONS\n"), tree);
/* After allocation, assignment to dot should not be
@ -1105,7 +1105,7 @@ exp_fold_tree_1 (etree_type *tree)
nextdot += expld.section->vma;
if (nextdot < expld.dot
&& expld.section != bfd_abs_section_ptr)
einfo (_("%F%S cannot move location counter backwards"
einfo (_("%F%pS cannot move location counter backwards"
" (from %V to %V)\n"),
tree, expld.dot, nextdot);
else
@ -1513,7 +1513,7 @@ exp_get_vma (etree_type *tree, bfd_vma def, char *name)
if (expld.result.valid_p)
return expld.result.value;
else if (name != NULL && expld.phase != lang_mark_phase_enum)
einfo (_("%F%S: nonconstant expression for %s\n"),
einfo (_("%F%pS: nonconstant expression for %s\n"),
tree, name);
}
return def;
@ -1539,7 +1539,7 @@ exp_get_fill (etree_type *tree, fill_type *def, char *name)
if (!expld.result.valid_p)
{
if (name != NULL && expld.phase != lang_mark_phase_enum)
einfo (_("%F%S: nonconstant expression for %s\n"),
einfo (_("%F%pS: nonconstant expression for %s\n"),
tree, name);
return def;
}
@ -1599,7 +1599,7 @@ exp_get_abs_int (etree_type *tree, int def, char *name)
}
else if (name != NULL && expld.phase != lang_mark_phase_enum)
{
einfo (_("%F%S: nonconstant expression for %s\n"),
einfo (_("%F%pS: nonconstant expression for %s\n"),
tree, name);
}
}

View File

@ -1244,7 +1244,7 @@ phdr_type:
else
{
einfo (_("\
%X%P:%S: unknown phdr type `%s' (try integer literal)\n"),
%X%P:%pS: unknown phdr type `%s' (try integer literal)\n"),
NULL, s);
$$ = exp_intop (0);
}
@ -1268,7 +1268,7 @@ phdr_qualifiers:
else if (strcmp ($1, "FLAGS") == 0 && $2 != NULL)
$$.flags = $2;
else
einfo (_("%X%P:%S: PHDRS syntax error at `%s'\n"),
einfo (_("%X%P:%pS: PHDRS syntax error at `%s'\n"),
NULL, $1);
}
| AT '(' exp ')' phdr_qualifiers
@ -1477,7 +1477,7 @@ yyerror(arg)
einfo (_("%P:%s: file format not recognized; treating as linker script\n"),
ldlex_filename ());
if (error_index > 0 && error_index < ERROR_NAME_MAX)
einfo ("%P%F:%S: %s in %s\n", NULL, arg, error_names[error_index - 1]);
einfo ("%P%F:%pS: %s in %s\n", NULL, arg, error_names[error_index - 1]);
else
einfo ("%P%F:%S: %s\n", NULL, arg);
einfo ("%P%F:%pS: %s\n", NULL, arg);
}

View File

@ -1315,13 +1315,13 @@ lang_memory_region_lookup (const char *const name, bfd_boolean create)
if (strcmp (n->name, name) == 0)
{
if (create)
einfo (_("%P:%S: warning: redeclaration of memory region `%s'\n"),
einfo (_("%P:%pS: warning: redeclaration of memory region `%s'\n"),
NULL, name);
return r;
}
if (!create && strcmp (name, DEFAULT_MEMORY_REGION))
einfo (_("%P:%S: warning: memory region `%s' not declared\n"),
einfo (_("%P:%pS: warning: memory region `%s' not declared\n"),
NULL, name);
new_region = (lang_memory_region_type *)
@ -1358,7 +1358,7 @@ lang_memory_region_alias (const char *alias, const char *region_name)
the default memory region. */
if (strcmp (region_name, DEFAULT_MEMORY_REGION) == 0
|| strcmp (alias, DEFAULT_MEMORY_REGION) == 0)
einfo (_("%F%P:%S: error: alias for default memory region\n"), NULL);
einfo (_("%F%P:%pS: error: alias for default memory region\n"), NULL);
/* Look for the target region and check if the alias is not already
in use. */
@ -1369,14 +1369,14 @@ lang_memory_region_alias (const char *alias, const char *region_name)
if (region == NULL && strcmp (n->name, region_name) == 0)
region = r;
if (strcmp (n->name, alias) == 0)
einfo (_("%F%P:%S: error: redefinition of memory region "
einfo (_("%F%P:%pS: error: redefinition of memory region "
"alias `%s'\n"),
NULL, alias);
}
/* Check if the target region exists. */
if (region == NULL)
einfo (_("%F%P:%S: error: memory region `%s' "
einfo (_("%F%P:%pS: error: memory region `%s' "
"for alias `%s' does not exist\n"),
NULL, region_name, alias);
@ -2017,7 +2017,7 @@ lang_print_asneeded (void)
if (m->ref != NULL)
minfo ("%pB ", m->ref);
minfo ("(%T)\n", m->name);
minfo ("(%pT)\n", m->name);
}
}
@ -2829,7 +2829,7 @@ load_symbols (lang_input_statement_type *entry,
if (!entry->flags.reload)
ldlang_add_file (entry);
if (trace_files || verbose)
info_msg ("%I\n", entry);
info_msg ("%pI\n", entry);
break;
case bfd_archive:
@ -4142,7 +4142,7 @@ print_one_symbol (struct bfd_link_hash_entry *hash_entry, void *ptr)
+ hash_entry->u.def.section->output_offset
+ hash_entry->u.def.section->output_section->vma));
minfo (" %T\n", hash_entry->root.string);
minfo (" %pT\n", hash_entry->root.string);
}
return TRUE;
@ -5047,7 +5047,7 @@ lang_size_sections_1
dot += expld.result.section->vma;
}
else if (expld.phase != lang_mark_phase_enum)
einfo (_("%F%S: non constant or forward reference"
einfo (_("%F%pS: non constant or forward reference"
" address expression for section %s\n"),
os->addr_tree, os->name);
}
@ -6393,7 +6393,7 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info)
section = h->u.c.p->section;
if (!bfd_define_common_symbol (link_info.output_bfd, &link_info, h))
einfo (_("%P%F: Could not define common symbol `%T': %E\n"),
einfo (_("%P%F: Could not define common symbol `%pT': %E\n"),
h->root.string);
if (config.map_file != NULL)
@ -6716,7 +6716,7 @@ lang_enter_output_section_statement (const char *output_section_statement_name,
os->align_lma_with_input = align_with_input == ALIGN_WITH_INPUT;
if (os->align_lma_with_input && align != NULL)
einfo (_("%F%P:%S: error: align with input and explicit align specified\n"),
einfo (_("%F%P:%pS: error: align with input and explicit align specified\n"),
NULL);
os->subsection_alignment =
@ -7637,7 +7637,7 @@ lang_get_regions (lang_memory_region_type **region,
*region = lang_memory_region_lookup (memspec, FALSE);
if (have_lma && lma_memspec != 0)
einfo (_("%X%P:%S: section has both a load address and a load region\n"),
einfo (_("%X%P:%pS: section has both a load address and a load region\n"),
NULL);
}
@ -7752,7 +7752,7 @@ lang_new_phdr (const char *name,
&& (*pp)->type == 1
&& !((*pp)->filehdr || (*pp)->phdrs))
{
einfo (_("%X%P:%S: PHDRS and FILEHDR are not supported"
einfo (_("%X%P:%pS: PHDRS and FILEHDR are not supported"
" when prior PT_LOAD headers lack them\n"), NULL);
hdrs = FALSE;
}

View File

@ -729,5 +729,5 @@ lex_warn_invalid (char *where, char *what)
what = buf;
}
einfo (_("%P:%S: ignoring invalid character `%s'%s\n"), NULL, what, where);
einfo (_("%P:%pS: ignoring invalid character `%s'%s\n"), NULL, what, where);
}

View File

@ -823,7 +823,7 @@ add_archive_element (struct bfd_link_info *info,
/* Don't claim new IR symbols after all IR symbols have
been claimed. */
if (trace_files || verbose)
info_msg ("%I: no new IR symbols to claimi\n",
info_msg ("%pI: no new IR symbols to claimi\n",
&orig_input);
input->flags.claimed = 0;
return FALSE;
@ -906,13 +906,13 @@ add_archive_element (struct bfd_link_info *info,
if (from != NULL)
minfo ("%pB ", from);
if (h != NULL)
minfo ("(%T)\n", h->root.string);
minfo ("(%pT)\n", h->root.string);
else
minfo ("(%s)\n", name);
}
if (trace_files || verbose)
info_msg ("%I\n", &orig_input);
info_msg ("%pI\n", &orig_input);
return TRUE;
}
@ -979,7 +979,7 @@ multiple_definition (struct bfd_link_info *info,
nval = oval;
obfd = NULL;
}
einfo (_("%X%C: multiple definition of `%T'\n"),
einfo (_("%X%C: multiple definition of `%pT'\n"),
nbfd, nsec, nval, name);
if (obfd != NULL)
einfo (_("%D: first defined here\n"), obfd, osec, oval);
@ -1038,7 +1038,7 @@ multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED,
|| ntype == bfd_link_hash_indirect)
{
ASSERT (otype == bfd_link_hash_common);
einfo (_("%pB: warning: definition of `%T' overriding common\n"),
einfo (_("%pB: warning: definition of `%pT' overriding common\n"),
nbfd, name);
if (obfd != NULL)
einfo (_("%pB: warning: common is here\n"), obfd);
@ -1048,7 +1048,7 @@ multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED,
|| otype == bfd_link_hash_indirect)
{
ASSERT (ntype == bfd_link_hash_common);
einfo (_("%pB: warning: common of `%T' overridden by definition\n"),
einfo (_("%pB: warning: common of `%pT' overridden by definition\n"),
nbfd, name);
if (obfd != NULL)
einfo (_("%pB: warning: defined here\n"), obfd);
@ -1058,21 +1058,21 @@ multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED,
ASSERT (otype == bfd_link_hash_common && ntype == bfd_link_hash_common);
if (osize > nsize)
{
einfo (_("%pB: warning: common of `%T' overridden by larger common\n"),
einfo (_("%pB: warning: common of `%pT' overridden by larger common\n"),
nbfd, name);
if (obfd != NULL)
einfo (_("%pB: warning: larger common is here\n"), obfd);
}
else if (nsize > osize)
{
einfo (_("%pB: warning: common of `%T' overriding smaller common\n"),
einfo (_("%pB: warning: common of `%pT' overriding smaller common\n"),
nbfd, name);
if (obfd != NULL)
einfo (_("%pB: warning: smaller common is here\n"), obfd);
}
else
{
einfo (_("%pB: warning: multiple common of `%T'\n"), nbfd, name);
einfo (_("%pB: warning: multiple common of `%pT'\n"), nbfd, name);
if (obfd != NULL)
einfo (_("%pB: warning: previous common is here\n"), obfd);
}
@ -1318,19 +1318,19 @@ undefined_symbol (struct bfd_link_info *info,
if (error_count < MAX_ERRORS_IN_A_ROW)
{
if (error)
einfo (_("%X%C: undefined reference to `%T'\n"),
einfo (_("%X%C: undefined reference to `%pT'\n"),
abfd, section, address, name);
else
einfo (_("%C: warning: undefined reference to `%T'\n"),
einfo (_("%C: warning: undefined reference to `%pT'\n"),
abfd, section, address, name);
}
else if (error_count == MAX_ERRORS_IN_A_ROW)
{
if (error)
einfo (_("%X%D: more undefined references to `%T' follow\n"),
einfo (_("%X%D: more undefined references to `%pT' follow\n"),
abfd, section, address, name);
else
einfo (_("%D: warning: more undefined references to `%T' follow\n"),
einfo (_("%D: warning: more undefined references to `%pT' follow\n"),
abfd, section, address, name);
}
else if (error)
@ -1341,19 +1341,19 @@ undefined_symbol (struct bfd_link_info *info,
if (error_count < MAX_ERRORS_IN_A_ROW)
{
if (error)
einfo (_("%X%pB: undefined reference to `%T'\n"),
einfo (_("%X%pB: undefined reference to `%pT'\n"),
abfd, name);
else
einfo (_("%pB: warning: undefined reference to `%T'\n"),
einfo (_("%pB: warning: undefined reference to `%pT'\n"),
abfd, name);
}
else if (error_count == MAX_ERRORS_IN_A_ROW)
{
if (error)
einfo (_("%X%pB: more undefined references to `%T' follow\n"),
einfo (_("%X%pB: more undefined references to `%pT' follow\n"),
abfd, name);
else
einfo (_("%pB: warning: more undefined references to `%T' follow\n"),
einfo (_("%pB: warning: more undefined references to `%pT' follow\n"),
abfd, name);
}
else if (error)
@ -1404,13 +1404,13 @@ reloc_overflow (struct bfd_link_info *info,
case bfd_link_hash_undefined:
case bfd_link_hash_undefweak:
einfo (_(" relocation truncated to fit: "
"%s against undefined symbol `%T'"),
"%s against undefined symbol `%pT'"),
reloc_name, entry->root.string);
break;
case bfd_link_hash_defined:
case bfd_link_hash_defweak:
einfo (_(" relocation truncated to fit: "
"%s against symbol `%T' defined in %pA section in %pB"),
"%s against symbol `%pT' defined in %pA section in %pB"),
reloc_name, entry->root.string,
entry->u.def.section,
entry->u.def.section == bfd_abs_section_ptr
@ -1422,7 +1422,7 @@ reloc_overflow (struct bfd_link_info *info,
}
}
else
einfo (_(" relocation truncated to fit: %s against `%T'"),
einfo (_(" relocation truncated to fit: %s against `%pT'"),
reloc_name, name);
if (addend != 0)
einfo ("+%v", addend);
@ -1452,7 +1452,7 @@ unattached_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED,
asection *section,
bfd_vma address)
{
einfo (_("%X%H: reloc refers to symbol `%T' which is not being output\n"),
einfo (_("%X%H: reloc refers to symbol `%pT' which is not being output\n"),
abfd, section, address, name);
}

View File

@ -46,11 +46,7 @@
%F error is fatal
%G like %D, but only function name
%H like %C but in addition emit section+offset
%I filename from a lang_input_statement_type
%P print program name
%R info about a relent
%S print script file and linenumber from etree_type.
%T symbol name
%V hex bfd_vma
%W hex bfd_vma with 0x with no leading zeros taking up 8 spaces
%X no object output, fail return
@ -60,6 +56,10 @@
%p native (host) void* pointer, like printf
%pA section name from a section
%pB filename from a bfd
%pI filename from a lang_input_statement_type
%pR info about a relent
%pS print script file and linenumber from etree_type.
%pT symbol name
%s arbitrary string, like printf
%u integer, like printf
%v hex bfd_vma, no leading zeros
@ -129,16 +129,13 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
arg_type = Vma;
break;
case 'T':
case 'I':
case 'S':
case 'R':
case 's':
arg_type = Ptr;
break;
case 'p':
if (*scan == 'A' || *scan == 'B')
if (*scan == 'A' || *scan == 'B' || *scan == 'I'
|| *scan == 'R' || *scan == 'S' || *scan == 'T')
scan++;
arg_type = Ptr;
break;
@ -292,33 +289,6 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
}
break;
case 'T':
/* Symbol name. */
{
const char *name = (const char *) args[arg_no].p;
++arg_count;
if (name == NULL || *name == 0)
{
fprintf (fp, _("no symbol"));
break;
}
else if (demangling)
{
char *demangled;
demangled = bfd_demangle (link_info.output_bfd, name,
DMGL_ANSI | DMGL_PARAMS);
if (demangled != NULL)
{
fprintf (fp, "%s", demangled);
free (demangled);
break;
}
}
fprintf (fp, "%s", name);
}
break;
case 'F':
/* Error is fatal. */
fatal = TRUE;
@ -334,54 +304,6 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
fprintf (fp, "%s", bfd_errmsg (bfd_get_error ()));
break;
case 'I':
/* filename from a lang_input_statement_type */
{
lang_input_statement_type *i;
i = (lang_input_statement_type *) args[arg_no].p;
++arg_count;
if (i->the_bfd->my_archive != NULL
&& !bfd_is_thin_archive (i->the_bfd->my_archive))
fprintf (fp, "(%s)",
bfd_get_filename (i->the_bfd->my_archive));
fprintf (fp, "%s", i->local_sym_name);
if ((i->the_bfd->my_archive == NULL
|| bfd_is_thin_archive (i->the_bfd->my_archive))
&& filename_cmp (i->local_sym_name, i->filename) != 0)
fprintf (fp, " (%s)", i->filename);
}
break;
case 'S':
/* Print script file and linenumber. */
{
etree_type node;
etree_type *tp = (etree_type *) args[arg_no].p;
++arg_count;
if (tp == NULL)
{
tp = &node;
tp->type.filename = ldlex_filename ();
tp->type.lineno = lineno;
}
if (tp->type.filename != NULL)
fprintf (fp, "%s:%u", tp->type.filename, tp->type.lineno);
}
break;
case 'R':
/* Print all that's interesting about a relent. */
{
arelent *relent = (arelent *) args[arg_no].p;
++arg_count;
lfinfo (fp, "%s+0x%v (type %s)",
(*(relent->sym_ptr_ptr))->name,
relent->addend,
relent->howto->name);
}
break;
case 'C':
case 'D':
case 'G':
@ -449,7 +371,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
&& filename_cmp (last_file, filename) != 0)
|| strcmp (last_function, functionname) != 0)
{
lfinfo (fp, _("%pB: In function `%T':\n"),
lfinfo (fp, _("%pB: In function `%pT':\n"),
abfd, functionname);
last_bfd = abfd;
@ -472,7 +394,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
done = fmt[-1] != 'H';
if (functionname != NULL && fmt[-1] == 'G')
lfinfo (fp, "%T", functionname);
lfinfo (fp, "%pT", functionname);
else if (filename != NULL && linenumber != 0)
fprintf (fp, "%u%s", linenumber, done ? "" : ":");
else
@ -546,6 +468,80 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
else
fprintf (fp, "%s", abfd->filename);
}
else if (*fmt == 'I')
{
/* filename from a lang_input_statement_type */
lang_input_statement_type *i;
fmt++;
i = (lang_input_statement_type *) args[arg_no].p;
++arg_count;
if (i->the_bfd->my_archive != NULL
&& !bfd_is_thin_archive (i->the_bfd->my_archive))
fprintf (fp, "(%s)",
bfd_get_filename (i->the_bfd->my_archive));
fprintf (fp, "%s", i->local_sym_name);
if ((i->the_bfd->my_archive == NULL
|| bfd_is_thin_archive (i->the_bfd->my_archive))
&& filename_cmp (i->local_sym_name, i->filename) != 0)
fprintf (fp, " (%s)", i->filename);
}
else if (*fmt == 'R')
{
/* Print all that's interesting about a relent. */
arelent *relent = (arelent *) args[arg_no].p;
fmt++;
++arg_count;
lfinfo (fp, "%s+0x%v (type %s)",
(*(relent->sym_ptr_ptr))->name,
relent->addend,
relent->howto->name);
}
else if (*fmt == 'S')
{
/* Print script file and linenumber. */
etree_type node;
etree_type *tp = (etree_type *) args[arg_no].p;
fmt++;
++arg_count;
if (tp == NULL)
{
tp = &node;
tp->type.filename = ldlex_filename ();
tp->type.lineno = lineno;
}
if (tp->type.filename != NULL)
fprintf (fp, "%s:%u", tp->type.filename, tp->type.lineno);
}
else if (*fmt == 'T')
{
/* Symbol name. */
const char *name = (const char *) args[arg_no].p;
fmt++;
++arg_count;
if (name == NULL || *name == 0)
{
fprintf (fp, _("no symbol"));
break;
}
else if (demangling)
{
char *demangled;
demangled = bfd_demangle (link_info.output_bfd, name,
DMGL_ANSI | DMGL_PARAMS);
if (demangled != NULL)
{
fprintf (fp, "%s", demangled);
free (demangled);
break;
}
}
fprintf (fp, "%s", name);
}
else
{
/* native (host) void* pointer, like printf */

View File

@ -2701,7 +2701,7 @@ pe_create_import_fixup (arelent *rel, asection *s, bfd_vma addend, char *name)
runtime_pseudo_relocs_created++;
}
else if (addend != 0)
einfo (_("%P%X%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"),
einfo (_("%P%X%C: variable '%pT' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"),
s->owner, s, rel->address, sym->name);
}