* [PATCH v2 0/2] ld: Output error for warnings with --fatal-warnings
@ 2024-01-26 21:46 H.J. Lu
2024-01-26 21:46 ` [PATCH v2 1/2] ld: Output error for linker " H.J. Lu
2024-01-26 21:46 ` [PATCH v2 2/2] bfd: Output error for linker --fatal-warnings option H.J. Lu
0 siblings, 2 replies; 3+ messages in thread
From: H.J. Lu @ 2024-01-26 21:46 UTC (permalink / raw)
To: binutils
Changes in v2:
1. Update the expected error in testsuite/ld-elf/fatal-warnings-5.d to
allow buffering.
2. Add --no-warn-execstack to testsuite/ld-scripts/defined7.d for targets
which check executable stack before checking multiple definition.
---
1. Since --fatal-warnings changes warnings into errors, we should output
error, instead of warning, for linker warnings.
Add %w to vfinfo to output "warning" if --fatal-warnings isn't used or
"error" otherwise. Replace warning with %w in linker warnings.
2. Update _bfd_error_handler to output the warning prefix, which is default
to "warning". Add %%w to _bfd_doprnt to output "error", instead of
"warning", when --fatal-warnings is used. Update bfd_set_error_handler
to allow linker to set the warning prefix to "error" for --fatal-warnings.
Call bfd_set_error_handler after parsing all linker command-line arguments
so that config.fatal_warnings will be set for --fatal-warnings.
H.J. Lu (2):
ld: Output error for linker warnings with --fatal-warnings
bfd: Output error for linker --fatal-warnings option
bfd/archive.c | 2 +-
bfd/bfd-in2.h | 3 +-
bfd/bfd.c | 34 +++-
bfd/binary.c | 2 +-
bfd/coff-arm.c | 14 +-
bfd/coff-go32.c | 2 +-
bfd/coff-mcore.c | 2 +-
bfd/coff-sh.c | 14 +-
bfd/coff-tic30.c | 2 +-
bfd/coff-tic4x.c | 2 +-
bfd/coff-tic54x.c | 2 +-
bfd/coff-z80.c | 2 +-
bfd/coff-z8k.c | 2 +-
bfd/coffcode.h | 26 +--
bfd/coffgen.c | 7 +-
bfd/cofflink.c | 6 +-
bfd/coffswap.h | 2 +-
bfd/cpu-arm.c | 2 +-
bfd/cpu-m68k.c | 2 +-
bfd/ecoff.c | 2 +-
bfd/elf-properties.c | 10 +-
bfd/elf-s390-common.c | 6 +-
bfd/elf.c | 24 +--
bfd/elf32-arc.c | 8 +-
bfd/elf32-arm.c | 44 ++---
bfd/elf32-bfin.c | 2 +-
bfd/elf32-csky.c | 8 +-
bfd/elf32-msp430.c | 2 +-
bfd/elf32-nds32.c | 18 +-
bfd/elf32-ppc.c | 6 +-
bfd/elf32-rl78.c | 2 +-
bfd/elf32-rx.c | 6 +-
bfd/elf32-score.c | 2 +-
bfd/elf32-score7.c | 2 +-
bfd/elf32-sh.c | 16 +-
bfd/elf32-spu.c | 6 +-
bfd/elf32-tic6x.c | 10 +-
bfd/elf32-v850.c | 14 +-
bfd/elf32-vax.c | 8 +-
bfd/elf64-alpha.c | 4 +-
bfd/elf64-ia64-vms.c | 8 +-
bfd/elf64-ppc.c | 12 +-
bfd/elfcode.h | 6 +-
bfd/elfcore.h | 2 +-
bfd/elflink.c | 36 ++--
bfd/elfnn-aarch64.c | 4 +-
bfd/elfnn-loongarch.c | 2 +-
bfd/elfnn-riscv.c | 10 +-
bfd/elfxx-aarch64.c | 4 +-
bfd/elfxx-mips.c | 34 ++--
bfd/elfxx-x86.c | 4 +-
bfd/format.c | 7 +-
bfd/mmo.c | 2 +-
bfd/xcofflink.c | 2 +-
ld/emultempl/aix.em | 24 +--
ld/emultempl/armelf.em | 4 +-
ld/emultempl/beos.em | 2 +-
ld/emultempl/m68hc1xelf.em | 2 +-
ld/emultempl/msp430.em | 4 +-
ld/emultempl/nto.em | 4 +-
ld/emultempl/pe.em | 18 +-
ld/emultempl/pep.em | 12 +-
ld/emultempl/xtensaelf.em | 6 +-
ld/ldelf.c | 20 +-
ld/ldelfgen.c | 6 +-
ld/ldexp.c | 2 +-
ld/ldlang.c | 44 ++---
ld/ldmain.c | 53 +++---
ld/ldmisc.c | 8 +-
ld/pdb.c | 246 ++++++++++++-------------
ld/pe-dll.c | 2 +-
ld/testsuite/ld-elf/fatal-warnings-5.d | 6 +
ld/testsuite/ld-elf/note-4.l | 2 +
ld/testsuite/ld-elf/shared.exp | 5 +
ld/testsuite/ld-i386/pr28894.d | 2 +-
ld/testsuite/ld-i386/warn1.d | 2 +-
ld/testsuite/ld-scripts/defined.exp | 1 +
ld/testsuite/ld-scripts/defined7.d | 3 +
78 files changed, 493 insertions(+), 446 deletions(-)
create mode 100644 ld/testsuite/ld-elf/fatal-warnings-5.d
create mode 100644 ld/testsuite/ld-elf/note-4.l
create mode 100644 ld/testsuite/ld-scripts/defined7.d
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] ld: Output error for linker warnings with --fatal-warnings
2024-01-26 21:46 [PATCH v2 0/2] ld: Output error for warnings with --fatal-warnings H.J. Lu
@ 2024-01-26 21:46 ` H.J. Lu
2024-01-26 21:46 ` [PATCH v2 2/2] bfd: Output error for linker --fatal-warnings option H.J. Lu
1 sibling, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2024-01-26 21:46 UTC (permalink / raw)
To: binutils
Since --fatal-warnings changes warnings into errors, we should output
error, instead of warning, for linker warnings.
Add %w to vfinfo to output "warning" if --fatal-warnings isn't used or
"error" otherwise. Replace warning with %w in linker warnings.
bfd/
* elf32-ppc.c (ppc_elf_finish_dynamic_sections): Pass %w, instead
of warning, to linker einfo.
* elf32-sh.c (sh_elf_relocate_section): Likewise.
* elf32-spu.c (check_function_ranges): Likewise.
* elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Likewise.
* elflink.c (bfd_elf_final_link): Likewise.
(_bfd_elf_add_dynamic_tags): Likewise.
* elflink.c (_bfd_elf_maybe_set_textrel): Likewise.
* elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Likewise.
(_bfd_x86_elf_link_setup_gnu_properties): Likewise.
ld/
* ldelf.c (ldelf_stat_needed): Pass %w, instead of warning, to
einfo.
(ldelf_handle_dt_needed): Likewise.
(ldelf_after_open): Likewise.
(write_build_id): Likewise.
(ldelf_setup_build_id): Likewise.
(write_package_metadata): Likewise.
(ldelf_setup_package_metadata): Likewise.
* ldelfgen.c (ldelf_acquire_strings_for_ctf): Likewise.
(ldelf_new_dynsym_for_ctf): Likewise.
* ldexp.c (fold_binary): Likewise.
* ldlang.c (lang_memory_region_lookup): Likewise.
(wont_add_section_p): Likewise.
(open_input_bfds): Likewise.
(lang_open_ctf): Likewise.
(lang_merge_ctf): Likewise.
(lang_write_ctf): Likewise.
(lang_size_sections_1): Likewise.
(lang_end): Likewise.
(ldlang_place_orphan): Likewise.
(warn_non_contiguous_discards): Likewise.
* ldmain.c (multiple_definition): Likewise.
(multiple_common): Likewise.
(add_to_set): Likewise.
(constructor_callback): Likewise.
(warning_callback): Likewise.
(warning_find_reloc): Likewise.
(undefined_symbol): Likewise.
* pdb.c (parse_symbols): Likewise.
(calculate_symbols_size): Likewise.
(handle_udt_src_line): Likewise.
(handle_type): Likewise.
(create_linker_symbols): Likewise.
(create_pdb_file): Likewise.
* pe-dll.c (pe_find_data_imports): Likewise.
* ldmisc.c (vfinfo): Add %w to output "warning" if
--fatal-warnings isn't used or "error" otherwise.
(output_unknown_cmdline_warnings): Pass %w, instead of warning,
to einfo.
* emultempl/aix.em (gld${EMULATION_NAME}_handle_option): Likewise.
(gld${EMULATION_NAME}_read_file): Likewise.
* emultempl/armelf.em (gld${EMULATION_NAME}_finish): Likewise.
* emultempl/beos.em (set_pe_subsystem): Likewise.
* emultempl/m68hc1xelf.em
(m68hc11_elf_${EMULATION_NAME}_before_allocation): Likewise.
* emultempl/msp430.em (warn_no_output_section): Likewise.
(check_array_section_alignment): Likewise.
* emultempl/nto.em (nto_lookup_QNX_note_section): Likewise.
* emultempl/pe.em (set_pe_subsystem): Likewise.
(gld${EMULATION_NAME}_after_parse): Likewise.
(change_undef): Likewise.
(set_decoration): Likewise.
(write_build_id): Likewise.
(setup_build_id): Likewise.
(gld${EMULATION_NAME}_finish): Likewise.
* emultempl/pep.em (set_pep_subsystem): Likewise.
(gld${EMULATION_NAME}_after_parse): Likewise.
(set_decoration): Likewise.
(write_build_id): Likewise.
(setup_build_id): Likewise.
* emultempl/xtensaelf.em (replace_instruction_table_sections):
Likewise.
(check_xtensa_info): Likewise.
* testsuite/ld-elf/fatal-warnings-5.d: New file.
* testsuite/ld-i386/pr28894.d: Replace warning with error.
* testsuite/ld-i386/warn1.d: Likewise.
* testsuite/ld-scripts/defined.exp: Run defined7.
* testsuite/ld-scripts/defined7.d: New file.
---
bfd/elf32-ppc.c | 2 +-
bfd/elf32-sh.c | 2 +-
bfd/elf32-spu.c | 4 +-
bfd/elf64-ppc.c | 2 +-
bfd/elflink.c | 10 +-
bfd/elfxx-x86.c | 4 +-
ld/emultempl/aix.em | 24 +--
ld/emultempl/armelf.em | 4 +-
ld/emultempl/beos.em | 2 +-
ld/emultempl/m68hc1xelf.em | 2 +-
ld/emultempl/msp430.em | 4 +-
ld/emultempl/nto.em | 4 +-
ld/emultempl/pe.em | 18 +-
ld/emultempl/pep.em | 12 +-
ld/emultempl/xtensaelf.em | 6 +-
ld/ldelf.c | 20 +-
ld/ldelfgen.c | 6 +-
ld/ldexp.c | 2 +-
ld/ldlang.c | 40 ++--
ld/ldmain.c | 44 ++---
ld/ldmisc.c | 8 +-
ld/pdb.c | 246 ++++++++++++-------------
ld/pe-dll.c | 2 +-
ld/testsuite/ld-elf/fatal-warnings-5.d | 6 +
ld/testsuite/ld-i386/pr28894.d | 2 +-
ld/testsuite/ld-i386/warn1.d | 2 +-
ld/testsuite/ld-scripts/defined.exp | 1 +
ld/testsuite/ld-scripts/defined7.d | 3 +
28 files changed, 249 insertions(+), 233 deletions(-)
create mode 100644 ld/testsuite/ld-elf/fatal-warnings-5.d
create mode 100644 ld/testsuite/ld-scripts/defined7.d
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 68e17c8babb..e6dd7abdf96 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -10020,7 +10020,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
"functions will result in a segfault at runtime\n"));
else if (htab->maybe_local_ifunc_resolver)
info->callbacks->einfo
- (_("%P: warning: text relocations and GNU indirect "
+ (_("%P: %w: text relocations and GNU indirect "
"functions may result in a segfault at runtime\n"));
continue;
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 0f5117b6beb..77bcaea7bdf 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -5017,7 +5017,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
else
info->callbacks->einfo
/* xgettext:c-format */
- (_("%H: warning: relocation to \"%s\" references a different segment\n"),
+ (_("%H: %w: relocation to \"%s\" references a different segment\n"),
input_bfd, input_section, rel->r_offset, symname);
}
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index 881d4d8eb97..d960c34021a 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -2572,7 +2572,7 @@ check_function_ranges (asection *sec, struct bfd_link_info *info)
const char *f2 = func_name (&sinfo->fun[i]);
/* xgettext:c-format */
- info->callbacks->einfo (_("warning: %s overlaps %s\n"), f1, f2);
+ info->callbacks->einfo (_("%w: %s overlaps %s\n"), f1, f2);
sinfo->fun[i - 1].hi = sinfo->fun[i].lo;
}
else if (insns_at_end (&sinfo->fun[i - 1], sinfo->fun[i].lo))
@@ -2588,7 +2588,7 @@ check_function_ranges (asection *sec, struct bfd_link_info *info)
{
const char *f1 = func_name (&sinfo->fun[sinfo->num_fun - 1]);
- info->callbacks->einfo (_("warning: %s exceeds section size\n"), f1);
+ info->callbacks->einfo (_("%w: %s exceeds section size\n"), f1);
sinfo->fun[sinfo->num_fun - 1].hi = sec->size;
}
else if (insns_at_end (&sinfo->fun[sinfo->num_fun - 1], sec->size))
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index e95f9fbe651..cf68124ec12 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -18303,7 +18303,7 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
case DT_TEXTREL:
if (htab->elf.ifunc_resolvers)
info->callbacks->einfo
- (_("%P: warning: text relocations and GNU indirect "
+ (_("%P: %w: text relocations and GNU indirect "
"functions may result in a segfault at runtime\n"));
continue;
}
diff --git a/bfd/elflink.c b/bfd/elflink.c
index c2494b3e12e..35c1c7e01e0 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -13472,13 +13472,13 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
(_("%P%X: read-only segment has dynamic relocations\n"));
else if (bfd_link_dll (info))
info->callbacks->einfo
- (_("%P: warning: creating DT_TEXTREL in a shared object\n"));
+ (_("%P: %w: creating DT_TEXTREL in a shared object\n"));
else if (bfd_link_pde (info))
info->callbacks->einfo
- (_("%P: warning: creating DT_TEXTREL in a PDE\n"));
+ (_("%P: %w: creating DT_TEXTREL in a PDE\n"));
else
info->callbacks->einfo
- (_("%P: warning: creating DT_TEXTREL in a PIE\n"));
+ (_("%P: %w: creating DT_TEXTREL in a PIE\n"));
break;
}
}
@@ -15484,7 +15484,7 @@ _bfd_elf_maybe_set_textrel (struct elf_link_hash_entry *h, void *inf)
if (bfd_link_textrel_check (info))
/* xgettext:c-format */
- info->callbacks->einfo (_("%P: %pB: warning: relocation against `%s' "
+ info->callbacks->einfo (_("%P: %pB: %w: relocation against `%s' "
"in read-only section `%pA'\n"),
sec->owner, h->root.root.string, sec);
@@ -15573,7 +15573,7 @@ _bfd_elf_add_dynamic_tags (bfd *output_bfd, struct bfd_link_info *info,
{
if (htab->ifunc_resolvers)
info->callbacks->einfo
- (_("%P: warning: GNU indirect functions with DT_TEXTREL "
+ (_("%P: %w: GNU indirect functions with DT_TEXTREL "
"may result in a segfault at runtime; recompile with %s\n"),
bfd_link_dll (info) ? "-fPIC" : "-fPIE");
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 508fd771da3..61f5f0e6be7 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -2309,7 +2309,7 @@ _bfd_x86_elf_size_dynamic_sections (bfd *output_bfd,
if (bfd_link_textrel_check (info))
/* xgettext:c-format */
info->callbacks->einfo
- (_("%P: %pB: warning: relocation "
+ (_("%P: %pB: %w: relocation "
"in read-only section `%pA'\n"),
p->sec->owner, p->sec);
}
@@ -4163,7 +4163,7 @@ _bfd_x86_elf_link_setup_gnu_properties
{
/* Report missing IBT, SHSTK and LAM properties. */
bfd *abfd;
- const char *warning_msg = _("%P: %pB: warning: missing %s\n");
+ const char *warning_msg = _("%P: %pB: %w: missing %s\n");
const char *error_msg = _("%X%P: %pB: error: missing %s\n");
const char *cet_msg = NULL;
const char *lam_u48_msg = NULL;
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index 33857b5d49c..d7c66dd2e76 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -382,7 +382,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
case 'D':
val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
- einfo (_("%P: warning: ignoring invalid -D number %s\n"), optarg);
+ einfo (_("%P: %w: ignoring invalid -D number %s\n"), optarg);
else if (val != -1)
lang_section_start (".data", exp_intop (val), NULL);
break;
@@ -390,7 +390,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
case 'H':
val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0' || (val & (val - 1)) != 0)
- einfo (_("%P: warning: ignoring invalid -H number %s\n"), optarg);
+ einfo (_("%P: %w: ignoring invalid -H number %s\n"), optarg);
else
file_align = val;
break;
@@ -502,7 +502,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
case OPTION_MAXDATA:
val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
- einfo (_("%P: warning: ignoring invalid -bmaxdata number %s\n"),
+ einfo (_("%P: %w: ignoring invalid -bmaxdata number %s\n"),
optarg);
else
maxdata = val;
@@ -511,7 +511,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
case OPTION_MAXSTACK:
val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
- einfo (_("%P: warning: ignoring invalid -bmaxstack number %s\n"),
+ einfo (_("%P: %w: ignoring invalid -bmaxstack number %s\n"),
optarg);
else
maxstack = val;
@@ -524,7 +524,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
++optarg;
}
if (*optarg == '\0' || optarg[1] == '\0')
- einfo (_("%P: warning: ignoring invalid module type %s\n"), optarg);
+ einfo (_("%P: %w: ignoring invalid module type %s\n"), optarg);
else
modtype = (*optarg << 8) | optarg[1];
break;
@@ -554,7 +554,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
expression. */
val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
- einfo (_("%P: warning: ignoring invalid -pD number %s\n"), optarg);
+ einfo (_("%P: %w: ignoring invalid -pD number %s\n"), optarg);
else
{
etree_type *t;
@@ -577,7 +577,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
within the file. */
val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
- einfo (_("%P: warning: ignoring invalid -pT number %s\n"), optarg);
+ einfo (_("%P: %w: ignoring invalid -pT number %s\n"), optarg);
else
{
etree_type *t;
@@ -1374,7 +1374,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
{
impmember = "";
if (cs != '\0')
- einfo (_("%P:%s:%d: warning: syntax error in import file\n"),
+ einfo (_("%P:%s:%d: %w: syntax error in import file\n"),
filename, linenumber);
}
else
@@ -1386,7 +1386,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
if (*s == ')')
*s = '\0';
else
- einfo (_("%P:%s:%d: warning: syntax error in import file\n"),
+ einfo (_("%P:%s:%d: %w: syntax error in import file\n"),
filename, linenumber);
}
}
@@ -1421,7 +1421,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
while (ISSPACE (*se))
++se;
if (*se != '\0')
- einfo (_("%P:%s%d: warning: syntax error in "
+ einfo (_("%P:%s%d: %w: syntax error in "
"import/export file\n"),
filename, linenumber);
}
@@ -1439,7 +1439,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
address = bfd_scan_vma (s, &end, 0);
if (*end != '\0')
{
- einfo (_("%P:%s:%d: warning: syntax error in "
+ einfo (_("%P:%s:%d: %w: syntax error in "
"import/export file\n"),
filename, linenumber);
@@ -1484,7 +1484,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
if (obstack_object_size (o) > 0)
{
- einfo (_("%P:%s:%d: warning: ignoring unterminated last line\n"),
+ einfo (_("%P:%s:%d: %w: ignoring unterminated last line\n"),
filename, linenumber);
obstack_free (o, obstack_base (o));
}
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index 8f501aed12a..4fccffff318 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -501,12 +501,12 @@ gld${EMULATION_NAME}_finish (void)
if (params.thumb_entry_symbol != NULL && entry_symbol.name != NULL
&& entry_from_cmdline)
- einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"),
+ einfo (_("%P: %w: '--thumb-entry %s' is overriding '-e %s'\n"),
params.thumb_entry_symbol, entry_symbol.name);
entry_symbol.name = buffer;
}
else
- einfo (_("%P: warning: cannot find thumb start symbol %s\n"),
+ einfo (_("%P: %w: cannot find thumb start symbol %s\n"),
h->root.string);
}
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
index 29c386c61f8..026efbaaddd 100644
--- a/ld/emultempl/beos.em
+++ b/ld/emultempl/beos.em
@@ -194,7 +194,7 @@ set_pe_subsystem (void)
set_pe_name ("__minor_subsystem_version__",
strtoul (end + 1, &end, 0));
if (*end != '\0')
- einfo (_("%P: warning: bad version number in -subsystem option\n"));
+ einfo (_("%P: %w: bad version number in -subsystem option\n"));
}
for (i = 0; v[i].name; i++)
diff --git a/ld/emultempl/m68hc1xelf.em b/ld/emultempl/m68hc1xelf.em
index 7aaa78a72d5..6090e0879fd 100644
--- a/ld/emultempl/m68hc1xelf.em
+++ b/ld/emultempl/m68hc1xelf.em
@@ -130,7 +130,7 @@ m68hc11_elf_${EMULATION_NAME}_before_allocation (void)
if (pinfo->bank_size != region->length)
{
- einfo (_("%P: warning: the size of the 'window' memory region "
+ einfo (_("%P: %w: the size of the 'window' memory region "
"is not a power of 2; its size %d is truncated to %d\n"),
region->length, pinfo->bank_size);
}
diff --git a/ld/emultempl/msp430.em b/ld/emultempl/msp430.em
index 2d225317a25..691ff73abee 100644
--- a/ld/emultempl/msp430.em
+++ b/ld/emultempl/msp430.em
@@ -246,7 +246,7 @@ warn_no_output_section (const char *name)
warned[i][WARN_RODATA] = true;
else
return;
- einfo ("%P: warning: no input section rule matches %s in linker script\n",
+ einfo ("%P: %w: no input section rule matches %s in linker script\n",
name);
}
@@ -890,7 +890,7 @@ check_array_section_alignment (void)
&& sym->type == bfd_link_hash_defined
&& sym->u.def.value % 2)
{
- einfo ("%P: warning: \"%s\" symbol (%pU) is not word aligned\n",
+ einfo ("%P: %w: \"%s\" symbol (%pU) is not word aligned\n",
array_names[i][1], NULL);
}
}
diff --git a/ld/emultempl/nto.em b/ld/emultempl/nto.em
index 7cda6650bc6..d68f2cc9c97 100644
--- a/ld/emultempl/nto.em
+++ b/ld/emultempl/nto.em
@@ -111,11 +111,11 @@ nto_lookup_QNX_note_section(int type)
{
if (!duplicated_notes_detected)
{
- einfo (_("%P: %pB: warning: duplicated QNX stack .note detected\n"),
+ einfo (_("%P: %pB: %w: duplicated QNX stack .note detected\n"),
stack_note_sec->owner);
duplicated_notes_detected = true;
}
- einfo (_("%P: %pB: warning: duplicated QNX stack .note detected\n"),
+ einfo (_("%P: %pB: %w: duplicated QNX stack .note detected\n"),
sec->owner);
}
else
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 9ab5e6ef481..d1c56377094 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -623,7 +623,7 @@ set_pe_subsystem (void)
set_pe_name ("__minor_subsystem_version__",
strtoul (end + 1, &end, 0));
if (*end != '\0')
- einfo (_("%P: warning: bad version number in -subsystem option\n"));
+ einfo (_("%P: %w: bad version number in -subsystem option\n"));
}
/* Check for numeric subsystem. */
@@ -1045,7 +1045,7 @@ gld${EMULATION_NAME}_after_parse (void)
/* PR ld/6744: Warn the user if they have used an ELF-only
option hoping it will work on PE. */
if (link_info.export_dynamic)
- einfo (_("%P: warning: --export-dynamic is not supported for PE "
+ einfo (_("%P: %w: --export-dynamic is not supported for PE "
"targets, did you mean --export-all-symbols?\n"));
#ifdef PDB_H
@@ -1095,7 +1095,7 @@ change_undef (struct bfd_link_hash_entry * undef,
if (pe_enable_stdcall_fixup == -1)
{
- einfo (_("%P: warning: resolving %s by linking to %s\n"),
+ einfo (_("%P: %w: resolving %s by linking to %s\n"),
undef->root.string, sym->root.string);
if (! gave_warning_message)
@@ -1126,7 +1126,7 @@ set_decoration (const char *undecorated_name,
if (entry->decorated_link != NULL && !gave_warning_message)
{
- einfo (_("%P: warning: overwriting decorated name %s with %s\n"),
+ einfo (_("%P: %w: overwriting decorated name %s with %s\n"),
entry->decorated_link->root.string, undecorated_name);
gave_warning_message = true;
}
@@ -1323,7 +1323,7 @@ write_build_id (bfd *abfd)
if (!link_order)
{
- einfo (_("%P: warning: .buildid section discarded,"
+ einfo (_("%P: %w: .buildid section discarded,"
" --build-id ignored\n"));
return true;
}
@@ -1416,7 +1416,7 @@ setup_build_id (bfd *ibfd)
if (!validate_build_id_style (emit_build_id))
{
- einfo (_("%P: warning: unrecognized --build-id style ignored\n"));
+ einfo (_("%P: %w: unrecognized --build-id style ignored\n"));
return false;
}
@@ -1444,7 +1444,7 @@ setup_build_id (bfd *ibfd)
return true;
}
- einfo (_("%P: warning: cannot create .buildid section,"
+ einfo (_("%P: %w: cannot create .buildid section,"
" --build-id ignored\n"));
return false;
}
@@ -2047,12 +2047,12 @@ gld${EMULATION_NAME}_finish (void)
sprintf (buffer, "0x%" PRIx64, (uint64_t) val);
if (entry_symbol.name != NULL && entry_from_cmdline)
- einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"),
+ einfo (_("%P: %w: '--thumb-entry %s' is overriding '-e %s'\n"),
thumb_entry_symbol, entry_symbol.name);
entry_symbol.name = buffer;
}
else
- einfo (_("%P: warning: cannot find thumb start symbol %s\n"), thumb_entry_symbol);
+ einfo (_("%P: %w: cannot find thumb start symbol %s\n"), thumb_entry_symbol);
}
#endif /* defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe) */
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 00c4ea9e15a..2f8b7737bfe 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -600,7 +600,7 @@ set_pep_subsystem (void)
set_pep_name ("__minor_subsystem_version__",
strtoul (end + 1, &end, 0));
if (*end != '\0')
- einfo (_("%P: warning: bad version number in -subsystem option\n"));
+ einfo (_("%P: %w: bad version number in -subsystem option\n"));
}
/* Check for numeric subsystem. */
@@ -1010,7 +1010,7 @@ gld${EMULATION_NAME}_after_parse (void)
/* PR ld/6744: Warn the user if they have used an ELF-only
option hoping it will work on PE+. */
if (link_info.export_dynamic)
- einfo (_("%P: warning: --export-dynamic is not supported for PE+ "
+ einfo (_("%P: %w: --export-dynamic is not supported for PE+ "
"targets, did you mean --export-all-symbols?\n"));
#ifdef PDB_H
@@ -1062,7 +1062,7 @@ set_decoration (const char *undecorated_name,
if (entry->decorated_link != NULL && !gave_warning_message)
{
- einfo (_("%P: warning: overwriting decorated name %s with %s\n"),
+ einfo (_("%P: %w: overwriting decorated name %s with %s\n"),
entry->decorated_link->root.string, undecorated_name);
gave_warning_message = true;
}
@@ -1326,7 +1326,7 @@ write_build_id (bfd *abfd)
if (!link_order)
{
- einfo (_("%P: warning: .buildid section discarded,"
+ einfo (_("%P: %w: .buildid section discarded,"
" --build-id ignored\n"));
return true;
}
@@ -1419,7 +1419,7 @@ setup_build_id (bfd *ibfd)
if (!validate_build_id_style (emit_build_id))
{
- einfo (_("%P: warning: unrecognized --build-id style ignored\n"));
+ einfo (_("%P: %w: unrecognized --build-id style ignored\n"));
return false;
}
@@ -1447,7 +1447,7 @@ setup_build_id (bfd *ibfd)
return true;
}
- einfo (_("%P: warning: cannot create .buildid section,"
+ einfo (_("%P: %w: cannot create .buildid section,"
" --build-id ignored\n"));
return false;
}
diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
index 3508eb7f503..52454197bc6 100644
--- a/ld/emultempl/xtensaelf.em
+++ b/ld/emultempl/xtensaelf.em
@@ -271,7 +271,7 @@ replace_instruction_table_sections (bfd *abfd, asection *sec)
if (! replace_insn_sec_with_prop_sec (abfd, insn_sec_name, prop_sec_name,
&message))
{
- einfo (_("%P: warning: failed to convert %s table in %pB (%s); subsequent disassembly may be incomplete\n"),
+ einfo (_("%P: %w: failed to convert %s table in %pB (%s); subsequent disassembly may be incomplete\n"),
insn_sec_name, abfd, message);
}
}
@@ -402,11 +402,11 @@ check_xtensa_info (bfd *abfd, asection *info_sec)
&mismatch, &errmsg))
{
if (mismatch)
- einfo (_("%P: %pB: warning: incompatible Xtensa configuration (%s)\n"),
+ einfo (_("%P: %pB: %w: incompatible Xtensa configuration (%s)\n"),
abfd, errmsg);
}
else
- einfo (_("%P: %pB: warning: cannot parse .xtensa.info section\n"), abfd);
+ einfo (_("%P: %pB: %w: cannot parse .xtensa.info section\n"), abfd);
free (data);
}
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 04045acbf3d..b314de3d388 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -263,7 +263,7 @@ ldelf_stat_needed (lang_input_statement_type *s)
if (filename_ncmp (soname, global_needed->name,
suffix - global_needed->name) == 0)
- einfo (_("%P: warning: %s, needed by %pB, may conflict with %s\n"),
+ einfo (_("%P: %w: %s, needed by %pB, may conflict with %s\n"),
global_needed->name, global_needed->by, soname);
}
@@ -1186,7 +1186,7 @@ ldelf_handle_dt_needed (struct elf_link_hash_table *htab,
if (force < 2)
continue;
- einfo (_("%P: warning: %s, needed by %pB, not found "
+ einfo (_("%P: %w: %s, needed by %pB, not found "
"(try using -rpath or -rpath-link)\n"),
l->name, l->by);
}
@@ -1400,7 +1400,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
}
}
if (warn_eh_frame)
- einfo (_("%P: warning: cannot create .eh_frame_hdr section,"
+ einfo (_("%P: %w: cannot create .eh_frame_hdr section,"
" --eh-frame-hdr ignored\n"));
}
@@ -1448,7 +1448,7 @@ write_build_id (bfd *abfd)
asec = t->o->build_id.sec;
if (bfd_is_abs_section (asec->output_section))
{
- einfo (_("%P: warning: .note.gnu.build-id section discarded,"
+ einfo (_("%P: %w: .note.gnu.build-id section discarded,"
" --build-id ignored\n"));
return true;
}
@@ -1497,7 +1497,7 @@ ldelf_setup_build_id (bfd *ibfd)
size = id_note_section_size (ibfd);
if (size == 0)
{
- einfo (_("%P: warning: unrecognized --build-id style ignored\n"));
+ einfo (_("%P: %w: unrecognized --build-id style ignored\n"));
return false;
}
@@ -1516,7 +1516,7 @@ ldelf_setup_build_id (bfd *ibfd)
return true;
}
- einfo (_("%P: warning: cannot create .note.gnu.build-id section,"
+ einfo (_("%P: %w: cannot create .note.gnu.build-id section,"
" --build-id ignored\n"));
return false;
}
@@ -1537,7 +1537,7 @@ write_package_metadata (bfd *abfd)
asec = t->o->package_metadata.sec;
if (bfd_is_abs_section (asec->output_section))
{
- einfo (_("%P: warning: .note.package section discarded,"
+ einfo (_("%P: %w: .note.package section discarded,"
" --package-metadata ignored\n"));
return true;
}
@@ -1592,7 +1592,7 @@ ldelf_setup_package_metadata (bfd *ibfd)
json_length = strlen (ldelf_emit_note_fdo_package_metadata);
if (json_length == 0)
{
- einfo (_("%P: warning: --package-metadata is empty, ignoring\n"));
+ einfo (_("%P: %w: --package-metadata is empty, ignoring\n"));
return false;
}
@@ -1602,7 +1602,7 @@ ldelf_setup_package_metadata (bfd *ibfd)
0, &json_error);
if (!json)
{
- einfo (_("%P: warning: --package-metadata=%s does not contain valid "
+ einfo (_("%P: %w: --package-metadata=%s does not contain valid "
"JSON, ignoring: %s\n"),
ldelf_emit_note_fdo_package_metadata, json_error.text);
return false;
@@ -1631,7 +1631,7 @@ ldelf_setup_package_metadata (bfd *ibfd)
return true;
}
- einfo (_("%P: warning: cannot create .note.package section,"
+ einfo (_("%P: %w: cannot create .note.package section,"
" --package-metadata ignored\n"));
return false;
}
diff --git a/ld/ldelfgen.c b/ld/ldelfgen.c
index d3448546f3a..21d51c12407 100644
--- a/ld/ldelfgen.c
+++ b/ld/ldelfgen.c
@@ -417,7 +417,7 @@ ldelf_acquire_strings_for_ctf
{
if (ctf_link_add_strtab (ctf_output, ldelf_ctf_strtab_iter_cb,
&args) < 0)
- einfo (_("%F%P: warning: CTF strtab association failed; strings will "
+ einfo (_("%F%P: %w: CTF strtab association failed; strings will "
"not be shared: %s\n"),
ctf_errmsg (ctf_errno (ctf_output)));
}
@@ -444,7 +444,7 @@ ldelf_new_dynsym_for_ctf (struct ctf_dict *ctf_output, int symidx,
lsym.st_value = sym->st_value;
if (ctf_link_add_linker_symbol (ctf_output, &lsym) < 0)
{
- einfo (_("%F%P: warning: CTF symbol addition failed; CTF will "
+ einfo (_("%F%P: %w: CTF symbol addition failed; CTF will "
"not be tied to symbols: %s\n"),
ctf_errmsg (ctf_errno (ctf_output)));
}
@@ -454,7 +454,7 @@ ldelf_new_dynsym_for_ctf (struct ctf_dict *ctf_output, int symidx,
/* Shuffle all the symbols. */
if (ctf_link_shuffle_syms (ctf_output) < 0)
- einfo (_("%F%P: warning: CTF symbol shuffling failed; CTF will "
+ einfo (_("%F%P: %w: CTF symbol shuffling failed; CTF will "
"not be tied to symbols: %s\n"),
ctf_errmsg (ctf_errno (ctf_output)));
}
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 3c8ab2d3589..a767c082085 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -559,7 +559,7 @@ fold_binary (etree_type *tree)
&& config.magic_demand_paged
&& link_info.maxpagesize != 0
&& (seg->value % link_info.maxpagesize) != 0)
- einfo (_("%P: warning: address of `%s' "
+ einfo (_("%P: %w: address of `%s' "
"isn't multiple of maximum page size\n"),
segment_name);
seg->used = true;
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 229401c8342..ea85ffd704b 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1411,13 +1411,13 @@ lang_memory_region_lookup (const char *const name, bool create)
if (strcmp (n->name, name) == 0)
{
if (create)
- einfo (_("%P:%pS: warning: redeclaration of memory region `%s'\n"),
+ einfo (_("%P:%pS: %w: redeclaration of memory region `%s'\n"),
NULL, name);
return r;
}
if (!create && strcmp (name, DEFAULT_MEMORY_REGION))
- einfo (_("%P:%pS: warning: memory region `%s' not declared\n"),
+ einfo (_("%P:%pS: %w: memory region `%s' not declared\n"),
NULL, name);
new_region = stat_alloc (sizeof (lang_memory_region_type));
@@ -2616,7 +2616,7 @@ wont_add_section_p (asection *section,
else if (bfd_is_abs_section (section->output_section))
;
else if (link_info.non_contiguous_regions_warnings)
- einfo (_("%P:%pS: warning: --enable-non-contiguous-regions makes "
+ einfo (_("%P:%pS: %w: --enable-non-contiguous-regions makes "
"section `%pA' from `%pB' match /DISCARD/ clause.\n"),
NULL, section, section->owner);
@@ -2640,7 +2640,7 @@ wont_add_section_p (asection *section,
return true;
if (link_info.non_contiguous_regions_warnings && output->bfd_section)
- einfo (_("%P:%pS: warning: --enable-non-contiguous-regions may "
+ einfo (_("%P:%pS: %w: --enable-non-contiguous-regions may "
"change behaviour for section `%pA' from `%pB' (assigned to "
"%pA, but additional match: %pA)\n"),
NULL, section, section->owner, section->output_section,
@@ -3418,7 +3418,7 @@ open_output (const char *name)
/* Oh dear - we could not find any targets that
satisfy our requirements. */
if (winner == NULL)
- einfo (_("%P: warning: could not find any targets"
+ einfo (_("%P: %w: could not find any targets"
" that match endianness requirement\n"));
else
output_target = winner->name;
@@ -3631,7 +3631,7 @@ open_input_bfds (lang_statement_union_type *s,
naive user expectations. */
if (os_tail != lang_os_list.tail)
{
- einfo (_("%P: warning: %s contains output sections;"
+ einfo (_("%P: %w: %s contains output sections;"
" did you forget -T?\n"),
s->input_statement.filename);
*stat_ptr->tail = add.head;
@@ -3718,7 +3718,7 @@ ldlang_open_ctf (void)
if (err != ECTF_NOCTFDATA)
{
lang_ctf_errs_warnings (NULL);
- einfo (_("%P: warning: CTF section in %pB not loaded; "
+ einfo (_("%P: %w: CTF section in %pB not loaded; "
"its types will be discarded: %s\n"), file->the_bfd,
ctf_errmsg (err));
}
@@ -3747,7 +3747,7 @@ ldlang_open_ctf (void)
if ((ctf_output = ctf_create (&err)) != NULL)
return;
- einfo (_("%P: warning: CTF output not created: `%s'\n"),
+ einfo (_("%P: %w: CTF output not created: `%s'\n"),
ctf_errmsg (err));
LANG_FOR_EACH_INPUT_STATEMENT (errfile)
@@ -3790,7 +3790,7 @@ lang_merge_ctf (void)
/* Takes ownership of file->the_ctf. */
if (ctf_link_add_ctf (ctf_output, file->the_ctf, file->filename) < 0)
{
- einfo (_("%P: warning: CTF section in %pB cannot be linked: `%s'\n"),
+ einfo (_("%P: %w: CTF section in %pB cannot be linked: `%s'\n"),
file->the_bfd, ctf_errmsg (ctf_errno (ctf_output)));
ctf_close (file->the_ctf);
file->the_ctf = NULL;
@@ -3810,7 +3810,7 @@ lang_merge_ctf (void)
if (ctf_link (ctf_output, flags) < 0)
{
lang_ctf_errs_warnings (ctf_output);
- einfo (_("%P: warning: CTF linking failed; "
+ einfo (_("%P: %w: CTF linking failed; "
"output will have no CTF section: %s\n"),
ctf_errmsg (ctf_errno (ctf_output)));
if (output_sect)
@@ -3881,7 +3881,7 @@ lang_write_ctf (int late)
lang_ctf_errs_warnings (ctf_output);
if (!output_sect->contents)
{
- einfo (_("%P: warning: CTF section emission failed; "
+ einfo (_("%P: %w: CTF section emission failed; "
"output will have no CTF section: %s\n"),
ctf_errmsg (ctf_errno (ctf_output)));
output_sect->size = 0;
@@ -3920,7 +3920,7 @@ ldlang_open_ctf (void)
if ((sect = bfd_get_section_by_name (file->the_bfd, ".ctf")) != NULL)
{
- einfo (_("%P: warning: CTF section in %pB not linkable: "
+ einfo (_("%P: %w: CTF section in %pB not linkable: "
"%P was built without support for CTF\n"), file->the_bfd);
sect->size = 0;
sect->flags |= SEC_EXCLUDE;
@@ -5947,7 +5947,7 @@ lang_size_sections_1
" for loadable section `%s'\n"),
bfd_section_name (os->bfd_section));
else
- einfo (_("%P: warning: no memory region specified"
+ einfo (_("%P: %w: no memory region specified"
" for loadable section `%s'\n"),
bfd_section_name (os->bfd_section));
}
@@ -5981,7 +5981,7 @@ lang_size_sections_1
if (diff != 0
&& (config.warn_section_align
|| os->addr_tree != NULL))
- einfo (_("%P: warning: "
+ einfo (_("%P: %w: "
"start of section %s changed by %ld\n"),
os->name, (long) diff);
}
@@ -6074,7 +6074,7 @@ lang_size_sections_1
so people can fix their linker scripts. */
if (last->vma != last->lma)
- einfo (_("%P: warning: dot moved backwards "
+ einfo (_("%P: %w: dot moved backwards "
"before `%s'\n"), os->name);
}
else
@@ -7161,7 +7161,7 @@ lang_end (void)
if (ts != NULL)
{
if (warn)
- einfo (_("%P: warning: cannot find entry symbol %s;"
+ einfo (_("%P: %w: cannot find entry symbol %s;"
" defaulting to %V\n"),
entry_symbol.name,
bfd_section_vma (ts));
@@ -7172,7 +7172,7 @@ lang_end (void)
else
{
if (warn)
- einfo (_("%P: warning: cannot find entry symbol %s;"
+ einfo (_("%P: %w: cannot find entry symbol %s;"
" not setting start address\n"),
entry_symbol.name);
}
@@ -7180,7 +7180,7 @@ lang_end (void)
else
{
if (warn)
- einfo (_("%P: warning: cannot find entry symbol %s;"
+ einfo (_("%P: %w: cannot find entry symbol %s;"
" not setting start address\n"),
entry_symbol.name);
}
@@ -7429,7 +7429,7 @@ ldlang_place_orphan (asection *s)
}
if (config.orphan_handling == orphan_handling_warn)
- einfo (_("%P: warning: orphan section `%pA' from `%pB' being "
+ einfo (_("%P: %w: orphan section `%pA' from `%pB' being "
"placed in section `%s'\n"),
s, s->owner, os->name);
}
@@ -8102,7 +8102,7 @@ warn_non_contiguous_discards (void)
for (asection *s = file->the_bfd->sections; s != NULL; s = s->next)
if (s->output_section == NULL
&& (s->flags & SEC_LINKER_CREATED) == 0)
- einfo (_("%P: warning: --enable-non-contiguous-regions "
+ einfo (_("%P: %w: --enable-non-contiguous-regions "
"discards section `%pA' from `%pB'\n"),
s, file->the_bfd);
}
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 9ae541a5d82..6e4cb767033 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -1090,7 +1090,7 @@ multiple_definition (struct bfd_link_info *info,
obfd = NULL;
}
if (info->warn_multiple_definition)
- einfo (_("%P: %C: warning: multiple definition of `%pT'"),
+ einfo (_("%P: %C: %w: multiple definition of `%pT'"),
nbfd, nsec, nval, name);
else
einfo (_("%X%P: %C: multiple definition of `%pT'"),
@@ -1154,11 +1154,11 @@ multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED,
{
ASSERT (otype == bfd_link_hash_common);
if (obfd != NULL)
- einfo (_("%P: %pB: warning: definition of `%pT' overriding common"
+ einfo (_("%P: %pB: %w: definition of `%pT' overriding common"
" from %pB\n"),
nbfd, name, obfd);
else
- einfo (_("%P: %pB: warning: definition of `%pT' overriding common\n"),
+ einfo (_("%P: %pB: %w: definition of `%pT' overriding common\n"),
nbfd, name);
}
else if (otype == bfd_link_hash_defined
@@ -1167,11 +1167,11 @@ multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED,
{
ASSERT (ntype == bfd_link_hash_common);
if (obfd != NULL)
- einfo (_("%P: %pB: warning: common of `%pT' overridden by definition"
+ einfo (_("%P: %pB: %w: common of `%pT' overridden by definition"
" from %pB\n"),
nbfd, name, obfd);
else
- einfo (_("%P: %pB: warning: common of `%pT' overridden by definition\n"),
+ einfo (_("%P: %pB: %w: common of `%pT' overridden by definition\n"),
nbfd, name);
}
else
@@ -1180,32 +1180,32 @@ multiple_common (struct bfd_link_info *info ATTRIBUTE_UNUSED,
if (osize > nsize)
{
if (obfd != NULL)
- einfo (_("%P: %pB: warning: common of `%pT' overridden"
+ einfo (_("%P: %pB: %w: common of `%pT' overridden"
" by larger common from %pB\n"),
nbfd, name, obfd);
else
- einfo (_("%P: %pB: warning: common of `%pT' overridden"
+ einfo (_("%P: %pB: %w: common of `%pT' overridden"
" by larger common\n"),
nbfd, name);
}
else if (nsize > osize)
{
if (obfd != NULL)
- einfo (_("%P: %pB: warning: common of `%pT' overriding"
+ einfo (_("%P: %pB: %w: common of `%pT' overriding"
" smaller common from %pB\n"),
nbfd, name, obfd);
else
- einfo (_("%P: %pB: warning: common of `%pT' overriding"
+ einfo (_("%P: %pB: %w: common of `%pT' overriding"
" smaller common\n"),
nbfd, name);
}
else
{
if (obfd != NULL)
- einfo (_("%P: %pB and %pB: warning: multiple common of `%pT'\n"),
+ einfo (_("%P: %pB and %pB: %w: multiple common of `%pT'\n"),
nbfd, obfd, name);
else
- einfo (_("%P: %pB: warning: multiple common of `%pT'\n"),
+ einfo (_("%P: %pB: %w: multiple common of `%pT'\n"),
nbfd, name);
}
}
@@ -1224,7 +1224,7 @@ add_to_set (struct bfd_link_info *info ATTRIBUTE_UNUSED,
bfd_vma value)
{
if (config.warn_constructors)
- einfo (_("%P: warning: global constructor %s used\n"),
+ einfo (_("%P: %w: global constructor %s used\n"),
h->root.string);
if (!config.build_constructors)
@@ -1260,7 +1260,7 @@ constructor_callback (struct bfd_link_info *info,
char set_name[1 + sizeof "__CTOR_LIST__"];
if (config.warn_constructors)
- einfo (_("%P: warning: global constructor %s used\n"), name);
+ einfo (_("%P: %w: global constructor %s used\n"), name);
if (!config.build_constructors)
return;
@@ -1342,11 +1342,11 @@ warning_callback (struct bfd_link_info *info ATTRIBUTE_UNUSED,
return;
if (section != NULL)
- einfo ("%P: %C: %s%s\n", abfd, section, address, _("warning: "), warning);
+ einfo ("%P: %C: %w: %s\n", abfd, section, address, warning);
else if (abfd == NULL)
- einfo ("%P: %s%s\n", _("warning: "), warning);
+ einfo ("%P: %w: %s\n", warning);
else if (symbol == NULL)
- einfo ("%P: %pB: %s%s\n", abfd, _("warning: "), warning);
+ einfo ("%P: %pB: %w: %s\n", abfd, warning);
else if (!symbol_warning (warning, symbol, abfd))
{
bfd *b;
@@ -1354,7 +1354,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 ("%P: %pB: %s%s\n", abfd, _("warning: "), warning);
+ einfo ("%P: %pB: %w: %s\n", abfd, warning);
}
}
@@ -1397,7 +1397,7 @@ warning_find_reloc (bfd *abfd, asection *sec, void *iarg)
&& strcmp (bfd_asymbol_name (*q->sym_ptr_ptr), info->symbol) == 0)
{
/* We found a reloc for the symbol we are looking for. */
- einfo ("%P: %H: %s%s\n", abfd, sec, q->address, _("warning: "),
+ einfo ("%P: %H: %w: %s\n", abfd, sec, q->address,
info->warning);
info->found = true;
break;
@@ -1490,7 +1490,7 @@ undefined_symbol (struct bfd_link_info *info,
einfo (_("%X%P: %H: undefined reference to `%pT'\n"),
abfd, section, address, name);
else
- einfo (_("%P: %H: warning: undefined reference to `%pT'\n"),
+ einfo (_("%P: %H: %w: undefined reference to `%pT'\n"),
abfd, section, address, name);
}
else if (error_count == MAX_ERRORS_IN_A_ROW)
@@ -1499,7 +1499,7 @@ undefined_symbol (struct bfd_link_info *info,
einfo (_("%X%P: %D: more undefined references to `%pT' follow\n"),
abfd, section, address, name);
else
- einfo (_("%P: %D: warning: more undefined references to `%pT' follow\n"),
+ einfo (_("%P: %D: %w: more undefined references to `%pT' follow\n"),
abfd, section, address, name);
}
else if (error)
@@ -1513,7 +1513,7 @@ undefined_symbol (struct bfd_link_info *info,
einfo (_("%X%P: %pB: undefined reference to `%pT'\n"),
abfd, name);
else
- einfo (_("%P: %pB: warning: undefined reference to `%pT'\n"),
+ einfo (_("%P: %pB: %w: undefined reference to `%pT'\n"),
abfd, name);
}
else if (error_count == MAX_ERRORS_IN_A_ROW)
@@ -1522,7 +1522,7 @@ undefined_symbol (struct bfd_link_info *info,
einfo (_("%X%P: %pB: more undefined references to `%pT' follow\n"),
abfd, name);
else
- einfo (_("%P: %pB: warning: more undefined references to `%pT' follow\n"),
+ einfo (_("%P: %pB: %w: more undefined references to `%pT' follow\n"),
abfd, name);
}
else if (error)
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index 180b24b3448..69290190e6a 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -64,6 +64,7 @@
%s arbitrary string, like printf
%u integer, like printf
%v hex bfd_vma, no leading zeros
+ %w "warning" if --fatal-warnings isn't used or "error" otherwise.
%x integer, like printf
*/
@@ -266,6 +267,11 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning)
}
break;
+ case 'w':
+ fprintf (fp, "%s", (config.fatal_warnings
+ ? _("error") : _("warning")));
+ break;
+
case 'W':
/* hex bfd_vma with 0x with no leading zeroes taking up
10 spaces (including the 0x). */
@@ -687,7 +693,7 @@ output_unknown_cmdline_warnings (void)
if (config.fatal_warnings)
einfo (_("%P: error: unsupported option: %s\n"), list->warning);
else
- einfo (_("%P: warning: %s ignored\n"), list->warning);
+ einfo (_("%P: %w: %s ignored\n"), list->warning);
free (list->warning);
free (list);
}
diff --git a/ld/pdb.c b/ld/pdb.c
index 88639d539b7..bdedc738fbb 100644
--- a/ld/pdb.c
+++ b/ld/pdb.c
@@ -1008,7 +1008,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct datasym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_LDATA32/S_GDATA32/S_LTHREAD32/S_GTHREAD32\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1027,7 +1027,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (name_len == len - offsetof (struct datasym, name))
{
- einfo (_("%P: warning: name for S_LDATA32/S_GDATA32/"
+ einfo (_("%P: %w: name for S_LDATA32/S_GDATA32/"
"S_LTHREAD32/S_GTHREAD32 has no terminating"
" zero\n"));
bfd_set_error (bfd_error_bad_value);
@@ -1075,7 +1075,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct procsym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_GPROC32/S_LPROC32\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1087,7 +1087,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (!endptr)
{
- einfo (_("%P: warning: could not find end of"
+ einfo (_("%P: %w: could not find end of"
" S_GPROC32/S_LPROC32 record\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1113,7 +1113,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (name_len == len - offsetof (struct procsym, name))
{
- einfo (_("%P: warning: name for S_GPROC32/S_LPROC32 has no"
+ einfo (_("%P: %w: name for S_GPROC32/S_LPROC32 has no"
" terminating zero\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1243,7 +1243,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct udtsym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_UDT\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1254,7 +1254,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (name_len == len - offsetof (struct udtsym, name))
{
- einfo (_("%P: warning: name for S_UDT has no"
+ einfo (_("%P: %w: name for S_UDT has no"
" terminating zero\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1291,7 +1291,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct constsym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_CONSTANT\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1308,7 +1308,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (param_len == 0)
{
- einfo (_("%P: warning: unhandled type %v within"
+ einfo (_("%P: %w: unhandled type %v within"
" S_CONSTANT\n"), val);
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1322,7 +1322,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (name_len == len - rec_size)
{
- einfo (_("%P: warning: name for S_CONSTANT has no"
+ einfo (_("%P: %w: name for S_CONSTANT has no"
" terminating zero\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1382,7 +1382,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
break;
default:
- einfo (_("%P: warning: unexpected CodeView scope start"
+ einfo (_("%P: %w: unexpected CodeView scope start"
" record %v\n"), scope_start_type);
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1404,7 +1404,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < sizeof (struct buildinfosym))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_BUILDINFO\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1430,7 +1430,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct blocksym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_BLOCK32\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1442,7 +1442,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (!endptr)
{
- einfo (_("%P: warning: could not find end of"
+ einfo (_("%P: %w: could not find end of"
" S_BLOCK32 record\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1467,7 +1467,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct bprelsym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_BPREL32\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1491,7 +1491,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct regsym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_REGISTER\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1515,7 +1515,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct regrel, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_REGREL32\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1539,7 +1539,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct localsym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_LOCAL\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1565,7 +1565,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct inline_site, binary_annotations))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_INLINESITE\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1577,7 +1577,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (!endptr)
{
- einfo (_("%P: warning: could not find end of"
+ einfo (_("%P: %w: could not find end of"
" S_INLINESITE record\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1610,7 +1610,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < offsetof (struct thunk, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_THUNK32\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1622,7 +1622,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (!endptr)
{
- einfo (_("%P: warning: could not find end of"
+ einfo (_("%P: %w: could not find end of"
" S_THUNK32 record\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1647,7 +1647,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
if (len < sizeof (struct heap_alloc_site))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_HEAPALLOCSITE\n"));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1681,7 +1681,7 @@ parse_symbols (uint8_t *data, uint32_t size, uint8_t **buf,
break;
default:
- einfo (_("%P: warning: unrecognized CodeView record %v\n"), type);
+ einfo (_("%P: %w: unrecognized CodeView record %v\n"), type);
bfd_set_error (bfd_error_bad_value);
return false;
}
@@ -1717,7 +1717,7 @@ calculate_symbols_size (uint8_t *data, uint32_t size, uint32_t *sym_size)
if (len < offsetof (struct datasym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_LDATA32/S_LTHREAD32\n"));
return false;
}
@@ -1745,7 +1745,7 @@ calculate_symbols_size (uint8_t *data, uint32_t size, uint32_t *sym_size)
if (len < offsetof (struct procsym, name))
{
- einfo (_("%P: warning: truncated CodeView record"
+ einfo (_("%P: %w: truncated CodeView record"
" S_GPROC32/S_LPROC32\n"));
return false;
}
@@ -1762,7 +1762,7 @@ calculate_symbols_size (uint8_t *data, uint32_t size, uint32_t *sym_size)
if (!endptr)
{
- einfo (_("%P: warning: could not find end of"
+ einfo (_("%P: %w: could not find end of"
" S_GPROC32/S_LPROC32 record\n"));
return false;
}
@@ -1825,7 +1825,7 @@ calculate_symbols_size (uint8_t *data, uint32_t size, uint32_t *sym_size)
break;
default:
- einfo (_("%P: warning: unrecognized CodeView record %v\n"), type);
+ einfo (_("%P: %w: unrecognized CodeView record %v\n"), type);
return false;
}
@@ -2219,7 +2219,7 @@ handle_udt_src_line (uint8_t *data, uint16_t size, struct type_entry **map,
if (size < sizeof (struct lf_udt_src_line))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_UDT_SRC_LINE\n"));
return false;
}
@@ -2232,7 +2232,7 @@ handle_udt_src_line (uint8_t *data, uint16_t size, struct type_entry **map,
orig_type >= TPI_FIRST_INDEX + num_types ||
!map[orig_type - TPI_FIRST_INDEX])
{
- einfo (_("%P: warning: CodeView type record LF_UDT_SRC_LINE"
+ einfo (_("%P: %w: CodeView type record LF_UDT_SRC_LINE"
" referred to unknown type %v\n"), orig_type);
return false;
}
@@ -2254,7 +2254,7 @@ handle_udt_src_line (uint8_t *data, uint16_t size, struct type_entry **map,
source_file_type >= TPI_FIRST_INDEX + num_types ||
!map[source_file_type - TPI_FIRST_INDEX])
{
- einfo (_("%P: warning: CodeView type record LF_UDT_SRC_LINE"
+ einfo (_("%P: %w: CodeView type record LF_UDT_SRC_LINE"
" referred to unknown string %v\n"), source_file_type);
return false;
}
@@ -2263,7 +2263,7 @@ handle_udt_src_line (uint8_t *data, uint16_t size, struct type_entry **map,
if (bfd_getl16 (str_e->data + sizeof (uint16_t)) != LF_STRING_ID)
{
- einfo (_("%P: warning: CodeView type record LF_UDT_SRC_LINE"
+ einfo (_("%P: %w: CodeView type record LF_UDT_SRC_LINE"
" pointed to unexpected record type\n"));
return false;
}
@@ -2312,7 +2312,7 @@ handle_udt_src_line (uint8_t *data, uint16_t size, struct type_entry **map,
if (*slot)
{
free (e);
- einfo (_("%P: warning: duplicate CodeView type record "
+ einfo (_("%P: %w: duplicate CodeView type record "
"LF_UDT_MOD_SRC_LINE\n"));
return false;
}
@@ -2361,7 +2361,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_modifier, modifier))
{
- einfo (_("%P: warning: truncated CodeView type record "
+ einfo (_("%P: %w: truncated CodeView type record "
"LF_MODIFIER\n"));
return false;
}
@@ -2378,7 +2378,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_pointer, attributes))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_POINTER\n"));
return false;
}
@@ -2395,7 +2395,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < sizeof (struct lf_procedure))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_PROCEDURE\n"));
return false;
}
@@ -2415,7 +2415,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < sizeof (struct lf_procedure))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_MFUNCTION\n"));
return false;
}
@@ -2443,7 +2443,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_arglist, args))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_ARGLIST\n"));
return false;
}
@@ -2453,7 +2453,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_arglist, args)
+ (num_entries * sizeof (uint32_t)))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_ARGLIST\n"));
return false;
}
@@ -2478,7 +2478,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < sizeof (uint16_t))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_FIELDLIST\n"));
return false;
}
@@ -2495,7 +2495,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < offsetof (struct lf_member, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_MEMBER\n"));
return false;
}
@@ -2514,7 +2514,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (param_len == 0)
{
- einfo (_("%P: warning: unhandled type %v within"
+ einfo (_("%P: %w: unhandled type %v within"
" LF_MEMBER\n"), offset);
return false;
}
@@ -2523,7 +2523,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_MEMBER\n"));
return false;
}
@@ -2534,7 +2534,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == left - offsetof (struct lf_member, name))
{
- einfo (_("%P: warning: name for LF_MEMBER has no"
+ einfo (_("%P: %w: name for LF_MEMBER has no"
" terminating zero\n"));
return false;
}
@@ -2548,7 +2548,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_FIELDLIST\n"));
return false;
}
@@ -2567,7 +2567,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < offsetof (struct lf_enumerate, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_ENUMERATE\n"));
return false;
}
@@ -2583,14 +2583,14 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (param_len == 0)
{
- einfo (_("%P: warning: unhandled type %v within"
+ einfo (_("%P: %w: unhandled type %v within"
" LF_ENUMERATE\n"), val);
return false;
}
if (left < subtype_len + param_len)
{
- einfo (_("%P: warning: truncated CodeView type"
+ einfo (_("%P: %w: truncated CodeView type"
" record LF_ENUMERATE\n"));
return false;
}
@@ -2603,7 +2603,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == left - offsetof (struct lf_enumerate, name))
{
- einfo (_("%P: warning: name for LF_ENUMERATE has no"
+ einfo (_("%P: %w: name for LF_ENUMERATE has no"
" terminating zero\n"));
return false;
}
@@ -2617,7 +2617,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_ENUMERATE\n"));
return false;
}
@@ -2634,7 +2634,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < sizeof (struct lf_index))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_INDEX\n"));
return false;
}
@@ -2655,7 +2655,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < offsetof (struct lf_onemethod, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_ONEMETHOD\n"));
return false;
}
@@ -2670,7 +2670,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == left - offsetof (struct lf_onemethod, name))
{
- einfo (_("%P: warning: name for LF_ONEMETHOD has no"
+ einfo (_("%P: %w: name for LF_ONEMETHOD has no"
" terminating zero\n"));
return false;
}
@@ -2685,7 +2685,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_FIELDLIST\n"));
return false;
}
@@ -2703,7 +2703,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < offsetof (struct lf_method, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_METHOD\n"));
return false;
}
@@ -2718,7 +2718,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == left - offsetof (struct lf_method, name))
{
- einfo (_("%P: warning: name for LF_METHOD has no"
+ einfo (_("%P: %w: name for LF_METHOD has no"
" terminating zero\n"));
return false;
}
@@ -2732,7 +2732,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_FIELDLIST\n"));
return false;
}
@@ -2751,7 +2751,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < sizeof (struct lf_bclass))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_BCLASS\n"));
return false;
}
@@ -2771,7 +2771,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (param_len == 0)
{
- einfo (_("%P: warning: unhandled type %v within"
+ einfo (_("%P: %w: unhandled type %v within"
" LF_BCLASS\n"), offset);
return false;
}
@@ -2780,7 +2780,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_BCLASS\n"));
return false;
}
@@ -2791,7 +2791,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_BCLASS\n"));
return false;
}
@@ -2808,7 +2808,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < sizeof (struct lf_vfunctab))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_VFUNCTAB\n"));
return false;
}
@@ -2831,7 +2831,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < sizeof (struct lf_vbclass))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_VBCLASS/LF_IVBCLASS\n"));
return false;
}
@@ -2856,7 +2856,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (param_len == 0)
{
- einfo (_("%P: warning: unhandled type %v within"
+ einfo (_("%P: %w: unhandled type %v within"
" LF_VBCLASS/LF_IVBCLASS\n"), offset);
return false;
}
@@ -2865,7 +2865,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_VBCLASS/LF_IVBCLASS\n"));
return false;
}
@@ -2881,7 +2881,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (param_len == 0)
{
- einfo (_("%P: warning: unhandled type %v within"
+ einfo (_("%P: %w: unhandled type %v within"
" LF_VBCLASS/LF_IVBCLASS\n"), offset);
return false;
}
@@ -2890,7 +2890,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_VBCLASS/LF_IVBCLASS\n"));
return false;
}
@@ -2901,7 +2901,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_VBCLASS/LF_IVBCLASS\n"));
return false;
}
@@ -2920,7 +2920,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < offsetof (struct lf_static_member, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_STMEMBER\n"));
return false;
}
@@ -2935,7 +2935,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == left
- offsetof (struct lf_static_member, name))
{
- einfo (_("%P: warning: name for LF_STMEMBER has no"
+ einfo (_("%P: %w: name for LF_STMEMBER has no"
" terminating zero\n"));
return false;
}
@@ -2950,7 +2950,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_FIELDLIST\n"));
return false;
}
@@ -2968,7 +2968,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < offsetof (struct lf_nest_type, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_NESTTYPE\n"));
return false;
}
@@ -2982,7 +2982,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == left - offsetof (struct lf_nest_type, name))
{
- einfo (_("%P: warning: name for LF_NESTTYPE has no"
+ einfo (_("%P: %w: name for LF_NESTTYPE has no"
" terminating zero\n"));
return false;
}
@@ -2997,7 +2997,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (left < subtype_len)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_FIELDLIST\n"));
return false;
}
@@ -3009,7 +3009,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
}
default:
- einfo (_("%P: warning: unrecognized CodeView subtype %v\n"),
+ einfo (_("%P: %w: unrecognized CodeView subtype %v\n"),
subtype);
return false;
}
@@ -3024,7 +3024,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_bitfield, length))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_BITFIELD\n"));
return false;
}
@@ -3042,7 +3042,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_methodlist, entries))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_METHODLIST\n"));
return false;
}
@@ -3050,7 +3050,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if ((size - offsetof (struct lf_methodlist, entries))
% sizeof (struct lf_methodlist_entry))
{
- einfo (_("%P: warning: malformed CodeView type record"
+ einfo (_("%P: %w: malformed CodeView type record"
" LF_METHODLIST\n"));
return false;
}
@@ -3074,7 +3074,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_array, length_in_bytes))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_ARRAY\n"));
return false;
}
@@ -3097,7 +3097,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_class, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_CLASS/LF_STRUCTURE\n"));
return false;
}
@@ -3122,7 +3122,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (param_len == 0)
{
- einfo (_("%P: warning: unhandled type %v within"
+ einfo (_("%P: %w: unhandled type %v within"
" LF_CLASS/LF_STRUCTURE\n"), num_bytes);
return false;
}
@@ -3131,7 +3131,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < name_off)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_CLASS/LF_STRUCTURE\n"));
return false;
}
@@ -3141,7 +3141,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == size - name_off)
{
- einfo (_("%P: warning: name for LF_CLASS/LF_STRUCTURE has no"
+ einfo (_("%P: %w: name for LF_CLASS/LF_STRUCTURE has no"
" terminating zero\n"));
return false;
}
@@ -3160,7 +3160,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (unique_name_len == size - len)
{
- einfo (_("%P: warning: unique name for LF_CLASS/LF_STRUCTURE"
+ einfo (_("%P: %w: unique name for LF_CLASS/LF_STRUCTURE"
" has no terminating zero\n"));
return false;
}
@@ -3184,7 +3184,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_union, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_UNION\n"));
return false;
}
@@ -3203,7 +3203,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (param_len == 0)
{
- einfo (_("%P: warning: unhandled type %v within"
+ einfo (_("%P: %w: unhandled type %v within"
" LF_UNION\n"), num_bytes);
return false;
}
@@ -3212,7 +3212,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < name_off)
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_UNION\n"));
return false;
}
@@ -3222,7 +3222,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == size - name_off)
{
- einfo (_("%P: warning: name for LF_UNION has no"
+ einfo (_("%P: %w: name for LF_UNION has no"
" terminating zero\n"));
return false;
}
@@ -3241,7 +3241,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (unique_name_len == size - len)
{
- einfo (_("%P: warning: unique name for LF_UNION has"
+ einfo (_("%P: %w: unique name for LF_UNION has"
" no terminating zero\n"));
return false;
}
@@ -3265,7 +3265,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_enum, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_ENUM\n"));
return false;
}
@@ -3280,7 +3280,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == size - offsetof (struct lf_enum, name))
{
- einfo (_("%P: warning: name for LF_ENUM has no"
+ einfo (_("%P: %w: name for LF_ENUM has no"
" terminating zero\n"));
return false;
}
@@ -3298,7 +3298,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (unique_name_len == size - len)
{
- einfo (_("%P: warning: unique name for LF_ENUM has"
+ einfo (_("%P: %w: unique name for LF_ENUM has"
" no terminating zero\n"));
return false;
}
@@ -3317,7 +3317,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_vftable, names))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_VFTABLE\n"));
return false;
}
@@ -3338,7 +3338,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_string_id, string))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_STRING_ID\n"));
return false;
}
@@ -3351,7 +3351,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (string_len == size - offsetof (struct lf_string_id, string))
{
- einfo (_("%P: warning: string for LF_STRING_ID has no"
+ einfo (_("%P: %w: string for LF_STRING_ID has no"
" terminating zero\n"));
return false;
}
@@ -3368,7 +3368,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_arglist, args))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_SUBSTR_LIST\n"));
return false;
}
@@ -3378,7 +3378,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_arglist, args)
+ (num_entries * sizeof (uint32_t)))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_SUBSTR_LIST\n"));
return false;
}
@@ -3401,7 +3401,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_build_info, strings))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_BUILDINFO\n"));
return false;
}
@@ -3411,7 +3411,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_build_info, strings)
+ (num_entries * sizeof (uint32_t)))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_BUILDINFO\n"));
return false;
}
@@ -3434,7 +3434,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_func_id, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_FUNC_ID\n"));
return false;
}
@@ -3450,7 +3450,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == size - offsetof (struct lf_func_id, name))
{
- einfo (_("%P: warning: string for LF_FUNC_ID has no"
+ einfo (_("%P: %w: string for LF_FUNC_ID has no"
" terminating zero\n"));
return false;
}
@@ -3467,7 +3467,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (size < offsetof (struct lf_mfunc_id, name))
{
- einfo (_("%P: warning: truncated CodeView type record"
+ einfo (_("%P: %w: truncated CodeView type record"
" LF_MFUNC_ID\n"));
return false;
}
@@ -3483,7 +3483,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
if (name_len == size - offsetof (struct lf_mfunc_id, name))
{
- einfo (_("%P: warning: string for LF_MFUNC_ID has no"
+ einfo (_("%P: %w: string for LF_MFUNC_ID has no"
" terminating zero\n"));
return false;
}
@@ -3498,7 +3498,7 @@ handle_type (uint8_t *data, struct type_entry **map, uint32_t type_num,
ids, mod_num, strings);
default:
- einfo (_("%P: warning: unrecognized CodeView type %v\n"), type);
+ einfo (_("%P: %w: unrecognized CodeView type %v\n"), type);
return false;
}
@@ -3672,7 +3672,7 @@ create_linker_symbols (bfd *abfd, uint8_t **syms, uint32_t *sym_byte_size,
cwdval = getcwd (NULL, 0);
if (!cwdval)
{
- einfo (_("%P: warning: unable to get working directory\n"));
+ einfo (_("%P: %w: unable to get working directory\n"));
return false;
}
@@ -3680,7 +3680,7 @@ create_linker_symbols (bfd *abfd, uint8_t **syms, uint32_t *sym_byte_size,
if (!exeval)
{
- einfo (_("%P: warning: unable to get program name\n"));
+ einfo (_("%P: %w: unable to get program name\n"));
free (cwdval);
return false;
}
@@ -3689,7 +3689,7 @@ create_linker_symbols (bfd *abfd, uint8_t **syms, uint32_t *sym_byte_size,
if (!pdbval)
{
- einfo (_("%P: warning: unable to get full path to PDB\n"));
+ einfo (_("%P: %w: unable to get full path to PDB\n"));
free (exeval);
free (cwdval);
return false;
@@ -5145,7 +5145,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
pdb = bfd_openw (pdb_name, "pdb");
if (!pdb)
{
- einfo (_("%P: warning: cannot create PDB file: %E\n"));
+ einfo (_("%P: %w: cannot create PDB file: %E\n"));
return false;
}
@@ -5160,7 +5160,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!create_old_directory_stream (pdb))
{
- einfo (_("%P: warning: cannot create old directory stream "
+ einfo (_("%P: %w: cannot create old directory stream "
"in PDB file: %E\n"));
goto end;
}
@@ -5169,7 +5169,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!info_stream)
{
- einfo (_("%P: warning: cannot create info stream "
+ einfo (_("%P: %w: cannot create info stream "
"in PDB file: %E\n"));
goto end;
}
@@ -5178,7 +5178,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!tpi_stream)
{
- einfo (_("%P: warning: cannot create TPI stream "
+ einfo (_("%P: %w: cannot create TPI stream "
"in PDB file: %E\n"));
goto end;
}
@@ -5187,7 +5187,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!dbi_stream)
{
- einfo (_("%P: warning: cannot create DBI stream "
+ einfo (_("%P: %w: cannot create DBI stream "
"in PDB file: %E\n"));
goto end;
}
@@ -5196,7 +5196,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!ipi_stream)
{
- einfo (_("%P: warning: cannot create IPI stream "
+ einfo (_("%P: %w: cannot create IPI stream "
"in PDB file: %E\n"));
goto end;
}
@@ -5205,7 +5205,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!names_stream)
{
- einfo (_("%P: warning: cannot create /names stream "
+ einfo (_("%P: %w: cannot create /names stream "
"in PDB file: %E\n"));
goto end;
}
@@ -5214,7 +5214,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!sym_rec_stream)
{
- einfo (_("%P: warning: cannot create symbol record stream "
+ einfo (_("%P: %w: cannot create symbol record stream "
"in PDB file: %E\n"));
goto end;
}
@@ -5223,14 +5223,14 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!publics_stream)
{
- einfo (_("%P: warning: cannot create publics stream "
+ einfo (_("%P: %w: cannot create publics stream "
"in PDB file: %E\n"));
goto end;
}
if (!create_section_header_stream (pdb, abfd, §ion_header_stream_num))
{
- einfo (_("%P: warning: cannot create section header stream "
+ einfo (_("%P: %w: cannot create section header stream "
"in PDB file: %E\n"));
goto end;
}
@@ -5249,7 +5249,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
sym_rec_stream_num, publics_stream_num,
&strings, &types, &ids, sym_rec_stream, pdb_name))
{
- einfo (_("%P: warning: cannot populate DBI stream "
+ einfo (_("%P: %w: cannot populate DBI stream "
"in PDB file: %E\n"));
htab_delete (types.hashmap);
htab_delete (ids.hashmap);
@@ -5258,7 +5258,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!populate_type_stream (pdb, tpi_stream, &types))
{
- einfo (_("%P: warning: cannot populate TPI stream "
+ einfo (_("%P: %w: cannot populate TPI stream "
"in PDB file: %E\n"));
htab_delete (types.hashmap);
htab_delete (ids.hashmap);
@@ -5269,7 +5269,7 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!populate_type_stream (pdb, ipi_stream, &ids))
{
- einfo (_("%P: warning: cannot populate IPI stream "
+ einfo (_("%P: %w: cannot populate IPI stream "
"in PDB file: %E\n"));
htab_delete (ids.hashmap);
goto end;
@@ -5281,21 +5281,21 @@ create_pdb_file (bfd *abfd, const char *pdb_name, const unsigned char *guid)
if (!populate_names_stream (names_stream, &strings))
{
- einfo (_("%P: warning: cannot populate names stream "
+ einfo (_("%P: %w: cannot populate names stream "
"in PDB file: %E\n"));
goto end;
}
if (!populate_publics_stream (publics_stream, abfd, sym_rec_stream))
{
- einfo (_("%P: warning: cannot populate publics stream "
+ einfo (_("%P: %w: cannot populate publics stream "
"in PDB file: %E\n"));
goto end;
}
if (!populate_info_stream (pdb, info_stream, guid))
{
- einfo (_("%P: warning: cannot populate info stream "
+ einfo (_("%P: %w: cannot populate info stream "
"in PDB file: %E\n"));
goto end;
}
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 95eef84f607..ea48fc6dced 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -1493,7 +1493,7 @@ pe_find_data_imports (const char *symhead,
/* PR linker/4844. */
if (!warned)
{
- einfo (_("%P: warning: auto-importing has been activated "
+ einfo (_("%P: %w: auto-importing has been activated "
"without --enable-auto-import specified on the "
"command line; this should work unless it "
"involves constant data structures referencing "
diff --git a/ld/testsuite/ld-elf/fatal-warnings-5.d b/ld/testsuite/ld-elf/fatal-warnings-5.d
new file mode 100644
index 00000000000..dd5d430e878
--- /dev/null
+++ b/ld/testsuite/ld-elf/fatal-warnings-5.d
@@ -0,0 +1,6 @@
+#source: start.s
+#source: symbol1ref.s
+#source: symbol1w.s
+#ld: -T group.ld --no-warn-rwx-segments --fatal-warnings
+#error: .*: error: witty one-liner
+#xfail: [is_generic]
diff --git a/ld/testsuite/ld-i386/pr28894.d b/ld/testsuite/ld-i386/pr28894.d
index a8d1111eb1f..cd667df39c6 100644
--- a/ld/testsuite/ld-i386/pr28894.d
+++ b/ld/testsuite/ld-i386/pr28894.d
@@ -1,3 +1,3 @@
#as: --32
#ld: -shared -melf_i386 --warn-shared-textrel --fatal-warnings
-#error: .*warning: creating DT_TEXTREL in a shared object
+#error: .*error: creating DT_TEXTREL in a shared object
diff --git a/ld/testsuite/ld-i386/warn1.d b/ld/testsuite/ld-i386/warn1.d
index c00fdb36dc1..5f4a967f23c 100644
--- a/ld/testsuite/ld-i386/warn1.d
+++ b/ld/testsuite/ld-i386/warn1.d
@@ -1,4 +1,4 @@
#name: --warn-shared-textrel --fatal-warnings
#as: --32
#ld: -shared -melf_i386 --warn-shared-textrel --fatal-warnings
-#error: .*warning: creating DT_TEXTREL in a shared object
+#error: .*error: creating DT_TEXTREL in a shared object
diff --git a/ld/testsuite/ld-scripts/defined.exp b/ld/testsuite/ld-scripts/defined.exp
index bc1ed082d25..7182de4103b 100644
--- a/ld/testsuite/ld-scripts/defined.exp
+++ b/ld/testsuite/ld-scripts/defined.exp
@@ -67,6 +67,7 @@ run_dump_test "defined3"
run_dump_test "defined4"
if ![is_aout_format] {
run_dump_test "defined5"
+ run_dump_test "defined7"
}
if [is_elf_format] {
run_dump_test "defined6"
diff --git a/ld/testsuite/ld-scripts/defined7.d b/ld/testsuite/ld-scripts/defined7.d
new file mode 100644
index 00000000000..fefeb31224f
--- /dev/null
+++ b/ld/testsuite/ld-scripts/defined7.d
@@ -0,0 +1,3 @@
+#source: defined5.s
+#ld: -Tdefined5.t --no-error-rwx-segments --no-warn-execstack --fatal-warnings
+#error: .*: error: multiple definition of `defined'.*
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] bfd: Output error for linker --fatal-warnings option
2024-01-26 21:46 [PATCH v2 0/2] ld: Output error for warnings with --fatal-warnings H.J. Lu
2024-01-26 21:46 ` [PATCH v2 1/2] ld: Output error for linker " H.J. Lu
@ 2024-01-26 21:46 ` H.J. Lu
1 sibling, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2024-01-26 21:46 UTC (permalink / raw)
To: binutils
Update _bfd_error_handler to output the warning prefix, which is default
to "warning". Add %%w to _bfd_doprnt to output "error", instead of
"warning", when --fatal-warnings is used. Update bfd_set_error_handler
to allow linker to set the warning prefix to "error" for --fatal-warnings.
Call bfd_set_error_handler after parsing all linker command-line arguments
so that config.fatal_warnings will be set for --fatal-warnings.
bfd/
* archive.c (_bfd_write_archive_contents): Pass %%w, instead of
"warning", to _bfd_error_handler.
* binary.c (binary_set_section_contents): Likewise.
* coff-arm.c (coff_arm_relocate_section): Likewise.
(coff_arm_merge_private_bfd_data): Likewise.
(_bfd_coff_arm_set_private_flags): Likewise.
(coff_arm_copy_private_bfd_data): Likewise.
* coff-go32.c (_bfd_go32_swap_scnhdr_out): Likewise.
* coff-mcore.c (coff_mcore_relocate_section): Likewise.
* coff-sh.c (sh_relax_section): Likewise.
* coff-tic30.c (reloc_processing): Likewise.
* coff-tic4x.c (tic4x_reloc_processing): Likewise.
* coff-tic54x.c (tic54x_reloc_processing): Likewise.
* coff-z80.c (reloc_processing): Likewise.
* coff-z8k.c (reloc_processing): Likewise.
* coffcode.h (fill_comdat_hash): Likewise.
(handle_COMDAT): Likewise.
(styp_to_sec_flags): Likewise.
(coff_set_alignment_hook): Likewise.
(coff_write_object_contents): Likewise.
(coff_slurp_line_table): Likewise.
(coff_classify_symbol): Likewise.
(coff_slurp_reloc_table): Likewise.
* coffgen.c (coff_write_symbols): Likewise.
(bfd_coff_gc_sections): Likewise.
* cofflink.c (coff_link_add_symbols): Likewise.
(_bfd_coff_write_global_sym): Likewise.
* coffswap.h (coff_swap_scnhdr_out): Likewise.
* cpu-arm.c (bfd_arm_update_notes): Likewise.
* cpu-m68k.c (bfd_m68k_compatible): Likewise.
* ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
* elf-properties.c (_bfd_elf_parse_gnu_properties): Likewise.
* elf-s390-common.c (elf_s390_merge_obj_attributes): Likewise.
* elf.c (bfd_section_from_shdr): Likewise.
(elf_fake_sections): Likewise.
(assign_file_positions_for_non_load_sections): Likewise.
(assign_file_positions_except_relocs): Likewise.
(rewrite_elf_program_header): Likewise.
(copy_private_bfd_data): Likewise.
(elfcore_grok_win32pstatus): Likewise.
* elf32-arc.c (arc_elf_merge_attributes): Likewise.
(arc_elf_object_p): Likewise.
(elf_arc_relocate_section): Likewise.
(elf32_arc_obj_attrs_handle_unknown): Likewise.
* elf32-arm.c (arm_type_of_stub): Likewise.
(bfd_elf32_arm_set_vfp11_fix): Likewise.
(bfd_elf32_arm_set_stm32l4xx_fix): Likewise.
(elf32_thumb_to_arm_stub): Likewise.
(elf32_arm_create_thumb_stub): Likewise.
(elf32_arm_populate_plt_entry): Likewise.
(elf32_arm_final_link_relocate): Likewise.
(elf32_arm_set_private_flags): Likewise.
(elf32_arm_copy_private_bfd_data): Likewise.
(elf32_arm_obj_attrs_handle_unknown): Likewise.
(elf32_arm_merge_eabi_attributes): Likewise.
(elf32_arm_merge_private_bfd_data): Likewise.
* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
* elf32-csky.c (csky_find_arch_with_eflag): Likewise.
(csky_find_arch_with_name): Likewise.
(elf32_csky_merge_attributes): Likewise.
(csky_elf_merge_private_bfd_data): Likewise.
* elf32-msp430.c (elf32_msp430_obj_attrs_handle_unknown):
Likewise.
* elf32-nds32.c (nds32_elf_relocate_section): Likewise.
(nds32_elf_merge_private_bfd_data): Likewise.
(relax_range_measurement): Likewise.
* elf32-ppc.c (ppc_elf_begin_write_processing): Likewise.
(ppc_elf_tls_optimize): Likewise.
* elf32-rl78.c (rl78_elf_relocate_section): Likewise.
* elf32-rx.c (rx_elf_relocate_section): Likewise.
* elf32-score.c (s3_elf32_score_merge_private_bfd_data):
Likewise.
* elf32-score7.c (s7_elf32_score_merge_private_bfd_data):
Likewise.
* elf32-sh.c (sh_elf_relax_section): Likewise.
* elf32-spu.c (needs_ovl_stub): Likewise.
* elf32-tic6x.c (elf32_tic6x_final_link): Likewise.
(elf32_tic6x_obj_attrs_handle_unknown): Likewise.
(elf32_tic6x_merge_attributes): Likewise.
* elf32-v850.c (v850_elf_relax_section): Likewise.
* elf32-vax.c (elf_vax_check_relocs): Likewise.
* elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
(elf64_alpha_relax_with_lituse): Likewise.
* elf64-ia64-vms.c (elf64_vms_link_add_object_symbols): Likewise.
* elf64-ppc.c (ppc64_elf_reloc_name_lookup): Likewise.
(ppc64_elf_tls_setup): Likewise.
(ppc64_elf_tls_optimize): Likewise.
(ppc64_elf_size_dynamic_sections): Likewise.
* elfcode.h (elf_swap_shdr_in): Likewise.
(elf_object_p): Likewise.
* elfcore.h (elf_core_file_p): Likewise.
* elflink.c (_bfd_elf_adjust_dynamic_symbol): Likewise.
(bfd_elf_size_dynamic_sections): Likewise.
(bfd_elf_final_link): Likewise.
(bfd_elf_gc_sections): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Likewise.
* elfnn-loongarch.c (loongarch_reloc_is_fatal): Likewise.
* elfnn-riscv.c (riscv_make_plt_header): Likewise.
(riscv_make_plt_entry): Likewise.
(riscv_elf_relocate_section): Likewise.
(riscv_merge_attributes): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation):
Likewise.
(_bfd_aarch64_elf_link_setup_gnu_properties): Likewise.
* elfxx-mips.c (_bfd_mips_elf_section_processing): Likewise.
(_bfd_mips_elf_section_from_shdr): Likewise.
(_bfd_mips_elf_check_relocs): Likewise.
(mips_elf_merge_obj_e_flags): Likewise.
(mips_elf_merge_obj_attributes): Likewise.
(_bfd_mips_elf_merge_private_bfd_data): Likewise.
* mmo.c (mmo_write_symbols_and_terminator): Likewise.
* xcofflink.c (xcoff_build_ldsym): Likewise.
* bfd.c (warning_prefix): New.
(_bfd_doprnt): Initialize warning_prefix to _("warning"). Print
warning_prefix for %%w.
(bfd_set_error_handler): Add a const char * argument to set
warning_prefix if it isn't NULL.
(_bfd_set_error_handler_caching): Pass NULL to
bfd_set_error_handler.
* format.c (bfd_check_format_matches): Likewise.
* bfd-in2.h: Regenerated.
ld/
* ldlang.c (lang_check): Pass NULL to bfd_set_error_handler.
* ldmain.c (main): Call bfd_set_error_handler after calling
parse_args. Pass _("error") or NULL to bfd_set_error_handler,
depending on if --fatal-warnings is used.
* testsuite/ld-elf/note-4.l: New file.
* testsuite/ld-elf/shared.exp: Add a test for broken linker
script with --fatal-warnings.
---
bfd/archive.c | 2 +-
bfd/bfd-in2.h | 3 ++-
bfd/bfd.c | 34 +++++++++++++++++++-------
bfd/binary.c | 2 +-
bfd/coff-arm.c | 14 +++++------
bfd/coff-go32.c | 2 +-
bfd/coff-mcore.c | 2 +-
bfd/coff-sh.c | 14 +++++------
bfd/coff-tic30.c | 2 +-
bfd/coff-tic4x.c | 2 +-
bfd/coff-tic54x.c | 2 +-
bfd/coff-z80.c | 2 +-
bfd/coff-z8k.c | 2 +-
bfd/coffcode.h | 26 ++++++++++----------
bfd/coffgen.c | 7 +++---
bfd/cofflink.c | 6 ++---
bfd/coffswap.h | 2 +-
bfd/cpu-arm.c | 2 +-
bfd/cpu-m68k.c | 2 +-
bfd/ecoff.c | 2 +-
bfd/elf-properties.c | 10 ++++----
bfd/elf-s390-common.c | 6 ++---
bfd/elf.c | 24 +++++++++----------
bfd/elf32-arc.c | 8 +++----
bfd/elf32-arm.c | 44 +++++++++++++++++-----------------
bfd/elf32-bfin.c | 2 +-
bfd/elf32-csky.c | 8 +++----
bfd/elf32-msp430.c | 2 +-
bfd/elf32-nds32.c | 18 +++++++-------
bfd/elf32-ppc.c | 4 ++--
bfd/elf32-rl78.c | 2 +-
bfd/elf32-rx.c | 6 ++---
bfd/elf32-score.c | 2 +-
bfd/elf32-score7.c | 2 +-
bfd/elf32-sh.c | 14 +++++------
bfd/elf32-spu.c | 2 +-
bfd/elf32-tic6x.c | 10 ++++----
bfd/elf32-v850.c | 14 +++++------
bfd/elf32-vax.c | 8 +++----
bfd/elf64-alpha.c | 4 ++--
bfd/elf64-ia64-vms.c | 8 +++----
bfd/elf64-ppc.c | 10 ++++----
bfd/elfcode.h | 6 ++---
bfd/elfcore.h | 2 +-
bfd/elflink.c | 26 ++++++++++----------
bfd/elfnn-aarch64.c | 4 ++--
bfd/elfnn-loongarch.c | 2 +-
bfd/elfnn-riscv.c | 10 ++++----
bfd/elfxx-aarch64.c | 4 ++--
bfd/elfxx-mips.c | 34 +++++++++++++-------------
bfd/format.c | 7 +++---
bfd/mmo.c | 2 +-
bfd/xcofflink.c | 2 +-
ld/ldlang.c | 4 ++--
ld/ldmain.c | 9 ++++---
ld/testsuite/ld-elf/note-4.l | 2 ++
ld/testsuite/ld-elf/shared.exp | 5 ++++
57 files changed, 244 insertions(+), 213 deletions(-)
create mode 100644 ld/testsuite/ld-elf/note-4.l
diff --git a/bfd/archive.c b/bfd/archive.c
index 9f3fbce9bc9..16c465261c6 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -2291,7 +2291,7 @@ _bfd_write_archive_contents (bfd *arch)
if (bfd_update_armap_timestamp (arch))
break;
_bfd_error_handler
- (_("warning: writing archive was slow: rewriting timestamp"));
+ (_("%%w: writing archive was slow: rewriting timestamp"));
}
while (++tries < 6);
}
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 581d8fe0b3e..0ca7db6ba5f 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2559,7 +2559,8 @@ typedef void (*bfd_error_handler_type) (const char *, va_list);
void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
-bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
+bfd_error_handler_type bfd_set_error_handler
+ (bfd_error_handler_type, const char *);
void bfd_set_error_program_name (const char *);
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 0776145af52..e65b1522d71 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -964,6 +964,9 @@ CODE_FRAGMENT
static const char *_bfd_error_program_name;
+/* warning: or error: */
+static const char *warning_prefix = NULL;
+
/* Support for positional parameters. */
union _bfd_doprnt_args
@@ -1011,6 +1014,9 @@ _bfd_doprnt (print_func print, void *stream, const char *format,
int total_printed = 0;
unsigned int arg_count = 0;
+ if (warning_prefix == NULL)
+ warning_prefix = _("warning");
+
while (*ptr != '\0')
{
int result;
@@ -1027,9 +1033,18 @@ _bfd_doprnt (print_func print, void *stream, const char *format,
}
else if (ptr[1] == '%')
{
- fputc ('%', stream);
- result = 1;
- ptr += 2;
+ if (ptr[2] == 'w')
+ {
+ /* Print warning_prefix for %%w. */
+ result = print (stream, "%s", warning_prefix);
+ ptr += 3;
+ }
+ else
+ {
+ fputc ('%', stream);
+ result = 1;
+ ptr += 2;
+ }
}
else
{
@@ -1575,20 +1590,23 @@ FUNCTION
bfd_set_error_handler
SYNOPSIS
- bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
+ bfd_error_handler_type bfd_set_error_handler
+ (bfd_error_handler_type, const char *);
DESCRIPTION
- Set the BFD error handler function. Returns the previous
- function.
+ Set the BFD error handler function and the warning prefix.
+ Returns the previous function.
*/
bfd_error_handler_type
-bfd_set_error_handler (bfd_error_handler_type pnew)
+bfd_set_error_handler (bfd_error_handler_type pnew, const char *prefix)
{
bfd_error_handler_type pold;
pold = _bfd_error_internal;
_bfd_error_internal = pnew;
+ if (prefix != NULL)
+ warning_prefix = prefix;
return pold;
}
@@ -1608,7 +1626,7 @@ bfd_error_handler_type
_bfd_set_error_handler_caching (bfd *abfd)
{
error_handler_bfd = abfd;
- return bfd_set_error_handler (error_handler_sprintf);
+ return bfd_set_error_handler (error_handler_sprintf, NULL);
}
/*
diff --git a/bfd/binary.c b/bfd/binary.c
index a99d5d8f587..cef70e24993 100644
--- a/bfd/binary.c
+++ b/bfd/binary.c
@@ -274,7 +274,7 @@ binary_set_section_contents (bfd *abfd,
if (s->filepos < 0)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: writing section `%pA' at huge (ie negative) "
+ (_("%%w: writing section `%pA' at huge (ie negative) "
"file offset"),
s);
}
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index d4d129f7d47..a92e85040f4 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -1369,7 +1369,7 @@ coff_arm_relocate_section (bfd *output_bfd,
&& ! INTERWORK_FLAG (h_sec->owner))
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%s): warning: interworking not enabled; "
+ (_("%pB(%s): %%w: interworking not enabled; "
"first occurrence: %pB: arm call to thumb"),
h_sec->owner, name, input_bfd);
@@ -1459,7 +1459,7 @@ coff_arm_relocate_section (bfd *output_bfd,
&& ! globals->support_old_code)
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%s): warning: interworking not enabled; "
+ (_("%pB(%s): %%w: interworking not enabled; "
"first occurrence: %pB: thumb call to arm; "
"consider relinking with --support-old-code "
"enabled"),
@@ -2277,13 +2277,13 @@ coff_arm_merge_private_bfd_data (bfd * ibfd, struct bfd_link_info *info)
{
if (INTERWORK_FLAG (ibfd))
/* xgettext: c-format */
- _bfd_error_handler (_("warning: %pB supports interworking, "
+ _bfd_error_handler (_("%%w: %pB supports interworking, "
"whereas %pB does not"),
ibfd, obfd);
else
/* xgettext: c-format */
_bfd_error_handler
- (_("warning: %pB does not support interworking, "
+ (_("%%w: %pB does not support interworking, "
"whereas %pB does"),
ibfd, obfd);
}
@@ -2374,10 +2374,10 @@ _bfd_coff_arm_set_private_flags (bfd * abfd, flagword flags)
if (INTERWORK_SET (abfd) && (INTERWORK_FLAG (abfd) != flag))
{
if (flag)
- _bfd_error_handler (_("warning: not setting interworking flag of %pB since it has already been specified as non-interworking"),
+ _bfd_error_handler (_("%%w: not setting interworking flag of %pB since it has already been specified as non-interworking"),
abfd);
else
- _bfd_error_handler (_("warning: clearing the interworking flag of %pB due to outside request"),
+ _bfd_error_handler (_("%%w: clearing the interworking flag of %pB due to outside request"),
abfd);
flag = 0;
}
@@ -2435,7 +2435,7 @@ coff_arm_copy_private_bfd_data (bfd * src, bfd * dest)
{
/* xgettext:c-format */
_bfd_error_handler
- (_("warning: clearing the interworking flag of %pB "
+ (_("%%w: clearing the interworking flag of %pB "
"because non-interworking code in %pB has been "
"linked with it"),
dest, src);
diff --git a/bfd/coff-go32.c b/bfd/coff-go32.c
index 278d1441073..0668221bd10 100644
--- a/bfd/coff-go32.c
+++ b/bfd/coff-go32.c
@@ -164,7 +164,7 @@ _bfd_go32_swap_scnhdr_out (bfd * abfd, void * in, void * out)
buf[sizeof (scnhdr_int->s_name)] = '\0';
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: %s: line number overflow: 0x%lx > 0xffff"),
+ (_("%pB: %%w: %s: line number overflow: 0x%lx > 0xffff"),
abfd, buf, scnhdr_int->s_nlnno);
bfd_set_error (bfd_error_file_truncated);
PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno);
diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c
index 23d1e640159..aff9ffdcdcf 100644
--- a/bfd/coff-mcore.c
+++ b/bfd/coff-mcore.c
@@ -483,7 +483,7 @@ coff_mcore_relocate_section (bfd * output_bfd,
case IMAGE_REL_MCORE_ABSOLUTE:
_bfd_error_handler
/* xgettext: c-format */
- (_("warning: unsupported reloc %s <file %pB, section %pA>\n"
+ (_("%%w: unsupported reloc %s <file %pB, section %pA>\n"
"sym %ld (%s), r_vaddr %" PRId64 " (%#" PRIx64 ")"),
howto->name, input_bfd, input_section,
rel->r_symndx, my_name, (int64_t) rel->r_vaddr,
diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c
index b37a80a2a54..ce9100ae925 100644
--- a/bfd/coff-sh.c
+++ b/bfd/coff-sh.c
@@ -778,7 +778,7 @@ sh_relax_section (bfd *abfd,
{
/* xgettext: c-format */
_bfd_error_handler
- (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES offset"),
+ (_("%pB: %#" PRIx64 ": %%w: bad R_SH_USES offset"),
abfd, (uint64_t) irel->r_vaddr);
continue;
}
@@ -789,7 +789,7 @@ sh_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%pB: %#" PRIx64 ": warning: R_SH_USES points to unrecognized insn %#x"),
+ (_("%pB: %#" PRIx64 ": %%w: R_SH_USES points to unrecognized insn %#x"),
abfd, (uint64_t) irel->r_vaddr, insn);
continue;
}
@@ -807,7 +807,7 @@ sh_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES load offset"),
+ (_("%pB: %#" PRIx64 ": %%w: bad R_SH_USES load offset"),
abfd, (uint64_t) irel->r_vaddr);
continue;
}
@@ -832,7 +832,7 @@ sh_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%pB: %#" PRIx64 ": warning: could not find expected reloc"),
+ (_("%pB: %#" PRIx64 ": %%w: could not find expected reloc"),
abfd, (uint64_t) paddr);
continue;
}
@@ -849,7 +849,7 @@ sh_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%pB: %#" PRIx64 ": warning: symbol in unexpected section"),
+ (_("%pB: %#" PRIx64 ": %%w: symbol in unexpected section"),
abfd, (uint64_t) paddr);
continue;
}
@@ -970,7 +970,7 @@ sh_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%pB: %#" PRIx64 ": warning: could not find expected COUNT reloc"),
+ (_("%pB: %#" PRIx64 ": %%w: could not find expected COUNT reloc"),
abfd, (uint64_t) paddr);
continue;
}
@@ -980,7 +980,7 @@ sh_relax_section (bfd *abfd,
if (irelcount->r_offset == 0)
{
/* xgettext: c-format */
- _bfd_error_handler (_("%pB: %#" PRIx64 ": warning: bad count"),
+ _bfd_error_handler (_("%pB: %#" PRIx64 ": %%w: bad count"),
abfd, (uint64_t) paddr);
continue;
}
diff --git a/bfd/coff-tic30.c b/bfd/coff-tic30.c
index deca0a48feb..6cb6737b371 100644
--- a/bfd/coff-tic30.c
+++ b/bfd/coff-tic30.c
@@ -169,7 +169,7 @@ reloc_processing (arelent *relent,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: illegal symbol index %ld in relocs"),
+ (_("%pB: %%w: illegal symbol index %ld in relocs"),
abfd, reloc->r_symndx);
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
}
diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c
index 8d70b465724..809c9c69fb3 100644
--- a/bfd/coff-tic4x.c
+++ b/bfd/coff-tic4x.c
@@ -225,7 +225,7 @@ tic4x_reloc_processing (arelent *relent,
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%pB: warning: illegal symbol index %ld in relocs"),
+ (_("%pB: %%w: illegal symbol index %ld in relocs"),
abfd, reloc->r_symndx);
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL;
diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c
index 424a3b13654..821518cf11b 100644
--- a/bfd/coff-tic54x.c
+++ b/bfd/coff-tic54x.c
@@ -335,7 +335,7 @@ tic54x_reloc_processing (arelent *relent,
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%pB: warning: illegal symbol index %ld in relocs"),
+ (_("%pB: %%w: illegal symbol index %ld in relocs"),
abfd, reloc->r_symndx);
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL;
diff --git a/bfd/coff-z80.c b/bfd/coff-z80.c
index fd33b5a758f..c8f49c3b4b3 100644
--- a/bfd/coff-z80.c
+++ b/bfd/coff-z80.c
@@ -322,7 +322,7 @@ reloc_processing (arelent *relent,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: illegal symbol index %ld in relocs"),
+ (_("%pB: %%w: illegal symbol index %ld in relocs"),
abfd, reloc->r_symndx);
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
}
diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c
index 0b4e3b63aaf..c0c59dc87fe 100644
--- a/bfd/coff-z8k.c
+++ b/bfd/coff-z8k.c
@@ -185,7 +185,7 @@ reloc_processing (arelent *relent,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: illegal symbol index %ld in relocs"),
+ (_("%pB: %%w: illegal symbol index %ld in relocs"),
abfd, reloc->r_symndx);
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
}
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 4170b630b4d..264544aa556 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -973,7 +973,7 @@ fill_comdat_hash (bfd *abfd)
if (esym + isym.n_numaux * bfd_coff_symesz (abfd) >= esymend)
{
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: warning: no symbol for"
+ _bfd_error_handler (_("%pB: %%w: no symbol for"
" section '%s' found"),
abfd, symname);
continue;
@@ -1156,7 +1156,7 @@ handle_COMDAT (bfd *abfd, flagword *sec_flags, const char *name,
if (isym.n_sclass == C_STAT && strcmp (name, found->symname) != 0)
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: warning: COMDAT symbol '%s'"
+ _bfd_error_handler (_("%pB: %%w: COMDAT symbol '%s'"
" does not match section name '%s'"),
abfd, found->symname, name);
@@ -1264,7 +1264,7 @@ styp_to_sec_flags (bfd *abfd,
variable as this will allow some .sys files generate by
other toolchains to be processed. See bugzilla issue 196. */
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: warning: ignoring section flag"
+ _bfd_error_handler (_("%pB: %%w: ignoring section flag"
" %s in section %s"),
abfd, "IMAGE_SCN_MEM_NOT_PAGED", name);
break;
@@ -1960,7 +1960,7 @@ coff_set_alignment_hook (bfd * abfd ATTRIBUTE_UNUSED,
}
else if (hdr->s_nreloc == 0xffff)
_bfd_error_handler
- (_("%pB: warning: claims to have 0xffff relocs, without overflow"),
+ (_("%pB: %%w: claims to have 0xffff relocs, without overflow"),
abfd);
}
#undef ALIGN_SET
@@ -2025,7 +2025,7 @@ coff_set_alignment_hook (bfd * abfd, asection * section, void * scnhdr)
}
else if (hdr->s_nreloc == 0xffff)
_bfd_error_handler
- (_("%pB: warning: claims to have 0xffff relocs, without overflow"),
+ (_("%pB: %%w: claims to have 0xffff relocs, without overflow"),
abfd);
}
@@ -3789,7 +3789,7 @@ coff_write_object_contents (bfd * abfd)
_bfd_error_handler
/* xgettext:c-format */
(_("%pB:%s section %s: alignment 2**%u not representable"),
- abfd, warn ? " warning:" : "", current->name,
+ abfd, warn ? " %%w:" : "", current->name,
current->alignment_power);
if (!warn)
{
@@ -4529,7 +4529,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
if (native_lineno == NULL)
{
_bfd_error_handler
- (_("%pB: warning: line number table read failed"), abfd);
+ (_("%pB: %%w: line number table read failed"), abfd);
return false;
}
@@ -4575,7 +4575,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: illegal symbol index 0x%lx in line number entry %d"),
+ (_("%pB: %%w: illegal symbol index 0x%lx in line number entry %d"),
abfd, symndx, counter);
cache_ptr->line_number = -1;
ret = false;
@@ -4589,7 +4589,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: illegal symbol index 0x%lx in line number entry %d"),
+ (_("%pB: %%w: illegal symbol index 0x%lx in line number entry %d"),
abfd, symndx, counter);
cache_ptr->line_number = -1;
ret = false;
@@ -4603,7 +4603,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: illegal symbol in line number entry %d"),
+ (_("%pB: %%w: illegal symbol in line number entry %d"),
abfd, counter);
cache_ptr->line_number = -1;
ret = false;
@@ -4616,7 +4616,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
if (sym->lineno != NULL)
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: duplicate line number information for `%s'"),
+ (_("%pB: %%w: duplicate line number information for `%s'"),
abfd, bfd_asymbol_name (&sym->symbol));
sym->lineno = cache_ptr;
@@ -5180,7 +5180,7 @@ coff_classify_symbol (bfd *abfd,
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB: local symbol `%s' has no section"),
+ (_("%%w: %pB: local symbol `%s' has no section"),
abfd, _bfd_coff_internal_syment_name (abfd, syment, buf));
}
@@ -5311,7 +5311,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: illegal symbol index %ld in relocs"),
+ (_("%pB: %%w: illegal symbol index %ld in relocs"),
abfd, dst.r_symndx);
cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL;
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index cc1c655738b..1e7dc2b5f14 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1424,11 +1424,12 @@ coff_write_symbols (bfd *abfd)
Error messages can be generated when we are processing a local
symbol which has no associated section and we do not have to
worry about this, all we need to know is that it is local. */
- current_error_handler = bfd_set_error_handler (null_error_handler);
+ current_error_handler
+ = bfd_set_error_handler (null_error_handler, NULL);
BFD_ASSERT (c_symbol->native->is_sym);
sym_class = bfd_coff_classify_symbol (abfd,
&c_symbol->native->u.syment);
- (void) bfd_set_error_handler (current_error_handler);
+ (void) bfd_set_error_handler (current_error_handler, NULL);
n_sclass = &c_symbol->native->u.syment.n_sclass;
@@ -3212,7 +3213,7 @@ bfd_coff_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
if (!bed->can_gc_sections
|| !is_coff_hash_table (info->hash))
{
- _bfd_error_handler(_("warning: gc-sections option ignored"));
+ _bfd_error_handler(_("%%w: gc-sections option ignored"));
return true;
}
#endif
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 4a91d5a1833..581375c7fbc 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -395,7 +395,7 @@ coff_link_add_symbols (bfd *abfd,
&& (*sym_hash)->root.type != bfd_link_hash_undefined
&& (*sym_hash)->root.type != bfd_link_hash_undefweak)
_bfd_error_handler
- (_("warning: symbol `%s' is both section and non-section"),
+ (_("%%w: symbol `%s' is both section and non-section"),
name);
addit = false;
@@ -500,7 +500,7 @@ coff_link_add_symbols (bfd *abfd,
|| BTYPE (sym.n_type) == T_NULL)))
_bfd_error_handler
/* xgettext: c-format */
- (_("warning: type of symbol `%s' changed"
+ (_("%%w: type of symbol `%s' changed"
" from %d to %d in %pB"),
name, (*sym_hash)->type, sym.n_type, abfd);
@@ -2721,7 +2721,7 @@ _bfd_coff_write_global_sym (struct bfd_hash_entry *bh, void *data)
|| bfd_link_relocatable (flaginfo->info)))
_bfd_error_handler
/* xgettext: c-format */
- (_("%pB: warning: %pA: line number overflow: %#x > 0xffff"),
+ (_("%pB: %%w: %pA: line number overflow: %#x > 0xffff"),
output_bfd, sec, sec->lineno_count);
auxp->x_scn.x_nreloc = sec->reloc_count;
diff --git a/bfd/coffswap.h b/bfd/coffswap.h
index eafdbbb078d..5ac3624f6cd 100644
--- a/bfd/coffswap.h
+++ b/bfd/coffswap.h
@@ -809,7 +809,7 @@ coff_swap_scnhdr_out (bfd * abfd, void * in, void * out)
buf[sizeof (scnhdr_int->s_name)] = '\0';
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: %s: line number overflow: 0x%lx > 0xffff"),
+ (_("%pB: %%w: %s: line number overflow: 0x%lx > 0xffff"),
abfd, buf, scnhdr_int->s_nlnno);
PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno);
}
diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c
index 12a5b770593..caa90b4e2a4 100644
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -466,7 +466,7 @@ 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 %pB"),
+ (_("%%w: unable to update contents of %s section in %pB"),
note_section, abfd);
goto FAIL;
}
diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c
index 2626b712ba3..3498e0bde44 100644
--- a/bfd/cpu-m68k.c
+++ b/bfd/cpu-m68k.c
@@ -260,7 +260,7 @@ bfd_m68k_compatible (const bfd_arch_info_type *a,
if (!cpu32_fido_mix_warning)
{
cpu32_fido_mix_warning = 1;
- _bfd_error_handler ("warning: linking CPU32 objects with fido objects");
+ _bfd_error_handler ("%%w: linking CPU32 objects with fido objects");
}
return bfd_lookup_arch (a->arch,
bfd_m68k_features_to_mach (fido_a | m68881));
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 533ff1900c0..5586ca93531 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -1013,7 +1013,7 @@ _bfd_ecoff_slurp_symbol_table (bfd *abfd)
abfd->symcount = internal_ptr - internal;
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: isymMax (%ld) is greater than ifdMax (%ld)"),
+ (_("%pB: %%w: isymMax (%ld) is greater than ifdMax (%ld)"),
abfd, ecoff_data (abfd)->debug_info.symbolic_header.isymMax,
ecoff_data (abfd)->debug_info.symbolic_header.ifdMax);
}
diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c
index ee8bd37f2bd..3554fecaac5 100644
--- a/bfd/elf-properties.c
+++ b/bfd/elf-properties.c
@@ -88,7 +88,7 @@ _bfd_elf_parse_gnu_properties (bfd *abfd, Elf_Internal_Note *note)
{
bad_size:
_bfd_error_handler
- (_("warning: %pB: corrupt GNU_PROPERTY_TYPE (%ld) size: %#lx"),
+ (_("%%w: %pB: corrupt GNU_PROPERTY_TYPE (%ld) size: %#lx"),
abfd, note->type, note->descsz);
return false;
}
@@ -109,7 +109,7 @@ _bfd_elf_parse_gnu_properties (bfd *abfd, Elf_Internal_Note *note)
if (datasz > (size_t) (ptr_end - ptr))
{
_bfd_error_handler
- (_("warning: %pB: corrupt GNU_PROPERTY_TYPE (%ld) type (0x%x) datasz: 0x%x"),
+ (_("%%w: %pB: corrupt GNU_PROPERTY_TYPE (%ld) type (0x%x) datasz: 0x%x"),
abfd, note->type, type, datasz);
/* Clear all properties. */
elf_properties (abfd) = NULL;
@@ -148,7 +148,7 @@ _bfd_elf_parse_gnu_properties (bfd *abfd, Elf_Internal_Note *note)
if (datasz != align_size)
{
_bfd_error_handler
- (_("warning: %pB: corrupt stack size: 0x%x"),
+ (_("%%w: %pB: corrupt stack size: 0x%x"),
abfd, datasz);
/* Clear all properties. */
elf_properties (abfd) = NULL;
@@ -166,7 +166,7 @@ _bfd_elf_parse_gnu_properties (bfd *abfd, Elf_Internal_Note *note)
if (datasz != 0)
{
_bfd_error_handler
- (_("warning: %pB: corrupt no copy on protected size: 0x%x"),
+ (_("%%w: %pB: corrupt no copy on protected size: 0x%x"),
abfd, datasz);
/* Clear all properties. */
elf_properties (abfd) = NULL;
@@ -211,7 +211,7 @@ _bfd_elf_parse_gnu_properties (bfd *abfd, Elf_Internal_Note *note)
}
_bfd_error_handler
- (_("warning: %pB: unsupported GNU_PROPERTY_TYPE (%ld) type: 0x%x"),
+ (_("%%w: %pB: unsupported GNU_PROPERTY_TYPE (%ld) type: 0x%x"),
abfd, note->type, type);
next:
diff --git a/bfd/elf-s390-common.c b/bfd/elf-s390-common.c
index 721f5d8b449..f49db2a574f 100644
--- a/bfd/elf-s390-common.c
+++ b/bfd/elf-s390-common.c
@@ -345,12 +345,12 @@ elf_s390_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
if (in_attr->i > 2)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses unknown vector ABI %d"), ibfd,
+ (_("%%w: %pB uses unknown vector ABI %d"), ibfd,
in_attr->i);
else if (out_attr->i > 2)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses unknown vector ABI %d"), obfd,
+ (_("%%w: %pB uses unknown vector ABI %d"), obfd,
out_attr->i);
else if (in_attr->i != out_attr->i)
{
@@ -362,7 +362,7 @@ elf_s390_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses vector %s ABI, %pB uses %s ABI"),
+ (_("%%w: %pB uses vector %s ABI, %pB uses %s ABI"),
ibfd, abi_str[in_attr->i], obfd, abi_str[out_attr->i]);
}
if (in_attr->i > out_attr->i)
diff --git a/bfd/elf.c b/bfd/elf.c
index 88c75ae3ce0..95bea6df535 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2611,7 +2611,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
if (elf_tdata (abfd)->being_created[shindex])
{
_bfd_error_handler
- (_("%pB: warning: loop in section dependencies detected"), abfd);
+ (_("%pB: %%w: loop in section dependencies detected"), abfd);
return false;
}
elf_tdata (abfd)->being_created[shindex] = true;
@@ -2718,7 +2718,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: multiple symbol tables detected"
+ (_("%pB: %%w: multiple symbol tables detected"
" - ignoring the table in section %u"),
abfd, shindex);
goto success;
@@ -2803,7 +2803,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: multiple dynamic symbol tables detected"
+ (_("%pB: %%w: multiple dynamic symbol tables detected"
" - ignoring the table in section %u"),
abfd, shindex);
goto success;
@@ -2979,7 +2979,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: secondary relocation section '%s' "
+ (_("%pB: %%w: secondary relocation section '%s' "
"for section %pA found - ignoring"),
abfd, name, target_sect);
}
@@ -3802,7 +3802,7 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg)
non-bss input sections to bss output sections, or emit data
to a bss output section via a linker script. */
_bfd_error_handler
- (_("warning: section `%pA' type changed to PROGBITS"), asect);
+ (_("%%w: section `%pA' type changed to PROGBITS"), asect);
this_hdr->sh_type = sh_type;
}
@@ -6717,7 +6717,7 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
&& ! is_debuginfo_file (abfd))
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: allocated section `%s' not in segment"),
+ (_("%pB: %%w: allocated section `%s' not in segment"),
abfd,
(hdr->bfd_section == NULL
? "*unknown*"
@@ -6852,7 +6852,7 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
{
if (link_info != NULL)
_bfd_error_handler
- (_("%pB: warning: unable to allocate any sections"
+ (_("%pB: %%w: unable to allocate any sections"
" to PT_GNU_RELRO segment"),
abfd);
memset (p, 0, sizeof *p);
@@ -7038,7 +7038,7 @@ error: %pB has a TLS segment with execute permission"),
}
_bfd_error_handler (_("\
-warning: %pB has a TLS segment with execute permission"),
+%%w: %pB has a TLS segment with execute permission"),
abfd);
if (warned_rwx)
break;
@@ -7059,7 +7059,7 @@ error: %pB has a LOAD segment with RWX permissions"),
}
_bfd_error_handler (_("\
-warning: %pB has a LOAD segment with RWX permissions"),
+%%w: %pB has a LOAD segment with RWX permissions"),
abfd);
if (warned_tls)
break;
@@ -7829,7 +7829,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd, bfd_vma maxpagesize)
&& (segment->p_filesz > 0 || segment->p_memsz == 0))
/* xgettext:c-format */
_bfd_error_handler
- (_("%pB: warning: empty loadable segment detected"
+ (_("%pB: %%w: empty loadable segment detected"
" at vaddr=%#" PRIx64 ", is this intentional?"),
ibfd, (uint64_t) segment->p_vaddr);
@@ -8489,7 +8489,7 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
/* PR 17512: file: f17299af. */
if (segment->p_align > (bfd_vma) 1 << ((sizeof (bfd_vma) * 8) - 2))
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: warning: segment alignment of %#"
+ _bfd_error_handler (_("%pB: %%w: segment alignment of %#"
PRIx64 " is too large"),
ibfd, (uint64_t) segment->p_align);
else
@@ -11076,7 +11076,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note)
if (note->descsz < size_check[type - 1].min_size)
{
- _bfd_error_handler (_("%pB: warning: win32pstatus %s of size %lu bytes"
+ _bfd_error_handler (_("%pB: %%w: win32pstatus %s of size %lu bytes"
" is too small"),
abfd, size_check[type - 1].type_name, note->descsz);
return true;
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 1061e54e9d7..ca2b3bd654e 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -639,7 +639,7 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
/* It's sometimes ok to mix different configs, so this is only
a warning. */
_bfd_error_handler
- (_("warning: %pB: conflicting platform configuration "
+ (_("%%w: %pB: conflicting platform configuration "
"%s with %s"), ibfd,
tagval[in_attr[i].i],
tagval[out_attr[i].i]);
@@ -1030,7 +1030,7 @@ arc_elf_object_p (bfd * abfd)
else
{
_bfd_error_handler
- (_("warning: unset or old architecture flags; "
+ (_("%%w: unset or old architecture flags; "
"use default machine"));
}
}
@@ -1919,7 +1919,7 @@ elf_arc_relocate_section (bfd * output_bfd,
case bfd_reloc_other:
/* xgettext:c-format */
- msg = _("%pB(%pA): warning: unaligned access to symbol '%s' in the small data area");
+ msg = _("%pB(%pA): %%w: unaligned access to symbol '%s' in the small data area");
break;
case bfd_reloc_outofrange:
@@ -2928,7 +2928,7 @@ elf32_arc_obj_attrs_handle_unknown (bfd *abfd, int tag)
else
{
_bfd_error_handler
- (_("warning: %pB: unknown ARC object attribute %d"),
+ (_("%%w: %pB: unknown ARC object attribute %d"),
abfd, tag);
return true;
}
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 4ad7c3542a7..66f16d32e53 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -4343,7 +4343,7 @@ arm_type_of_stub (struct bfd_link_info *info,
{
if (input_sec->flags & SEC_ELF_PURECODE)
_bfd_error_handler
- (_("%pB(%pA): warning: long branch veneers used in"
+ (_("%pB(%pA): %%w: long branch veneers used in"
" section with SHF_ARM_PURECODE section"
" attribute is only supported for M-profile"
" targets that implement the movw instruction"),
@@ -4377,7 +4377,7 @@ arm_type_of_stub (struct bfd_link_info *info,
{
if (input_sec->flags & SEC_ELF_PURECODE)
_bfd_error_handler
- (_("%pB(%pA): warning: long branch veneers used in"
+ (_("%pB(%pA): %%w: long branch veneers used in"
" section with SHF_ARM_PURECODE section"
" attribute is only supported for M-profile"
" targets that implement the movw instruction"),
@@ -4396,7 +4396,7 @@ arm_type_of_stub (struct bfd_link_info *info,
{
if (input_sec->flags & SEC_ELF_PURECODE)
_bfd_error_handler
- (_("%pB(%pA): warning: long branch veneers used in"
+ (_("%pB(%pA): %%w: long branch veneers used in"
" section with SHF_ARM_PURECODE section"
" attribute is only supported" " for M-profile"
" targets that implement the movw instruction"),
@@ -4408,7 +4408,7 @@ arm_type_of_stub (struct bfd_link_info *info,
&& !INTERWORK_FLAG (sym_sec->owner))
{
_bfd_error_handler
- (_("%pB(%s): warning: interworking not enabled;"
+ (_("%pB(%s): %%w: interworking not enabled;"
" first occurrence: %pB: %s call to %s"),
sym_sec->owner, name, input_bfd, "Thumb", "ARM");
}
@@ -4448,7 +4448,7 @@ arm_type_of_stub (struct bfd_link_info *info,
{
if (input_sec->flags & SEC_ELF_PURECODE)
_bfd_error_handler
- (_("%pB(%pA): warning: long branch veneers used in"
+ (_("%pB(%pA): %%w: long branch veneers used in"
" section with SHF_ARM_PURECODE section"
" attribute is only supported for M-profile"
" targets that implement the movw instruction"),
@@ -4462,7 +4462,7 @@ arm_type_of_stub (struct bfd_link_info *info,
&& !INTERWORK_FLAG (sym_sec->owner))
{
_bfd_error_handler
- (_("%pB(%s): warning: interworking not enabled;"
+ (_("%pB(%s): %%w: interworking not enabled;"
" first occurrence: %pB: %s call to %s"),
sym_sec->owner, name, input_bfd, "ARM", "Thumb");
}
@@ -8093,7 +8093,7 @@ bfd_elf32_arm_set_vfp11_fix (bfd *obfd, struct bfd_link_info *link_info)
default:
/* Give a warning, but do as the user requests anyway. */
- _bfd_error_handler (_("%pB: warning: selected VFP11 erratum "
+ _bfd_error_handler (_("%pB: %%w: selected VFP11 erratum "
"workaround is not necessary for target architecture"), obfd);
}
}
@@ -8120,7 +8120,7 @@ bfd_elf32_arm_set_stm32l4xx_fix (bfd *obfd, struct bfd_link_info *link_info)
if (globals->stm32l4xx_fix != BFD_ARM_STM32L4XX_FIX_NONE)
/* Give a warning, but do as the user requests anyway. */
_bfd_error_handler
- (_("%pB: warning: selected STM32L4XX erratum "
+ (_("%pB: %%w: selected STM32L4XX erratum "
"workaround is not necessary for target architecture"), obfd);
}
}
@@ -9160,7 +9160,7 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info,
&& !INTERWORK_FLAG (sym_sec->owner))
{
_bfd_error_handler
- (_("%pB(%s): warning: interworking not enabled;"
+ (_("%pB(%s): %%w: interworking not enabled;"
" first occurrence: %pB: %s call to %s"),
sym_sec->owner, name, input_bfd, "Thumb", "ARM");
@@ -9250,7 +9250,7 @@ elf32_arm_create_thumb_stub (struct bfd_link_info * info,
&& !INTERWORK_FLAG (sym_sec->owner))
{
_bfd_error_handler
- (_("%pB(%s): warning: interworking not enabled;"
+ (_("%pB(%s): %%w: interworking not enabled;"
" first occurrence: %pB: %s call to %s"),
sym_sec->owner, name, input_bfd, "ARM", "Thumb");
}
@@ -9837,7 +9837,7 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
{
/* FIXME: We ought to be able to generate thumb-1 PLT
instructions... */
- _bfd_error_handler (_("%pB: warning: thumb-1 mode PLT generation not currently supported"),
+ _bfd_error_handler (_("%pB: %%w: thumb-1 mode PLT generation not currently supported"),
output_bfd);
return false;
}
@@ -10646,7 +10646,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
instruction instead ? */
if (branch_type != ST_BRANCH_TO_THUMB)
_bfd_error_handler
- (_("\%pB: warning: %s BLX instruction targets"
+ (_("\%pB: %%w: %s BLX instruction targets"
" %s function '%s'"),
input_bfd, "ARM",
"ARM", h ? h->root.root.string : "(local)");
@@ -11063,7 +11063,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
instruction instead ? */
if (branch_type == ST_BRANCH_TO_THUMB)
_bfd_error_handler
- (_("%pB: warning: %s BLX instruction targets"
+ (_("%pB: %%w: %s BLX instruction targets"
" %s function '%s'"),
input_bfd, "Thumb",
"Thumb", h ? h->root.root.string : "(local)");
@@ -13919,11 +13919,11 @@ elf32_arm_set_private_flags (bfd *abfd, flagword flags)
{
if (flags & EF_ARM_INTERWORK)
_bfd_error_handler
- (_("warning: not setting interworking flag of %pB since it has already been specified as non-interworking"),
+ (_("%%w: not setting interworking flag of %pB since it has already been specified as non-interworking"),
abfd);
else
_bfd_error_handler
- (_("warning: clearing the interworking flag of %pB due to outside request"),
+ (_("%%w: clearing the interworking flag of %pB due to outside request"),
abfd);
}
}
@@ -13968,7 +13968,7 @@ elf32_arm_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
if (out_flags & EF_ARM_INTERWORK)
_bfd_error_handler
- (_("warning: clearing the interworking flag of %pB because non-interworking code in %pB has been linked with it"),
+ (_("%%w: clearing the interworking flag of %pB because non-interworking code in %pB has been linked with it"),
obfd, ibfd);
in_flags &= ~EF_ARM_INTERWORK;
@@ -14063,7 +14063,7 @@ elf32_arm_obj_attrs_handle_unknown (bfd *abfd, int tag)
else
{
_bfd_error_handler
- (_("warning: %pB: unknown EABI object attribute %d"),
+ (_("%%w: %pB: unknown EABI object attribute %d"),
abfd, tag);
return true;
}
@@ -14905,7 +14905,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info)
/* It's sometimes ok to mix different configs, so this is only
a warning. */
_bfd_error_handler
- (_("warning: %pB: conflicting platform configuration"), ibfd);
+ (_("%%w: %pB: conflicting platform configuration"), ibfd);
}
break;
case Tag_ABI_PCS_R9_use:
@@ -14939,7 +14939,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info)
&& !elf_arm_tdata (obfd)->no_wchar_size_warning)
{
_bfd_error_handler
- (_("warning: %pB uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; use of wchar_t values across objects may fail"),
+ (_("%%w: %pB uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; use of wchar_t values across objects may fail"),
ibfd, in_attr[i].i, out_attr[i].i);
}
else if (in_attr[i].i && !out_attr[i].i)
@@ -14970,7 +14970,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info)
? aeabi_enum_names[out_attr[i].i]
: "<unknown>";
_bfd_error_handler
- (_("warning: %pB uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"),
+ (_("%%w: %pB uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"),
ibfd, in_name, out_name);
}
}
@@ -20836,13 +20836,13 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (in_flags & EF_ARM_INTERWORK)
{
_bfd_error_handler
- (_("warning: %pB supports interworking, whereas %pB does not"),
+ (_("%%w: %pB supports interworking, whereas %pB does not"),
ibfd, obfd);
}
else
{
_bfd_error_handler
- (_("warning: %pB does not support interworking, whereas %pB does"),
+ (_("%%w: %pB does not support interworking, whereas %pB does"),
ibfd, obfd);
}
}
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index 78402526520..d2ceae83764 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -3043,7 +3043,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
(info,
bfd_link_pic (info)
? _("relocations between different segments are not supported")
- : _("warning: relocation references a different segment"),
+ : _("%%w: relocation references a different segment"),
name, input_bfd, input_section, rel->r_offset);
if (!silence_segment_error && bfd_link_pic (info))
return false;
diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c
index 9479705d37e..682e3cf826f 100644
--- a/bfd/elf32-csky.c
+++ b/bfd/elf32-csky.c
@@ -2827,7 +2827,7 @@ csky_find_arch_with_eflag (const unsigned long arch_eflag)
break;
if (csky_arch == NULL)
{
- _bfd_error_handler (_("warning: unrecognized arch eflag '%#lx'"),
+ _bfd_error_handler (_("%%w: unrecognized arch eflag '%#lx'"),
arch_eflag);
bfd_set_error (bfd_error_wrong_format);
}
@@ -2850,7 +2850,7 @@ csky_find_arch_with_name (const char *name)
}
if (csky_arch == NULL)
{
- msg = _("warning: unrecognised arch name '%#x'");
+ msg = _("%%w: unrecognised arch name '%#x'");
(*_bfd_error_handler) (msg, name);
bfd_set_error (bfd_error_wrong_format);
}
@@ -2928,7 +2928,7 @@ elf32_csky_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
if (new_arch->do_warning || old_arch->do_warning)
{
- msg = _("warning: file %pB's arch flag %s conflict "
+ msg = _("%%w: file %pB's arch flag %s conflict "
"with target %s,set target arch flag to %s");
(*_bfd_error_handler) (msg, ibfd, new_arch->name,
old_arch->name,
@@ -3089,7 +3089,7 @@ csky_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: file %pB's arch flag %s conflicts with "
+ (_("%%w: file %pB's arch flag %s conflicts with "
"target ck%s, using %s"),
ibfd, new_arch->name, old_arch->name,
newest_arch->name);
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index 66f0f7d6387..77b8d9cb92d 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -2670,7 +2670,7 @@ elf32_msp430_obj_attrs_handle_unknown (bfd *abfd, int tag)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB: unknown MSPABI object attribute %d"),
+ (_("%%w: %pB: unknown MSPABI object attribute %d"),
abfd, tag);
return true;
}
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index f8a6836d599..5cd8a57e7ec 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -5178,7 +5178,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
if (!bfd_link_pie (info))
{
_bfd_error_handler
- ("%pB: warning: _FP_BASE_ setting insns relaxation failed.",
+ ("%pB: %%w: _FP_BASE_ setting insns relaxation failed.",
input_bfd);
}
relocation = fpbase_addr;
@@ -5570,7 +5570,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
if (bfd_link_pic (info))
{
_bfd_error_handler
- (_("%pB: warning: %s unsupported in shared mode"),
+ (_("%pB: %%w: %s unsupported in shared mode"),
input_bfd, "R_NDS32_25_ABS_RELA");
return false;
}
@@ -5696,7 +5696,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
{
/* Incorrect alignment. */
_bfd_error_handler
- (_("%pB: warning: unaligned access to GOT entry"), input_bfd);
+ (_("%pB: %%w: unaligned access to GOT entry"), input_bfd);
ret = false;
r = bfd_reloc_dangerous;
goto check_reloc;
@@ -5737,7 +5737,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
if (r != bfd_reloc_ok)
{
_bfd_error_handler
- (_("%pB: warning: relocate SDA_BASE failed"), input_bfd);
+ (_("%pB: %%w: relocate SDA_BASE failed"), input_bfd);
ret = false;
goto check_reloc;
}
@@ -5759,7 +5759,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
/* Incorrect alignment. */
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%pA): warning: unaligned small data access"
+ (_("%pB(%pA): %%w: unaligned small data access"
" of type %d"),
input_bfd, input_section, r_type);
ret = false;
@@ -6733,7 +6733,7 @@ nds32_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (bfd_little_endian (ibfd) != bfd_little_endian (obfd))
{
_bfd_error_handler
- (_("%pB: warning: endian mismatch with previous modules"), ibfd);
+ (_("%pB: %%w: endian mismatch with previous modules"), ibfd);
bfd_set_error (bfd_error_bad_value);
return false;
@@ -6747,7 +6747,7 @@ nds32_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (in_version == E_NDS32_ELF_VER_1_2)
{
_bfd_error_handler
- (_("%pB: warning: older version of object file encountered, "
+ (_("%pB: %%w: older version of object file encountered, "
"please recompile with current tool chain"), ibfd);
}
@@ -6872,7 +6872,7 @@ nds32_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (in_version != out_version)
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: incompatible elf-versions %s and %s"),
+ (_("%pB: %%w: incompatible elf-versions %s and %s"),
ibfd, nds32_elfver_strtab[out_version],
nds32_elfver_strtab[in_version]);
@@ -9619,7 +9619,7 @@ relax_range_measurement (bfd *abfd, struct bfd_link_info *link_info)
static const char * unrecognized_reloc_msg =
/* xgettext:c-format */
- N_("%pB: warning: %s points to unrecognized reloc at %#" PRIx64);
+ N_("%pB: %%w: %s points to unrecognized reloc at %#" PRIx64);
/* Relax LONGCALL1 relocation for nds32_elf_relax_section. */
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index e6dd7abdf96..1c832911dc4 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -1686,7 +1686,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info)
{
ibfd = abfd;
/* xgettext:c-format */
- error_message = _("warning: unable to set size of %s section in %pB");
+ error_message = _("%%w: unable to set size of %s section in %pB");
}
}
@@ -4605,7 +4605,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
{
/* xgettext:c-format */
info->callbacks->minfo
- (_("%H: warning: %s unexpected insn %#x.\n"),
+ (_("%H: %%w: %s unexpected insn %#x.\n"),
ibfd, sec, off, "R_PPC_TPREL16_HA", insn);
htab->do_tls_opt = 0;
}
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index 8e8fd8b31e1..8be72302044 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -1066,7 +1066,7 @@ rl78_elf_relocate_section
relocation = 0;
if (h->root.type != bfd_link_hash_undefweak)
_bfd_error_handler
- (_("warning: RL78_SYM reloc with an unknown symbol"));
+ (_("%%w: RL78_SYM reloc with an unknown symbol"));
}
(void) rl78_compute_complex_reloc (r_type, relocation, input_section,
&r, &error_message);
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
index db1ab777d3f..d16f37e67e8 100644
--- a/bfd/elf32-rx.c
+++ b/bfd/elf32-rx.c
@@ -697,7 +697,7 @@ rx_elf_relocate_section
#define WARN_REDHAT(type) \
/* xgettext:c-format */ \
_bfd_error_handler \
- (_("%pB:%pA: warning: deprecated Red Hat reloc " \
+ (_("%pB:%pA: %%w: deprecated Red Hat reloc " \
"%s detected against: %s"), \
input_bfd, input_section, #type, name)
@@ -1301,7 +1301,7 @@ rx_elf_relocate_section
+ rel->r_addend);
else
_bfd_error_handler
- (_("warning: RX_SYM reloc with an unknown symbol"));
+ (_("%%w: RX_SYM reloc with an unknown symbol"));
}
break;
@@ -1483,7 +1483,7 @@ rx_elf_relocate_section
case bfd_reloc_other:
/* xgettext:c-format */
- msg = _("%pB(%pA): warning: unaligned access to symbol '%s' in the small data area");
+ msg = _("%pB(%pA): %%w: unaligned access to symbol '%s' in the small data area");
break;
case bfd_reloc_outofrange:
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index 448aba87c86..c994770a7d3 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -4038,7 +4038,7 @@ s3_elf32_score_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (((in_flags & EF_SCORE_PIC) != 0) != ((out_flags & EF_SCORE_PIC) != 0))
_bfd_error_handler
- (_("%pB: warning: linking PIC files with non-PIC files"), ibfd);
+ (_("%pB: %%w: linking PIC files with non-PIC files"), ibfd);
/* FIXME: Maybe dependency fix compatibility should be checked here. */
diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c
index c20fa7a3eca..155e8c7e675 100644
--- a/bfd/elf32-score7.c
+++ b/bfd/elf32-score7.c
@@ -3845,7 +3845,7 @@ s7_elf32_score_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (((in_flags & EF_SCORE_PIC) != 0) != ((out_flags & EF_SCORE_PIC) != 0))
{
- _bfd_error_handler (_("%pB: warning: linking PIC files with non-PIC files"), ibfd);
+ _bfd_error_handler (_("%pB: %%w: linking PIC files with non-PIC files"), ibfd);
}
/* Maybe dependency fix compatibility should be checked here. */
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 77bcaea7bdf..37dc07a442b 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -518,7 +518,7 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
{
/* xgettext:c-format */
_bfd_error_handler
- (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES offset"),
+ (_("%pB: %#" PRIx64 ": %%w: bad R_SH_USES offset"),
abfd, (uint64_t) irel->r_offset);
continue;
}
@@ -530,7 +530,7 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: "
+ (_("%pB: %#" PRIx64 ": %%w: "
"R_SH_USES points to unrecognized insn 0x%x"),
abfd, (uint64_t) irel->r_offset, insn);
continue;
@@ -549,7 +549,7 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES load offset"),
+ (_("%pB: %#" PRIx64 ": %%w: bad R_SH_USES load offset"),
abfd, (uint64_t) irel->r_offset);
continue;
}
@@ -565,7 +565,7 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: could not find expected reloc"),
+ (_("%pB: %#" PRIx64 ": %%w: could not find expected reloc"),
abfd, (uint64_t) paddr);
continue;
}
@@ -594,7 +594,7 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: symbol in unexpected section"),
+ (_("%pB: %#" PRIx64 ": %%w: symbol in unexpected section"),
abfd, (uint64_t) paddr);
continue;
}
@@ -724,7 +724,7 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: "
+ (_("%pB: %#" PRIx64 ": %%w: "
"could not find expected COUNT reloc"),
abfd, (uint64_t) paddr);
continue;
@@ -735,7 +735,7 @@ sh_elf_relax_section (bfd *abfd, asection *sec,
if (irelcount->r_addend == 0)
{
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: %#" PRIx64 ": warning: bad count"),
+ _bfd_error_handler (_("%pB: %#" PRIx64 ": %%w: bad count"),
abfd, (uint64_t) paddr);
continue;
}
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index d960c34021a..939546c0084 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -1029,7 +1029,7 @@ needs_ovl_stub (struct elf_link_hash_entry *h,
}
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: call to non-function symbol %s defined in %pB"),
+ (_("%%w: call to non-function symbol %s defined in %pB"),
sym_name, sym_sec->owner);
}
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index afd8e0d2aff..838c603efdf 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -1585,12 +1585,12 @@ elf32_tic6x_final_link (bfd *abfd, struct bfd_link_info *info)
out_attr = elf_known_obj_attributes_proc (abfd);
if (out_attr[Tag_ABI_PIC].i == 0)
{
- _bfd_error_handler (_("warning: generating a shared library "
+ _bfd_error_handler (_("%%w: generating a shared library "
"containing non-PIC code"));
}
if (out_attr[Tag_ABI_PID].i == 0)
{
- _bfd_error_handler (_("warning: generating a shared library "
+ _bfd_error_handler (_("%%w: generating a shared library "
"containing non-PID code"));
}
}
@@ -3504,7 +3504,7 @@ elf32_tic6x_obj_attrs_handle_unknown (bfd *abfd, int tag)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: unknown EABI object attribute %d"),
+ (_("%pB: %%w: unknown EABI object attribute %d"),
abfd, tag);
return true;
}
@@ -3708,7 +3708,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB and %pB differ in wchar_t size"), obfd, ibfd);
+ (_("%%w: %pB and %pB differ in wchar_t size"), obfd, ibfd);
}
break;
@@ -3727,7 +3727,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB and %pB differ in whether code is "
+ (_("%%w: %pB and %pB differ in whether code is "
"compiled for DSBT"),
obfd, ibfd);
}
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 85cbcbc3505..c5c9b558ac1 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -3589,7 +3589,7 @@ v850_elf_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: %s points to "
+ (_("%pB: %#" PRIx64 ": %%w: %s points to "
"unrecognized insns"),
abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL");
continue;
@@ -3599,7 +3599,7 @@ v850_elf_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: %s points to "
+ (_("%pB: %#" PRIx64 ": %%w: %s points to "
"unrecognized insn %#x"),
abfd,
(uint64_t) (irel->r_offset + no_match),
@@ -3645,7 +3645,7 @@ v850_elf_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: %s points to "
+ (_("%pB: %#" PRIx64 ": %%w: %s points to "
"unrecognized reloc"),
abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL");
@@ -3685,7 +3685,7 @@ v850_elf_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: %s points to "
+ (_("%pB: %#" PRIx64 ": %%w: %s points to "
"unrecognized reloc %#" PRIx64),
abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL",
(uint64_t) irelcall->r_offset);
@@ -3828,7 +3828,7 @@ v850_elf_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: %s points to "
+ (_("%pB: %#" PRIx64 ": %%w: %s points to "
"unrecognized insns"),
abfd, (uint64_t) irel->r_offset, "R_V850_LONGJUMP");
continue;
@@ -3838,7 +3838,7 @@ v850_elf_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: %s points to "
+ (_("%pB: %#" PRIx64 ": %%w: %s points to "
"unrecognized insn %#x"),
abfd,
(uint64_t) (irel->r_offset + no_match),
@@ -3873,7 +3873,7 @@ v850_elf_relax_section (bfd *abfd,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %#" PRIx64 ": warning: %s points to "
+ (_("%pB: %#" PRIx64 ": %%w: %s points to "
"unrecognized reloc"),
abfd, (uint64_t) irel->r_offset, "R_V850_LONGJUMP");
continue;
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 4422dc995aa..8d1c1bb0af8 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -628,7 +628,7 @@ 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 */
- (_("%pB: warning: GOT addend of %" PRId64 " to `%s' does"
+ (_("%pB: %%w: GOT addend of %" PRId64 " to `%s' does"
" not match previous GOT addend of %" PRId64),
abfd, (int64_t) rel->r_addend, h->root.root.string,
(int64_t) eh->got_addend);
@@ -1385,7 +1385,7 @@ elf_vax_relocate_section (bfd *output_bfd,
else if (rel->r_addend != 0)
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: PLT addend of %" PRId64 " to `%s'"
+ (_("%pB: %%w: PLT addend of %" PRId64 " to `%s'"
" from %pA section ignored"),
input_bfd, (int64_t) rel->r_addend, h->root.root.string,
input_section);
@@ -1511,14 +1511,14 @@ elf_vax_relocate_section (bfd *output_bfd,
if (h != NULL)
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: %s relocation against symbol `%s'"
+ (_("%pB: %%w: %s relocation against symbol `%s'"
" from %pA section"),
input_bfd, howto->name, h->root.root.string,
input_section);
else
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: %s relocation to %#" PRIx64
+ (_("%pB: %%w: %s relocation to %#" PRIx64
" from %pA section"),
input_bfd, howto->name, (uint64_t) outrel.r_addend,
input_section);
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index ce50291cd3f..c8de64eb282 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -2972,7 +2972,7 @@ elf64_alpha_relax_got_load (struct alpha_relax_info *info, bfd_vma symval,
reloc_howto_type *howto = elf64_alpha_howto_table + r_type;
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %pA+%#" PRIx64 ": warning: "
+ (_("%pB: %pA+%#" PRIx64 ": %%w: "
"%s relocation against unexpected insn"),
info->abfd, info->sec, (uint64_t) irel->r_offset, howto->name);
return true;
@@ -3167,7 +3167,7 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: %pA+%#" PRIx64 ": warning: "
+ (_("%pB: %pA+%#" PRIx64 ": %%w: "
"%s relocation against unexpected insn"),
abfd, info->sec, (uint64_t) irel->r_offset, "LITERAL");
return true;
diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c
index 2f37e90cc15..feb4b4fbf61 100644
--- a/bfd/elf64-ia64-vms.c
+++ b/bfd/elf64-ia64-vms.c
@@ -5147,14 +5147,14 @@ elf64_vms_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (normal_bfd == NULL)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: alignment %u of common symbol `%s' in %pB"
+ (_("%%w: alignment %u of common symbol `%s' in %pB"
" is greater than the alignment (%u) of its section %pA"),
1 << common_align, name, common_bfd,
1 << normal_align, h->root.u.def.section);
else
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: alignment %u of symbol `%s' in %pB"
+ (_("%%w: alignment %u of symbol `%s' in %pB"
" is smaller than %u in %pB"),
1 << normal_align, name, normal_bfd,
1 << common_align, common_bfd);
@@ -5170,7 +5170,7 @@ elf64_vms_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
&& ! size_change_ok)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: size of symbol `%s' changed"
+ (_("%%w: size of symbol `%s' changed"
" from %" PRIu64 " in %pB to %" PRIu64 " in %pB"),
name, (uint64_t) h->size, old_bfd,
(uint64_t) isym->st_size, abfd);
@@ -5197,7 +5197,7 @@ elf64_vms_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (h->type != STT_NOTYPE && ! type_change_ok)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: type of symbol `%s' changed"
+ (_("%%w: type of symbol `%s' changed"
" from %d to %d in %pB"),
name, h->type, type, abfd);
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index cf68124ec12..ffaf626a7d1 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -1358,7 +1358,7 @@ ppc64_elf_reloc_name_lookup (bfd *abfd, const char *r_name)
for (i = 0; i < ARRAY_SIZE (compat_map); i++)
if (strcasecmp (compat_map[i][0], r_name) == 0)
{
- _bfd_error_handler (_("warning: %s should be used rather than %s"),
+ _bfd_error_handler (_("%%w: %s should be used rather than %s"),
compat_map[i][1], compat_map[i][0]);
return ppc64_elf_reloc_name_lookup (abfd, compat_map[i][1]);
}
@@ -7974,7 +7974,7 @@ ppc64_elf_tls_setup (struct bfd_link_info *info)
__glink_PLTresolve save of r2 is incompatible with code
making tail calls, because the tail call might go via the
resolver and thus overwrite the proper saved r2. */
- _bfd_error_handler (_("warning: --plt-localentry is incompatible with "
+ _bfd_error_handler (_("%%w: --plt-localentry is incompatible with "
"power10 pc-relative code"));
htab->params->plt_localentry0 = 0;
}
@@ -7982,7 +7982,7 @@ ppc64_elf_tls_setup (struct bfd_link_info *info)
&& elf_link_hash_lookup (&htab->elf, "GLIBC_2.26",
false, false, false) == NULL)
_bfd_error_handler
- (_("warning: --plt-localentry is especially dangerous without "
+ (_("%%w: --plt-localentry is especially dangerous without "
"ld.so support to detect ABI violations"));
tga = elf_link_hash_lookup (&htab->elf, ".__tls_get_addr",
@@ -8504,7 +8504,7 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info)
{
/* xgettext:c-format */
info->callbacks->minfo
- (_("%H: warning: %s unexpected insn %#x.\n"),
+ (_("%H: %%w: %s unexpected insn %#x.\n"),
ibfd, sec, off, "R_PPC64_TPREL16_HA", insn);
htab->do_tls_opt = 0;
}
@@ -10522,7 +10522,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd,
}
if (bfd_is_abs_section (s->output_section))
- _bfd_error_handler (_("warning: discarding dynamic section %s"),
+ _bfd_error_handler (_("%%w: discarding dynamic section %s"),
s->name);
if ((s->flags & SEC_HAS_CONTENTS) == 0)
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 1e0784611bc..fc363550d9b 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -339,7 +339,7 @@ elf_swap_shdr_in (bfd *abfd,
|| dst->sh_size > filesize - dst->sh_offset)
&& !abfd->read_only)
{
- _bfd_error_handler (_("warning: %pB has a section "
+ _bfd_error_handler (_("%%w: %pB has a section "
"extending past end of file"), abfd);
abfd->read_only = 1;
}
@@ -787,7 +787,7 @@ elf_object_p (bfd *abfd)
if (!abfd->read_only)
{
_bfd_error_handler
- (_("warning: %pB has a corrupt string table index"), abfd);
+ (_("%%w: %pB has a corrupt string table index"), abfd);
abfd->read_only = 1;
}
}
@@ -835,7 +835,7 @@ elf_object_p (bfd *abfd)
i_phdr->p_align &= -i_phdr->p_align;
if (!abfd->read_only)
{
- _bfd_error_handler (_("warning: %pB has a program header "
+ _bfd_error_handler (_("%%w: %pB has a program header "
"with invalid alignment"), abfd);
abfd->read_only = 1;
}
diff --git a/bfd/elfcore.h b/bfd/elfcore.h
index 3f81145392a..04285843cd3 100644
--- a/bfd/elfcore.h
+++ b/bfd/elfcore.h
@@ -277,7 +277,7 @@ elf_core_file_p (bfd *abfd)
&& (p->p_offset >= filesize
|| p->p_filesz > filesize - p->p_offset))
{
- _bfd_error_handler (_("warning: %pB has a segment "
+ _bfd_error_handler (_("%%w: %pB has a segment "
"extending past end of file"), abfd);
abfd->read_only = 1;
break;
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 35c1c7e01e0..03c87d24786 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -3266,7 +3266,7 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
&& h->type == STT_NOTYPE
&& !h->needs_plt)
_bfd_error_handler
- (_("warning: type and size of dynamic symbol `%s' are not defined"),
+ (_("%%w: type and size of dynamic symbol `%s' are not defined"),
h->root.root.string);
if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h))
@@ -5335,21 +5335,21 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (normal_bfd == NULL)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: alignment %u of common symbol `%s' in %pB is"
+ (_("%%w: alignment %u of common symbol `%s' in %pB is"
" greater than the alignment (%u) of its section %pA"),
1 << common_align, name, common_bfd,
1 << normal_align, h->root.u.def.section);
else
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: alignment %u of normal symbol `%s' in %pB"
+ (_("%%w: alignment %u of normal symbol `%s' in %pB"
" is smaller than %u used by the common definition in %pB"),
1 << normal_align, name, normal_bfd,
1 << common_align, common_bfd);
/* PR 30499: make sure that users understand that this warning is serious. */
_bfd_error_handler
- (_("warning: NOTE: alignment discrepancies can cause real problems. Investigation is advised."));
+ (_("%%w: NOTE: alignment discrepancies can cause real problems. Investigation is advised."));
}
}
@@ -5364,14 +5364,14 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: size of symbol `%s' changed"
+ (_("%%w: size of symbol `%s' changed"
" from %" PRIu64 " in %pB to %" PRIu64 " in %pB"),
name, (uint64_t) h->size, old_bfd,
(uint64_t) isym->st_size, abfd);
/* PR 30499: make sure that users understand that this warning is serious. */
_bfd_error_handler
- (_("warning: NOTE: size discrepancies can cause real problems. Investigation is advised."));
+ (_("%%w: NOTE: size discrepancies can cause real problems. Investigation is advised."));
}
h->size = isym->st_size;
@@ -5404,7 +5404,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (h->type != STT_NOTYPE && ! type_change_ok)
/* xgettext:c-format */
_bfd_error_handler
- (_("warning: type of symbol `%s' changed"
+ (_("%%w: type of symbol `%s' changed"
" from %d to %d in %pB"),
name, h->type, type, abfd);
@@ -7185,7 +7185,7 @@ error: creating an executable stack because of -z execstack command line option"
_bfd_error_handler
(_("\
-warning: enabling an executable stack because of -z execstack command line option"));
+%%w: enabling an executable stack because of -z execstack command line option"));
}
elf_stack_flags (output_bfd) = PF_R | PF_W | PF_X;
@@ -7253,7 +7253,7 @@ error: %s: is triggering the generation of an executable stack (because it has a
}
_bfd_error_handler (_("\
-warning: %s: requires executable stack (because the .note.GNU-stack section is executable)"),
+%%w: %s: requires executable stack (because the .note.GNU-stack section is executable)"),
bfd_get_filename (noteobj));
}
else if (emptyobj)
@@ -7267,7 +7267,7 @@ error: %s: is triggering the generation of an executable stack because it does n
}
_bfd_error_handler (_("\
-warning: %s: missing .note.GNU-stack section implies executable stack"),
+%%w: %s: missing .note.GNU-stack section implies executable stack"),
bfd_get_filename (emptyobj));
_bfd_error_handler (_("\
NOTE: This behaviour is deprecated and will be removed in a future version of the linker"));
@@ -13327,7 +13327,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
}
if (o->size == 0)
_bfd_error_handler
- (_("warning: %s section has zero size"), name);
+ (_("%%w: %s section has zero size"), name);
dyn.d_un.d_val = o->size;
break;
@@ -13375,7 +13375,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
if (elf_section_data (o->output_section)->this_hdr.sh_type == SHT_NOTE)
{
_bfd_error_handler
- (_("warning: section '%s' is being made into a note"), name);
+ (_("%%w: section '%s' is being made into a note"), name);
bfd_set_error (bfd_error_nonrepresentable_section);
goto error_return;
}
@@ -14386,7 +14386,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
if (!bed->can_gc_sections
|| !is_elf_hash_table (info->hash))
{
- _bfd_error_handler(_("warning: gc-sections option ignored"));
+ _bfd_error_handler(_("%%w: gc-sections option ignored"));
return true;
}
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 109517db4aa..39fd126c2a4 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -10228,14 +10228,14 @@ elfNN_aarch64_merge_gnu_properties (struct bfd_link_info *info,
if ((aprop && !(aprop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
|| !aprop)
{
- _bfd_error_handler (_("%pB: warning: BTI turned on by -z force-bti when "
+ _bfd_error_handler (_("%pB: %%w: BTI turned on by -z force-bti when "
"all inputs do not have BTI in NOTE section."),
abfd);
}
if ((bprop && !(bprop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
|| !bprop)
{
- _bfd_error_handler (_("%pB: warning: BTI turned on by -z force-bti when "
+ _bfd_error_handler (_("%pB: %%w: BTI turned on by -z force-bti when "
"all inputs do not have BTI in NOTE section."),
bbfd);
}
diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index 1895699af06..6660e101b03 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -2445,7 +2445,7 @@ loongarch_reloc_is_fatal (struct bfd_link_info *info,
is_undefweak ? "[undefweak] " : "", name, msg);
break;
case bfd_reloc_dangerous:
- info->callbacks->info ("%pB(%pA+0x%v): warning: %s against %s`%s':\n%s\n",
+ info->callbacks->info ("%pB(%pA+0x%v): %%w: %s against %s`%s':\n%s\n",
input_bfd, input_section, rel->r_offset,
howto->name,
is_undefweak ? "[undefweak] " : "", name, msg);
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 8b27e3b8d6a..4ca9da26984 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -323,7 +323,7 @@ riscv_make_plt_header (bfd *output_bfd, bfd_vma gotplt_addr, bfd_vma addr,
/* RVE has no t3 register, so this won't work, and is not supported. */
if (elf_elfheader (output_bfd)->e_flags & EF_RISCV_RVE)
{
- _bfd_error_handler (_("%pB: warning: RVE PLT generation not supported"),
+ _bfd_error_handler (_("%pB: %%w: RVE PLT generation not supported"),
output_bfd);
return false;
}
@@ -358,7 +358,7 @@ riscv_make_plt_entry (bfd *output_bfd, bfd_vma got, bfd_vma addr,
/* RVE has no t3 register, so this won't work, and is not supported. */
if (elf_elfheader (output_bfd)->e_flags & EF_RISCV_RVE)
{
- _bfd_error_handler (_("%pB: warning: RVE PLT generation not supported"),
+ _bfd_error_handler (_("%pB: %%w: RVE PLT generation not supported"),
output_bfd);
return false;
}
@@ -2546,7 +2546,7 @@ riscv_elf_relocate_section (bfd *output_bfd,
warnings/errors in assembler. */
if (htab->params->check_uleb128
&& rel->r_addend != 0)
- _bfd_error_handler (_("%pB: warning: R_RISCV_SUB_ULEB128 with"
+ _bfd_error_handler (_("%pB: %%w: R_RISCV_SUB_ULEB128 with"
" non-zero addend, please rebuild by"
" binutils 2.42 or up"), input_bfd);
}
@@ -3939,7 +3939,7 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
&& in_priv_spec != out_priv_spec)
{
_bfd_error_handler
- (_("warning: %pB use privileged spec version %u.%u.%u but "
+ (_("%%w: %pB use privileged spec version %u.%u.%u but "
"the output use version %u.%u.%u"),
ibfd,
in_attr[Tag_a].i,
@@ -3956,7 +3956,7 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
|| out_priv_spec == PRIV_SPEC_CLASS_1P9P1)
{
_bfd_error_handler
- (_("warning: privileged spec version 1.9.1 can not be "
+ (_("%%w: privileged spec version 1.9.1 can not be "
"linked with other spec versions"));
}
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
index d1279adc2e4..15a099e9314 100644
--- a/bfd/elfxx-aarch64.c
+++ b/bfd/elfxx-aarch64.c
@@ -474,7 +474,7 @@ _bfd_aarch64_elf_resolve_relocation (bfd *input_bfd,
case we choose to emit 0. */
if (weak_undef_p && tls_reloc)
{
- _bfd_error_handler (_("%pB: warning: Weak TLS is implementation "
+ _bfd_error_handler (_("%pB: %%w: Weak TLS is implementation "
"defined and may not work as expected"),
input_bfd);
value = place;
@@ -735,7 +735,7 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
4);
if (gnu_prop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI
&& !(prop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
- _bfd_error_handler (_("%pB: warning: BTI turned on by -z force-bti "
+ _bfd_error_handler (_("%pB: %%w: BTI turned on by -z force-bti "
"when all inputs do not have BTI in NOTE "
"section."), ebfd);
prop->u.number |= gnu_prop;
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 69dd71419ff..46a030aee28 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -7391,7 +7391,7 @@ _bfd_mips_elf_section_processing (bfd *abfd, Elf_Internal_Shdr *hdr)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: bad `%s' option size %u smaller than"
+ (_("%pB: %%w: bad `%s' option size %u smaller than"
" its header"),
abfd, MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size);
break;
@@ -7627,7 +7627,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd,
bad_opt:
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: truncated `%s' option"),
+ (_("%pB: %%w: truncated `%s' option"),
abfd, MIPS_ELF_OPTIONS_SECTION_NAME (abfd));
break;
}
@@ -8451,7 +8451,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: cannot determine the target function for"
+ (_("%pB: %%w: cannot determine the target function for"
" stub section `%s'"),
abfd, name);
bfd_set_error (bfd_error_bad_value);
@@ -8577,7 +8577,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: cannot determine the target function for"
+ (_("%pB: %%w: cannot determine the target function for"
" stub section `%s'"),
abfd, name);
bfd_set_error (bfd_error_bad_value);
@@ -15543,7 +15543,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info)
!= ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0))
{
_bfd_error_handler
- (_("%pB: warning: linking abicalls files with non-abicalls files"),
+ (_("%pB: %%w: linking abicalls files with non-abicalls files"),
ibfd);
ok = true;
}
@@ -15775,19 +15775,19 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
if (!out_string && !in_string)
/* xgettext:c-format */
_bfd_error_handler
- (_("warning: %pB uses unknown floating point ABI %d "
+ (_("%%w: %pB uses unknown floating point ABI %d "
"(set by %pB), %pB uses unknown floating point ABI %d"),
obfd, out_fp, abi_fp_bfd, ibfd, in_fp);
else if (!out_string)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses unknown floating point ABI %d "
+ (_("%%w: %pB uses unknown floating point ABI %d "
"(set by %pB), %pB uses %s"),
obfd, out_fp, abi_fp_bfd, ibfd, in_string);
else if (!in_string)
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses %s (set by %pB), "
+ (_("%%w: %pB uses %s (set by %pB), "
"%pB uses unknown floating point ABI %d"),
obfd, out_string, abi_fp_bfd, ibfd, in_fp);
else
@@ -15801,7 +15801,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
in_string = "-mhard-float";
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses %s (set by %pB), %pB uses %s"),
+ (_("%%w: %pB uses %s (set by %pB), %pB uses %s"),
obfd, out_string, abi_fp_bfd, ibfd, in_string);
}
}
@@ -15820,7 +15820,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
case Val_GNU_MIPS_ABI_MSA_128:
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses %s (set by %pB), "
+ (_("%%w: %pB uses %s (set by %pB), "
"%pB uses unknown MSA ABI %d"),
obfd, "-mmsa", abi_msa_bfd,
ibfd, in_attr[Tag_GNU_MIPS_ABI_MSA].i);
@@ -15832,7 +15832,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
case Val_GNU_MIPS_ABI_MSA_128:
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses unknown MSA ABI %d "
+ (_("%%w: %pB uses unknown MSA ABI %d "
"(set by %pB), %pB uses %s"),
obfd, out_attr[Tag_GNU_MIPS_ABI_MSA].i,
abi_msa_bfd, ibfd, "-mmsa");
@@ -15841,7 +15841,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info)
default:
_bfd_error_handler
/* xgettext:c-format */
- (_("warning: %pB uses unknown MSA ABI %d "
+ (_("%%w: %pB uses unknown MSA ABI %d "
"(set by %pB), %pB uses unknown MSA ABI %d"),
obfd, out_attr[Tag_GNU_MIPS_ABI_MSA].i,
abi_msa_bfd, ibfd, in_attr[Tag_GNU_MIPS_ABI_MSA].i);
@@ -15970,27 +15970,27 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (LEVEL_REV (in_abiflags.isa_level, in_abiflags.isa_rev)
< LEVEL_REV (abiflags.isa_level, abiflags.isa_rev))
_bfd_error_handler
- (_("%pB: warning: inconsistent ISA between e_flags and "
+ (_("%pB: %%w: inconsistent ISA between e_flags and "
".MIPS.abiflags"), ibfd);
if (abiflags.fp_abi != Val_GNU_MIPS_ABI_FP_ANY
&& in_abiflags.fp_abi != abiflags.fp_abi)
_bfd_error_handler
- (_("%pB: warning: inconsistent FP ABI between .gnu.attributes and "
+ (_("%pB: %%w: inconsistent FP ABI between .gnu.attributes and "
".MIPS.abiflags"), ibfd);
if ((in_abiflags.ases & abiflags.ases) != abiflags.ases)
_bfd_error_handler
- (_("%pB: warning: inconsistent ASEs between e_flags and "
+ (_("%pB: %%w: inconsistent ASEs between e_flags and "
".MIPS.abiflags"), ibfd);
/* The isa_ext is allowed to be an extension of what can be inferred
from e_flags. */
if (!mips_mach_extends_p (bfd_mips_isa_ext_mach (abiflags.isa_ext),
bfd_mips_isa_ext_mach (in_abiflags.isa_ext)))
_bfd_error_handler
- (_("%pB: warning: inconsistent ISA extensions between e_flags and "
+ (_("%pB: %%w: inconsistent ISA extensions between e_flags and "
".MIPS.abiflags"), ibfd);
if (in_abiflags.flags2 != 0)
_bfd_error_handler
- (_("%pB: warning: unexpected flag in the flags2 field of "
+ (_("%pB: %%w: unexpected flag in the flags2 field of "
".MIPS.abiflags (0x%lx)"), ibfd,
in_abiflags.flags2);
}
diff --git a/bfd/format.c b/bfd/format.c
index 47c3e9ba35a..adf289f95b2 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -353,7 +353,8 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
/* Don't report errors on recursive calls checking the first element
of an archive. */
if (in_check_format)
- orig_error_handler = bfd_set_error_handler (null_error_handler);
+ orig_error_handler = bfd_set_error_handler (null_error_handler,
+ NULL);
else
orig_error_handler = _bfd_set_error_handler_caching (abfd);
++in_check_format;
@@ -598,7 +599,7 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
if (preserve_match.marker != NULL)
bfd_preserve_finish (abfd, &preserve_match);
bfd_preserve_finish (abfd, &preserve);
- bfd_set_error_handler (orig_error_handler);
+ bfd_set_error_handler (orig_error_handler, NULL);
struct per_xvec_message **list = _bfd_per_xvec_warn (abfd->xvec, 0);
if (*list)
@@ -650,7 +651,7 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
if (preserve_match.marker != NULL)
bfd_preserve_finish (abfd, &preserve_match);
bfd_preserve_restore (abfd, &preserve);
- bfd_set_error_handler (orig_error_handler);
+ bfd_set_error_handler (orig_error_handler, NULL);
struct per_xvec_message **list = _bfd_per_xvec_warn (NULL, 0);
struct per_xvec_message **one = NULL;
for (size_t i = 0; i < _bfd_target_vector_entries + 1; i++)
diff --git a/bfd/mmo.c b/bfd/mmo.c
index 485a1c3ca33..9526df58d75 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -3111,7 +3111,7 @@ mmo_write_symbols_and_terminator (bfd *abfd)
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: warning: symbol table too large for mmo, larger than 65535"
+ (_("%pB: %%w: symbol table too large for mmo, larger than 65535"
" 32-bit words: %d. Only `Main' will be emitted.\n"),
abfd, trie_len);
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index 6ef9abcd883..e814f031605 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -3499,7 +3499,7 @@ xcoff_build_ldsym (struct xcoff_loader_info *ldinfo,
&& (h->flags & XCOFF_WAS_UNDEFINED) != 0)
{
_bfd_error_handler
- (_("warning: attempt to export undefined symbol `%s'"),
+ (_("%%w: attempt to export undefined symbol `%s'"),
h->root.root.string);
return true;
}
diff --git a/ld/ldlang.c b/ld/ldlang.c
index ea85ffd704b..7feab507153 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -7266,7 +7266,7 @@ lang_check (void)
bfd_merge_private_bfd_data, since it may set up
information which is needed in the output file. */
if (!command_line.warn_mismatch)
- pfn = bfd_set_error_handler (ignore_bfd_errors);
+ pfn = bfd_set_error_handler (ignore_bfd_errors, NULL);
if (!bfd_merge_private_bfd_data (input_bfd, &link_info))
{
if (command_line.warn_mismatch)
@@ -7274,7 +7274,7 @@ lang_check (void)
" of file %pB\n"), input_bfd);
}
if (!command_line.warn_mismatch)
- bfd_set_error_handler (pfn);
+ bfd_set_error_handler (pfn, NULL);
}
}
}
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 6e4cb767033..efcdeef706a 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -274,9 +274,6 @@ main (int argc, char **argv)
leave no trace. */
default_bfd_assert_handler = bfd_set_assert_handler (ld_bfd_assert_handler);
- /* Also hook the bfd error/warning handler for --fatal-warnings. */
- default_bfd_error_handler = bfd_set_error_handler (ld_bfd_error_handler);
-
xatexit (ld_cleanup);
/* Set up the sysroot directory. */
@@ -374,6 +371,12 @@ main (int argc, char **argv)
lang_has_input_file = false;
parse_args (argc, argv);
+ /* Also hook the bfd error/warning handler for --fatal-warnings. */
+ default_bfd_error_handler
+ = bfd_set_error_handler (ld_bfd_error_handler,
+ (config.fatal_warnings
+ ? _("error") : NULL));
+
if (config.hash_table_size != 0)
bfd_hash_set_default_size (config.hash_table_size);
diff --git a/ld/testsuite/ld-elf/note-4.l b/ld/testsuite/ld-elf/note-4.l
new file mode 100644
index 00000000000..6bcf9ea625d
--- /dev/null
+++ b/ld/testsuite/ld-elf/note-4.l
@@ -0,0 +1,2 @@
+.*error: section '(.gnu|).hash' is being made into a note
+.*
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 277dc7bf2de..58a68793fae 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -422,6 +422,11 @@ run_ld_link_tests [list \
"$LFLAGS --script note-3.t tmpdir/note-3.so" "" "" "" \
{ { ld "note-3.l" } } \
"a.out" ] \
+ [list "Link using broken linker script with --fatal-warnings" \
+ "$LFLAGS --fatal-warnings --script note-3.t tmpdir/note-3.so" \
+ "" "" "" \
+ { { ld "note-4.l" } } \
+ "a.out" ] \
]
run_ld_link_tests [list \
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-26 21:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-26 21:46 [PATCH v2 0/2] ld: Output error for warnings with --fatal-warnings H.J. Lu
2024-01-26 21:46 ` [PATCH v2 1/2] ld: Output error for linker " H.J. Lu
2024-01-26 21:46 ` [PATCH v2 2/2] bfd: Output error for linker --fatal-warnings option H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).