aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-02-19 18:30:41 +1030
committerAlan Modra <amodra@gmail.com>2018-02-19 23:55:53 +1030
commitc1c8c1ef9acdeddf719f358b91590545440cea68 (patch)
tree9470daac882438f72fbe9024b16b9c8b74ca58c6 /ld
parent871b3ab29e87cf0de15f7e49ad19acc4f7f6f84c (diff)
downloadfsf-binutils-gdb-c1c8c1ef9acdeddf719f358b91590545440cea68.zip
fsf-binutils-gdb-c1c8c1ef9acdeddf719f358b91590545440cea68.tar.gz
fsf-binutils-gdb-c1c8c1ef9acdeddf719f358b91590545440cea68.tar.bz2
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.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/emultempl/sh64elf.em4
-rw-r--r--ld/ldcref.c6
-rw-r--r--ld/ldctor.c2
-rw-r--r--ld/ldemul.c4
-rw-r--r--ld/ldexp.c34
-rw-r--r--ld/ldgram.y8
-rw-r--r--ld/ldlang.c26
-rw-r--r--ld/ldlex.l2
-rw-r--r--ld/ldmain.c42
-rw-r--r--ld/ldmisc.c168
-rw-r--r--ld/pe-dll.c2
12 files changed, 156 insertions, 151 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index db07d03..84c6d3e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,14 @@
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.
* ldcref.c: Update all messages using %A and %B.
* ldexp.c: Likewise.
diff --git a/ld/emultempl/sh64elf.em b/ld/emultempl/sh64elf.em
index 5bfe5b1..7e3f680 100644
--- a/ld/emultempl/sh64elf.em
+++ b/ld/emultempl/sh64elf.em
@@ -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;
}
diff --git a/ld/ldcref.c b/ld/ldcref.c
index 2b8eb02..ccf7a70 100644
--- a/ld/ldcref.c
+++ b/ld/ldcref.c
@@ -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);
}
diff --git a/ld/ldctor.c b/ld/ldctor.c
index 8d6e016..723d01d 100644
--- a/ld/ldctor.c
+++ b/ld/ldctor.c
@@ -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);
}
diff --git a/ld/ldemul.c b/ld/ldemul.c
index b2262e2..6e5b0de 100644
--- a/ld/ldemul.c
+++ b/ld/ldemul.c
@@ -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 };
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 6d1caca..a44a4fe 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -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);
}
}
diff --git a/ld/ldgram.y b/ld/ldgram.y
index ba89a4f..335624b 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -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);
}
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 2581a77..1a6f2cf 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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;
}
diff --git a/ld/ldlex.l b/ld/ldlex.l
index 2f59d79..261c0c1 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -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);
}
diff --git a/ld/ldmain.c b/ld/ldmain.c
index d23c6d1..6945654 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -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);
}
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index e3fdac3..d201151 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -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 */
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index d1bd32c..5f11005 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -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);
}