summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Dora <sunilkumar.dora@windriver.com>2025-05-20 05:38:32 -0700
committerSteve Sakoman <steve@sakoman.com>2025-05-27 09:38:57 -0700
commit163530690fe0d0ee78c8cdeabab5cf0d37f1c358 (patch)
treef487409dce7a0147c26acd1ac7c55fb038ff3626
parent79babbe58a43e7c2c71aaadcfc4dad3a1faf1a5d (diff)
downloadpoky-163530690fe0d0ee78c8cdeabab5cf0d37f1c358.tar.gz
binutils: Fix CVE-2025-1153
PR 32603 [https://sourceware.org/bugzilla/show_bug.cgi?id=32603] Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0b7f992b78fe0984fc7d84cc748d0794e4a400e3 && https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31e9e2e8d1090da0c1da97a70005d8841fff8ddd && https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fe459e33c676883b5f28cc96c00e242973d906a9] (From OE-Core rev: c8cb463ccee514935fe14544173c85001d66e60b) Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.42.inc3
-rw-r--r--meta/recipes-devtools/binutils/binutils/0019-CVE-2025-1153-1.patch3207
-rw-r--r--meta/recipes-devtools/binutils/binutils/0020-CVE-2025-1153-2.patch840
-rw-r--r--meta/recipes-devtools/binutils/binutils/0021-CVE-2025-1153-3.patch3756
4 files changed, 7806 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.42.inc b/meta/recipes-devtools/binutils/binutils-2.42.inc
index e103e712a4..bc826753cf 100644
--- a/meta/recipes-devtools/binutils/binutils-2.42.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.42.inc
@@ -45,5 +45,8 @@ SRC_URI = "\
45 file://CVE-2025-1181-pre.patch \ 45 file://CVE-2025-1181-pre.patch \
46 file://CVE-2025-1181.patch \ 46 file://CVE-2025-1181.patch \
47 file://CVE-2025-1182.patch \ 47 file://CVE-2025-1182.patch \
48 file://0019-CVE-2025-1153-1.patch \
49 file://0020-CVE-2025-1153-2.patch \
50 file://0021-CVE-2025-1153-3.patch \
48" 51"
49S = "${WORKDIR}/git" 52S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0019-CVE-2025-1153-1.patch b/meta/recipes-devtools/binutils/binutils/0019-CVE-2025-1153-1.patch
new file mode 100644
index 0000000000..fa26961447
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0019-CVE-2025-1153-1.patch
@@ -0,0 +1,3207 @@
1From 0b7f992b78fe0984fc7d84cc748d0794e4a400e3 Mon Sep 17 00:00:00 2001
2From: Alan Modra <amodra@gmail.com>
3Date: Thu, 6 Feb 2025 21:46:22 +1030
4Subject: [PATCH] PR 32603, ld -w misbehaviorur
5
6ld -w currently causes segmentation faults and other misbehaviour
7since it changes einfo with %F in the format string (fatal error) to
8not exit. This patch fixes that by introducing a new variant of einfo
9called "fatal" that always exits, and replaces all einfo calls using
10%F with a call to fatal without the %F. I considered modifying einfo
11to inspect the first 2 or 4 chars in the format string, looking for
12%F, but decided that was probably a bad idea given that translators
13might have moved the %F. It's also a little nicer to inform the
14compiler of a function that doesn't return.
15
16The patch also fixes some formatting nits, and makes use of %pA
17to print section names in a couple of places in aix.em.
18
19Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0b7f992b78fe0984fc7d84cc748d0794e4a400e3]
20CVE: CVE-2025-1153
21
22Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
23---
24 ld/emulparams/call_nop.sh | 6 +--
25 ld/emulparams/cet.sh | 2 +-
26 ld/emulparams/elf32mcore.sh | 2 +-
27 ld/emulparams/x86-64-lam.sh | 6 +--
28 ld/emulparams/x86-64-level.sh | 2 +-
29 ld/emultempl/aarch64elf.em | 6 +--
30 ld/emultempl/aix.em | 41 ++++++++-------
31 ld/emultempl/armelf.em | 10 ++--
32 ld/emultempl/avrelf.em | 2 +-
33 ld/emultempl/beos.em | 24 ++++-----
34 ld/emultempl/cr16elf.em | 4 +-
35 ld/emultempl/cskyelf.em | 4 +-
36 ld/emultempl/elf.em | 18 +++----
37 ld/emultempl/hppaelf.em | 4 +-
38 ld/emultempl/kvxelf.em | 7 ++-
39 ld/emultempl/loongarchelf.em | 4 +-
40 ld/emultempl/m68hc1xelf.em | 2 +-
41 ld/emultempl/m68kelf.em | 4 +-
42 ld/emultempl/metagelf.em | 4 +-
43 ld/emultempl/mipself.em | 2 +-
44 ld/emultempl/mmix-elfnmmo.em | 5 +-
45 ld/emultempl/nds32elf.em | 6 +--
46 ld/emultempl/nto.em | 28 +++++------
47 ld/emultempl/pe.em | 20 ++++----
48 ld/emultempl/pep.em | 16 +++---
49 ld/emultempl/ppc32elf.em | 4 +-
50 ld/emultempl/ppc64elf.em | 10 ++--
51 ld/emultempl/riscvelf.em | 2 +-
52 ld/emultempl/s390.em | 2 +-
53 ld/emultempl/scoreelf.em | 2 +-
54 ld/emultempl/spuelf.em | 20 ++++----
55 ld/emultempl/tic6xdsbt.em | 10 ++--
56 ld/emultempl/ticoff.em | 4 +-
57 ld/emultempl/v850elf.em | 2 +-
58 ld/emultempl/vms.em | 2 +-
59 ld/emultempl/xtensaelf.em | 12 ++---
60 ld/emultempl/z80.em | 2 +-
61 ld/ldcref.c | 8 +--
62 ld/ldelf.c | 34 ++++++-------
63 ld/ldelfgen.c | 17 +++----
64 ld/ldemul.c | 2 +-
65 ld/ldexp.c | 42 ++++++++--------
66 ld/ldfile.c | 14 +++---
67 ld/ldgram.y | 6 +--
68 ld/ldlang.c | 95 +++++++++++++++++------------------
69 ld/ldlex.l | 14 ++----
70 ld/ldmain.c | 44 ++++++++--------
71 ld/ldmisc.c | 28 ++++++++---
72 ld/ldmisc.h | 1 +
73 ld/ldwrite.c | 20 ++++----
74 ld/lexsup.c | 72 +++++++++++++-------------
75 ld/mri.c | 2 +-
76 ld/pe-dll.c | 12 ++---
77 ld/plugin.c | 27 +++++-----
78 54 files changed, 363 insertions(+), 376 deletions(-)
79
80diff --git a/ld/emulparams/call_nop.sh b/ld/emulparams/call_nop.sh
81index 2c3c305f..7dd6dfb1 100644
82--- a/ld/emulparams/call_nop.sh
83+++ b/ld/emulparams/call_nop.sh
84@@ -20,7 +20,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP='
85 char *end;
86 params.call_nop_byte = strtoul (optarg + 16 , &end, 0);
87 if (*end)
88- einfo (_("%F%P: invalid number for -z call-nop=prefix-: %s\n"),
89+ fatal (_("%P: invalid number for -z call-nop=prefix-: %s\n"),
90 optarg + 16);
91 params.call_nop_as_suffix = false;
92 }
93@@ -29,12 +29,12 @@ PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP='
94 char *end;
95 params.call_nop_byte = strtoul (optarg + 16, &end, 0);
96 if (*end)
97- einfo (_("%F%P: invalid number for -z call-nop=suffix-: %s\n"),
98+ fatal (_("%P: invalid number for -z call-nop=suffix-: %s\n"),
99 optarg + 16);
100 params.call_nop_as_suffix = true;
101 }
102 else
103- einfo (_("%F%P: unsupported option: -z %s\n"), optarg);
104+ fatal (_("%P: unsupported option: -z %s\n"), optarg);
105 }
106 '
107
108diff --git a/ld/emulparams/cet.sh b/ld/emulparams/cet.sh
109index 2c627994..e463441d 100644
110--- a/ld/emulparams/cet.sh
111+++ b/ld/emulparams/cet.sh
112@@ -29,7 +29,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_CET='
113 | prop_report_ibt
114 | prop_report_shstk);
115 else
116- einfo (_("%F%P: invalid option for -z cet-report=: %s\n"),
117+ fatal (_("%P: invalid option for -z cet-report=: %s\n"),
118 optarg + 11);
119 }
120 '
121diff --git a/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh
122index 88a8cb6e..275a796f 100644
123--- a/ld/emulparams/elf32mcore.sh
124+++ b/ld/emulparams/elf32mcore.sh
125@@ -46,6 +46,6 @@ PARSE_AND_LIST_ARGS_CASES='
126 case OPTION_BASE_FILE:
127 link_info.base_file = fopen (optarg, FOPEN_WB);
128 if (link_info.base_file == NULL)
129- einfo (_("%F%P: cannot open base file %s\n"), optarg);
130+ fatal (_("%P: cannot open base file %s\n"), optarg);
131 break;
132 '
133diff --git a/ld/emulparams/x86-64-lam.sh b/ld/emulparams/x86-64-lam.sh
134index fab42ff1..6e629ebb 100644
135--- a/ld/emulparams/x86-64-lam.sh
136+++ b/ld/emulparams/x86-64-lam.sh
137@@ -25,7 +25,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_LAM='
138 else if (strcmp (optarg + 15, "error") == 0)
139 params.lam_u48_report = prop_report_error;
140 else
141- einfo (_("%F%P: invalid option for -z lam-u48-report=: %s\n"),
142+ fatal (_("%P: invalid option for -z lam-u48-report=: %s\n"),
143 optarg + 15);
144 }
145 else if (strcmp (optarg, "lam-u57") == 0)
146@@ -39,7 +39,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_LAM='
147 else if (strcmp (optarg + 15, "error") == 0)
148 params.lam_u57_report = prop_report_error;
149 else
150- einfo (_("%F%P: invalid option for -z lam-u57-report=: %s\n"),
151+ fatal (_("%P: invalid option for -z lam-u57-report=: %s\n"),
152 optarg + 15);
153 }
154 else if (strncmp (optarg, "lam-report=", 11) == 0)
155@@ -60,7 +60,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_LAM='
156 params.lam_u57_report = prop_report_error;
157 }
158 else
159- einfo (_("%F%P: invalid option for -z lam-report=: %s\n"),
160+ fatal (_("%P: invalid option for -z lam-report=: %s\n"),
161 optarg + 11);
162 }
163 '
164diff --git a/ld/emulparams/x86-64-level.sh b/ld/emulparams/x86-64-level.sh
165index c46aacf3..7e27cf1e 100644
166--- a/ld/emulparams/x86-64-level.sh
167+++ b/ld/emulparams/x86-64-level.sh
168@@ -10,7 +10,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_X86_64_LEVEL='
169 char *end;
170 unsigned int level = strtoul (optarg + 8 , &end, 10);
171 if (*end != '\0' || level < 2 || level > 4)
172- einfo (_("%F%P: invalid x86-64 ISA level: %s\n"), optarg);
173+ fatal (_("%P: invalid x86-64 ISA level: %s\n"), optarg);
174 params.isa_level = level;
175 }
176 '
177diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
178index b647909a..a6637718 100644
179--- a/ld/emultempl/aarch64elf.em
180+++ b/ld/emultempl/aarch64elf.em
181@@ -316,7 +316,7 @@ aarch64_elf_create_output_section_statements (void)
182 These will only be created if the output format is an arm format,
183 hence we do not support linking and changing output formats at the
184 same time. Use a link followed by objcopy to change output formats. */
185- einfo (_("%F%P: error: cannot change output format "
186+ fatal (_("%P: error: cannot change output format "
187 "whilst linking %s binaries\n"), "AArch64");
188 return;
189 }
190@@ -342,7 +342,7 @@ aarch64_elf_create_output_section_statements (void)
191 bfd_get_arch (link_info.output_bfd),
192 bfd_get_mach (link_info.output_bfd)))
193 {
194- einfo (_("%F%P: can not create BFD: %E\n"));
195+ fatal (_("%P: can not create BFD: %E\n"));
196 return;
197 }
198
199@@ -468,7 +468,7 @@ PARSE_AND_LIST_ARGS_CASES='
200
201 group_size = bfd_scan_vma (optarg, &end, 0);
202 if (*end)
203- einfo (_("%F%P: invalid number `%s'\''\n"), optarg);
204+ fatal (_("%P: invalid number `%s'\''\n"), optarg);
205 }
206 break;
207 '
208diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
209index a445c329..29acdbc9 100644
210--- a/ld/emultempl/aix.em
211+++ b/ld/emultempl/aix.em
212@@ -335,7 +335,7 @@ read_file_list (const char *filename)
213 f = fopen (filename, FOPEN_RT);
214 if (f == NULL)
215 {
216- einfo (_("%F%P: cannot open %s\n"), filename);
217+ fatal (_("%P: cannot open %s\n"), filename);
218 return;
219 }
220 if (fseek (f, 0L, SEEK_END) == -1)
221@@ -382,8 +382,8 @@ read_file_list (const char *filename)
222 return;
223
224 error:
225- einfo (_("%F%P: cannot read %s\n"), optarg);
226 fclose (f);
227+ fatal (_("%P: cannot read %s\n"), optarg);
228 }
229
230 static bool
231@@ -734,7 +734,7 @@ gld${EMULATION_NAME}_after_open (void)
232 size = (p->count + 2) * 4;
233 if (!bfd_xcoff_link_record_set (link_info.output_bfd, &link_info,
234 p->h, size))
235- einfo (_("%F%P: bfd_xcoff_link_record_set failed: %E\n"));
236+ fatal (_("%P: bfd_xcoff_link_record_set failed: %E\n"));
237 }
238 }
239
240@@ -764,9 +764,9 @@ gld${EMULATION_NAME}_before_allocation (void)
241
242 h = bfd_link_hash_lookup (link_info.hash, el->name, false, false, false);
243 if (h == NULL)
244- einfo (_("%F%P: bfd_link_hash_lookup of export symbol failed: %E\n"));
245+ fatal (_("%P: bfd_link_hash_lookup of export symbol failed: %E\n"));
246 if (!bfd_xcoff_export_symbol (link_info.output_bfd, &link_info, h))
247- einfo (_("%F%P: bfd_xcoff_export_symbol failed: %E\n"));
248+ fatal (_("%P: bfd_xcoff_export_symbol failed: %E\n"));
249 }
250
251 /* Track down all relocations called for by the linker script (these
252@@ -849,7 +849,7 @@ gld${EMULATION_NAME}_before_allocation (void)
253 (link_info.output_bfd, &link_info, libpath, entry_symbol.name,
254 file_align, maxstack, maxdata, gc && !unix_ld,
255 modtype, textro, flags, special_sections, rtld))
256- einfo (_("%F%P: failed to set dynamic section sizes: %E\n"));
257+ fatal (_("%P: failed to set dynamic section sizes: %E\n"));
258
259 /* Look through the special sections, and put them in the right
260 place in the link ordering. This is especially magic. */
261@@ -871,8 +871,8 @@ gld${EMULATION_NAME}_before_allocation (void)
262 is = NULL;
263 os = lang_output_section_get (sec->output_section);
264 if (os == NULL)
265- einfo (_("%F%P: can't find output section %s\n"),
266- sec->output_section->name);
267+ fatal (_("%P: can't find output section %pA\n"),
268+ sec->output_section);
269
270 for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->header.next)
271 {
272@@ -908,8 +908,7 @@ gld${EMULATION_NAME}_before_allocation (void)
273
274 if (is == NULL)
275 {
276- einfo (_("%F%P: can't find %s in output section\n"),
277- bfd_section_name (sec));
278+ fatal (_("%P: can't find %pA in output section\n"), sec);
279 }
280
281 /* Now figure out where the section should go. */
282@@ -1162,7 +1161,7 @@ gld${EMULATION_NAME}_after_allocation (void)
283
284 /* Now that everything is in place, finalize the dynamic sections. */
285 if (!bfd_xcoff_build_dynamic_sections (link_info.output_bfd, &link_info))
286- einfo (_("%F%P: failed to layout dynamic sections: %E\n"));
287+ fatal (_("%P: failed to layout dynamic sections: %E\n"));
288
289 if (!bfd_link_relocatable (&link_info))
290 {
291@@ -1313,7 +1312,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
292 if (f == NULL)
293 {
294 bfd_set_error (bfd_error_system_call);
295- einfo ("%F%P: %s: %E\n", filename);
296+ fatal ("%P: %s: %E\n", filename);
297 return;
298 }
299
300@@ -1375,7 +1374,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
301 obstack_free (o, obstack_base (o));
302 }
303 else if (*s == '(')
304- einfo (_("%F%P:%s:%d: #! ([member]) is not supported "
305+ fatal (_("%P:%s:%d: #! ([member]) is not supported "
306 "in import files\n"),
307 filename, lineno);
308 else
309@@ -1392,7 +1391,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
310 *s = '\0';
311 if (!bfd_xcoff_split_import_path (link_info.output_bfd,
312 start, &imppath, &impfile))
313- einfo (_("%F%P: could not parse import path: %E\n"));
314+ fatal (_("%P: could not parse import path: %E\n"));
315 while (ISSPACE (cs))
316 {
317 ++s;
318@@ -1547,10 +1546,10 @@ gld${EMULATION_NAME}_find_relocs (lang_statement_union_type *s)
319
320 rs = &s->reloc_statement;
321 if (rs->name == NULL)
322- einfo (_("%F%P: only relocations against symbols are permitted\n"));
323+ fatal (_("%P: only relocations against symbols are permitted\n"));
324 if (!bfd_xcoff_link_count_reloc (link_info.output_bfd, &link_info,
325 rs->name))
326- einfo (_("%F%P: bfd_xcoff_link_count_reloc failed: %E\n"));
327+ fatal (_("%P: bfd_xcoff_link_count_reloc failed: %E\n"));
328 }
329
330 if (s->header.type == lang_assignment_statement_enum)
331@@ -1579,7 +1578,7 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
332 if (!bfd_xcoff_record_link_assignment (link_info.output_bfd,
333 &link_info,
334 exp->assign.dst))
335- einfo (_("%F%P: failed to record assignment to %s: %E\n"),
336+ fatal (_("%P: failed to record assignment to %s: %E\n"),
337 exp->assign.dst);
338 }
339 gld${EMULATION_NAME}_find_exp_assignment (exp->assign.src);
340@@ -1674,7 +1673,7 @@ gld${EMULATION_NAME}_create_output_section_statements (void)
341 bfd_get_arch (link_info.output_bfd),
342 bfd_get_mach (link_info.output_bfd)))
343 {
344- einfo (_("%F%P: can not create stub BFD: %E\n"));
345+ fatal (_("%P: can not create stub BFD: %E\n"));
346 return;
347 }
348
349@@ -1684,7 +1683,7 @@ gld${EMULATION_NAME}_create_output_section_statements (void)
350
351 /* Pass linker params to the back-end. */
352 if (!bfd_xcoff_link_init (&link_info, &params))
353- einfo (_("%F%P: can not init BFD: %E\n"));
354+ fatal (_("%P: can not init BFD: %E\n"));
355
356 /* __rtinit */
357 if (link_info.init_function != NULL
358@@ -1701,7 +1700,7 @@ gld${EMULATION_NAME}_create_output_section_statements (void)
359 bfd_get_arch (link_info.output_bfd),
360 bfd_get_mach (link_info.output_bfd)))
361 {
362- einfo (_("%F%P: can not create BFD: %E\n"));
363+ fatal (_("%P: can not create BFD: %E\n"));
364 return;
365 }
366
367@@ -1711,7 +1710,7 @@ gld${EMULATION_NAME}_create_output_section_statements (void)
368 link_info.fini_function,
369 rtld))
370 {
371- einfo (_("%F%P: can not create BFD: %E\n"));
372+ fatal (_("%P: can not create BFD: %E\n"));
373 return;
374 }
375
376diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
377index 7fb1826e..504fb0cd 100644
378--- a/ld/emultempl/armelf.em
379+++ b/ld/emultempl/armelf.em
380@@ -521,7 +521,7 @@ arm_elf_create_output_section_statements (void)
381 These will only be created if the output format is an arm format,
382 hence we do not support linking and changing output formats at the
383 same time. Use a link followed by objcopy to change output formats. */
384- einfo (_("%F%P: error: cannot change output format "
385+ fatal (_("%P: error: cannot change output format "
386 "whilst linking %s binaries\n"), "ARM");
387 return;
388 }
389@@ -532,10 +532,10 @@ arm_elf_create_output_section_statements (void)
390 bfd_get_target (link_info.output_bfd));
391
392 if (params.in_implib_bfd == NULL)
393- einfo (_("%F%P: %s: can't open: %E\n"), in_implib_filename);
394+ fatal (_("%P: %s: can't open: %E\n"), in_implib_filename);
395
396 if (!bfd_check_format (params.in_implib_bfd, bfd_object))
397- einfo (_("%F%P: %s: not a relocatable file: %E\n"), in_implib_filename);
398+ fatal (_("%P: %s: not a relocatable file: %E\n"), in_implib_filename);
399 }
400
401 bfd_elf32_arm_set_target_params (link_info.output_bfd, &link_info, &params);
402@@ -549,7 +549,7 @@ arm_elf_create_output_section_statements (void)
403 bfd_get_arch (link_info.output_bfd),
404 bfd_get_mach (link_info.output_bfd)))
405 {
406- einfo (_("%F%P: can not create BFD: %E\n"));
407+ fatal (_("%P: can not create BFD: %E\n"));
408 return;
409 }
410
411@@ -734,7 +734,7 @@ PARSE_AND_LIST_ARGS_CASES='
412
413 group_size = bfd_scan_vma (optarg, &end, 0);
414 if (*end)
415- einfo (_("%F%P: invalid number `%s'\''\n"), optarg);
416+ fatal (_("%P: invalid number `%s'\''\n"), optarg);
417 }
418 break;
419
420diff --git a/ld/emultempl/avrelf.em b/ld/emultempl/avrelf.em
421index 3fe81004..dd5b57d1 100644
422--- a/ld/emultempl/avrelf.em
423+++ b/ld/emultempl/avrelf.em
424@@ -116,7 +116,7 @@ avr_elf_create_output_section_statements (void)
425
426 if (bfd_get_flavour (link_info.output_bfd) != bfd_target_elf_flavour)
427 {
428- einfo (_("%F%P: error: cannot change output format "
429+ fatal (_("%P: error: cannot change output format "
430 "whilst linking %s binaries\n"), "AVR");
431 return;
432 }
433diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
434index 844d4986..81878b02 100644
435--- a/ld/emultempl/beos.em
436+++ b/ld/emultempl/beos.em
437@@ -227,7 +227,7 @@ set_pe_subsystem (void)
438 return;
439 }
440 }
441- einfo (_("%F%P: invalid subsystem type %s\n"), optarg);
442+ fatal (_("%P: invalid subsystem type %s\n"), optarg);
443 }
444
445
446@@ -237,9 +237,7 @@ set_pe_value (char *name)
447 char *end;
448 set_pe_name (name, strtoul (optarg, &end, 0));
449 if (end == optarg)
450- {
451- einfo (_("%F%P: invalid hex number for PE parameter '%s'\n"), optarg);
452- }
453+ fatal (_("%P: invalid hex number for PE parameter '%s'\n"), optarg);
454
455 optarg = end;
456 }
457@@ -254,9 +252,7 @@ set_pe_stack_heap (char *resname, char *comname)
458 set_pe_value (comname);
459 }
460 else if (*optarg)
461- {
462- einfo (_("%F%P: strange hex info for PE parameter '%s'\n"), optarg);
463- }
464+ fatal (_("%P: strange hex info for PE parameter '%s'\n"), optarg);
465 }
466
467
468@@ -271,7 +267,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
469 case OPTION_BASE_FILE:
470 link_info.base_file = fopen (optarg, FOPEN_WB);
471 if (link_info.base_file == NULL)
472- einfo (_("%F%P: cannot open base file %s\n"), optarg);
473+ fatal (_("%P: cannot open base file %s\n"), optarg);
474 break;
475
476 /* PE options */
477@@ -380,9 +376,7 @@ gld${EMULATION_NAME}_after_open (void)
478 FIXME: This should be done via a function, rather than by
479 including an internal BFD header. */
480 if (!obj_pe (link_info.output_bfd))
481- {
482- einfo (_("%F%P: PE operations on non PE file\n"));
483- }
484+ fatal (_("%P: PE operations on non PE file\n"));
485
486 pe_data(link_info.output_bfd)->pe_opthdr = pe;
487 pe_data(link_info.output_bfd)->dll = init[DLLOFF].value;
488@@ -431,12 +425,12 @@ sort_by_file_name (const void *a, const void *b)
489
490 if (!bfd_get_section_contents (sa->owner, sa, &a_sec, (file_ptr) 0,
491 (bfd_size_type) sizeof (a_sec)))
492- einfo (_("%F%P: %pB: can't read contents of section .idata: %E\n"),
493+ fatal (_("%P: %pB: can't read contents of section .idata: %E\n"),
494 sa->owner);
495
496 if (!bfd_get_section_contents (sb->owner, sb, &b_sec, (file_ptr) 0,
497 (bfd_size_type) sizeof (b_sec)))
498- einfo (_("%F%P: %pB: can't read contents of section .idata: %E\n"),
499+ fatal (_("%P: %pB: can't read contents of section .idata: %E\n"),
500 sb->owner);
501
502 i = a_sec < b_sec ? -1 : 0;
503@@ -668,7 +662,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
504 /* Everything from the '\$' on gets deleted so don't allow '\$' as the
505 first character. */
506 if (*secname == '\$')
507- einfo (_("%F%P: section %s has '\$' as first character\n"), secname);
508+ fatal (_("%P: section %s has '\$' as first character\n"), secname);
509 if (strchr (secname + 1, '\$') == NULL)
510 return NULL;
511
512@@ -698,7 +692,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
513 }
514 ps[0] = 0;
515 if (l == NULL)
516- einfo (_("%F%P: *(%s\$) missing from linker script\n"), output_secname);
517+ fatal (_("%P: *(%s\$) missing from linker script\n"), output_secname);
518
519 /* Link the input section in and we're done for now.
520 The sections still have to be sorted, but that has to wait until
521diff --git a/ld/emultempl/cr16elf.em b/ld/emultempl/cr16elf.em
522index 7d4f9507..5464edf1 100644
523--- a/ld/emultempl/cr16elf.em
524+++ b/ld/emultempl/cr16elf.em
525@@ -58,7 +58,7 @@ cr16_elf_after_open (void)
526 COFF and ELF. */
527 if (bfd_get_flavour (abfd) != bfd_target_coff_flavour
528 && bfd_get_flavour (abfd) != bfd_target_elf_flavour)
529- einfo (_("%F%P: %pB: all input objects must be COFF or ELF "
530+ fatal (_("%P: %pB: all input objects must be COFF or ELF "
531 "for --embedded-relocs\n"));
532
533 datasec = bfd_get_section_by_name (abfd, ".data.rel");
534@@ -82,7 +82,7 @@ cr16_elf_after_open (void)
535 | SEC_IN_MEMORY))
536 || !bfd_set_section_alignment (relsec, 2)
537 || !bfd_set_section_size (relsec, datasec->reloc_count * 8))
538- einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
539+ fatal (_("%P: %pB: can not create .emreloc section: %E\n"));
540 }
541
542 /* Double check that all other data sections are empty, as is
543diff --git a/ld/emultempl/cskyelf.em b/ld/emultempl/cskyelf.em
544index 82815e5e..9c91d7ac 100644
545--- a/ld/emultempl/cskyelf.em
546+++ b/ld/emultempl/cskyelf.em
547@@ -151,7 +151,7 @@ csky_elf_create_output_section_statements (void)
548 bfd_get_arch (link_info.output_bfd),
549 bfd_get_mach (link_info.output_bfd)))
550 {
551- einfo (_("%F%P: can not create BFD: %E\n"));
552+ fatal (_("%P: can not create BFD: %E\n"));
553 return;
554 }
555
556@@ -324,7 +324,7 @@ PARSE_AND_LIST_ARGS_CASES='
557
558 group_size = bfd_scan_vma (optarg, &end, 0);
559 if (*end)
560- einfo (_("%F%P: invalid number `%s'\''\n"), optarg);
561+ fatal (_("%P: invalid number `%s'\''\n"), optarg);
562 }
563 break;
564 '
565diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
566index 71cec19f..5cc38194 100644
567--- a/ld/emultempl/elf.em
568+++ b/ld/emultempl/elf.em
569@@ -667,13 +667,13 @@ gld${EMULATION_NAME}_handle_option (int optc)
570 {
571 #ifndef HAVE_ZSTD
572 if (config.compress_debug == COMPRESS_DEBUG_ZSTD)
573- einfo (_ ("%F%P: --compress-debug-sections=zstd: ld is not built "
574- "with zstd support\n"));
575+ fatal (_("%P: --compress-debug-sections=zstd: ld is not built "
576+ "with zstd support\n"));
577 #endif
578 }
579 if (config.compress_debug == COMPRESS_UNKNOWN)
580- einfo (_("%F%P: invalid --compress-debug-sections option: \`%s'\n"),
581- optarg);
582+ fatal (_("%P: invalid --compress-debug-sections option: \`%s'\n"),
583+ optarg);
584 break;
585 EOF
586
587@@ -727,7 +727,7 @@ fragment <<EOF
588 link_info.emit_gnu_hash = true;
589 }
590 else
591- einfo (_("%F%P: invalid hash style \`%s'\n"), optarg);
592+ fatal (_("%P: invalid hash style \`%s'\n"), optarg);
593 break;
594
595 EOF
596@@ -747,7 +747,7 @@ fragment <<EOF
597 link_info.maxpagesize = strtoul (optarg + 14, &end, 0);
598 if (*end
599 || (link_info.maxpagesize & (link_info.maxpagesize - 1)) != 0)
600- einfo (_("%F%P: invalid maximum page size \`%s'\n"),
601+ fatal (_("%P: invalid maximum page size \`%s'\n"),
602 optarg + 14);
603 link_info.maxpagesize_is_set = true;
604 }
605@@ -757,7 +757,7 @@ fragment <<EOF
606 link_info.commonpagesize = strtoul (optarg + 17, &end, 0);
607 if (*end
608 || (link_info.commonpagesize & (link_info.commonpagesize - 1)) != 0)
609- einfo (_("%F%P: invalid common page size \`%s'\n"),
610+ fatal (_("%P: invalid common page size \`%s'\n"),
611 optarg + 17);
612 link_info.commonpagesize_is_set = true;
613 }
614@@ -766,7 +766,7 @@ fragment <<EOF
615 char *end;
616 link_info.stacksize = strtoul (optarg + 11, &end, 0);
617 if (*end || link_info.stacksize < 0)
618- einfo (_("%F%P: invalid stack size \`%s'\n"), optarg + 11);
619+ fatal (_("%P: invalid stack size \`%s'\n"), optarg + 11);
620 if (!link_info.stacksize)
621 /* Use -1 for explicit no-stack, because zero means
622 'default'. */
623@@ -805,7 +805,7 @@ fragment <<EOF
624 else if (strcmp (optarg, "start-stop-visibility=protected") == 0)
625 link_info.start_stop_visibility = STV_PROTECTED;
626 else
627- einfo (_("%F%P: invalid visibility in \`-z %s'; "
628+ fatal (_("%P: invalid visibility in \`-z %s'; "
629 "must be default, internal, hidden, or protected"),
630 optarg);
631 }
632diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em
633index 09db0cb0..f0284ea3 100644
634--- a/ld/emultempl/hppaelf.em
635+++ b/ld/emultempl/hppaelf.em
636@@ -82,7 +82,7 @@ hppaelf_create_output_section_statements (void)
637 bfd_get_arch (link_info.output_bfd),
638 bfd_get_mach (link_info.output_bfd)))
639 {
640- einfo (_("%F%P: can not create BFD: %E\n"));
641+ fatal (_("%P: can not create BFD: %E\n"));
642 return;
643 }
644
645@@ -351,7 +351,7 @@ PARSE_AND_LIST_ARGS_CASES='
646 const char *end;
647 group_size = bfd_scan_vma (optarg, &end, 0);
648 if (*end)
649- einfo (_("%F%P: invalid number `%s'\''\n"), optarg);
650+ fatal (_("%P: invalid number `%s'\''\n"), optarg);
651 }
652 break;
653 '
654diff --git a/ld/emultempl/kvxelf.em b/ld/emultempl/kvxelf.em
655index 2076c5b6..1ffbd1db 100644
656--- a/ld/emultempl/kvxelf.em
657+++ b/ld/emultempl/kvxelf.em
658@@ -35,9 +35,8 @@ elf${ELFSIZE}_kvx_before_allocation (void)
659 EOF
660 if test x"${EMULATION_NAME}" != x"elf64kvx_linux"; then
661 fragment <<EOF
662- if (bfd_link_pie (&link_info)) {
663- einfo (_("%F:%P: -pie not supported\n"));
664- }
665+ if (bfd_link_pie (&link_info))
666+ fatal (_(":%P: -pie not supported\n"));
667 EOF
668 fi
669 fragment <<EOF
670@@ -300,7 +299,7 @@ kvx_elf_create_output_section_statements (void)
671 ldlang_add_file (stub_file);
672
673 if (!kvx_elf${ELFSIZE}_init_stub_bfd (&link_info, stub_file->the_bfd))
674- einfo ("%F%P: can not init BFD: %E\n");
675+ einfo ("%P: can not init BFD: %E\n");
676 }
677
678
679diff --git a/ld/emultempl/loongarchelf.em b/ld/emultempl/loongarchelf.em
680index 3bb5ddf0..5a3d7b79 100644
681--- a/ld/emultempl/loongarchelf.em
682+++ b/ld/emultempl/loongarchelf.em
683@@ -67,11 +67,11 @@ gld${EMULATION_NAME}_after_allocation (void)
684 && !bfd_link_relocatable (&link_info))
685 {
686 if (lang_phdr_list == NULL)
687- elf_seg_map (link_info.output_bfd) = NULL;
688+ elf_seg_map (link_info.output_bfd) = NULL;
689 if (!_bfd_elf_map_sections_to_segments (link_info.output_bfd,
690 &link_info,
691 NULL))
692- einfo (_("%F%P: map sections to segments failed: %E\n"));
693+ fatal (_("%P: map sections to segments failed: %E\n"));
694 }
695
696 /* Adjust program header size and .eh_frame_hdr size before
697diff --git a/ld/emultempl/m68hc1xelf.em b/ld/emultempl/m68hc1xelf.em
698index 5355b0fc..36f5f068 100644
699--- a/ld/emultempl/m68hc1xelf.em
700+++ b/ld/emultempl/m68hc1xelf.em
701@@ -159,7 +159,7 @@ m68hc11elf_create_output_section_statements (void)
702 bfd_get_arch (link_info.output_bfd),
703 bfd_get_mach (link_info.output_bfd)))
704 {
705- einfo (_("%F%P: can not create BFD: %E\n"));
706+ fatal (_("%P: can not create BFD: %E\n"));
707 return;
708 }
709
710diff --git a/ld/emultempl/m68kelf.em b/ld/emultempl/m68kelf.em
711index 0477f1eb..f9a5bec2 100644
712--- a/ld/emultempl/m68kelf.em
713+++ b/ld/emultempl/m68kelf.em
714@@ -82,7 +82,7 @@ m68k_elf_after_open (void)
715 asection *datasec;
716
717 if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
718- einfo (_("%F%P: %pB: all input objects must be ELF "
719+ fatal (_("%P: %pB: all input objects must be ELF "
720 "for --embedded-relocs\n"));
721
722 datasec = bfd_get_section_by_name (abfd, ".data");
723@@ -106,7 +106,7 @@ m68k_elf_after_open (void)
724 if (relsec == NULL
725 || !bfd_set_section_alignment (relsec, 2)
726 || !bfd_set_section_size (relsec, datasec->reloc_count * 12))
727- einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
728+ fatal (_("%P: %pB: can not create .emreloc section: %E\n"));
729 }
730
731 /* Double check that all other data sections are empty, as is
732diff --git a/ld/emultempl/metagelf.em b/ld/emultempl/metagelf.em
733index 81ab64c1..313d7ed5 100644
734--- a/ld/emultempl/metagelf.em
735+++ b/ld/emultempl/metagelf.em
736@@ -59,7 +59,7 @@ metagelf_create_output_section_statements (void)
737 bfd_get_arch (link_info.output_bfd),
738 bfd_get_mach (link_info.output_bfd)))
739 {
740- einfo (_("%F%P: can not create BFD: %E\n"));
741+ fatal (_("%P: can not create BFD: %E\n"));
742 return;
743 }
744
745@@ -309,7 +309,7 @@ PARSE_AND_LIST_ARGS_CASES='
746 const char *end;
747 group_size = bfd_scan_vma (optarg, &end, 0);
748 if (*end)
749- einfo (_("%F%P: invalid number `%s'\''\n"), optarg);
750+ fatal (_("%P: invalid number `%s'\''\n"), optarg);
751 }
752 break;
753 '
754diff --git a/ld/emultempl/mipself.em b/ld/emultempl/mipself.em
755index f8fe4b97..2a22ba49 100644
756--- a/ld/emultempl/mipself.em
757+++ b/ld/emultempl/mipself.em
758@@ -152,7 +152,7 @@ mips_add_stub_section (const char *stub_sec_name, asection *input_section,
759 bfd_get_arch (link_info.output_bfd),
760 bfd_get_mach (link_info.output_bfd)))
761 {
762- einfo (_("%F%P: can not create BFD: %E\n"));
763+ fatal (_("%P: can not create BFD: %E\n"));
764 return NULL;
765 }
766 stub_bfd->flags |= BFD_LINKER_CREATED;
767diff --git a/ld/emultempl/mmix-elfnmmo.em b/ld/emultempl/mmix-elfnmmo.em
768index f2ecbba3..03186363 100644
769--- a/ld/emultempl/mmix-elfnmmo.em
770+++ b/ld/emultempl/mmix-elfnmmo.em
771@@ -113,10 +113,7 @@ mmix_after_allocation (void)
772 bfd_set_section_vma (sec, 0);
773
774 if (!_bfd_mmix_after_linker_allocation (link_info.output_bfd, &link_info))
775- {
776- /* This is a fatal error; make einfo call not return. */
777- einfo (_("%F%P: can't finalize linker-allocated global registers\n"));
778- }
779+ fatal (_("%P: can't finalize linker-allocated global registers\n"));
780 }
781 EOF
782
783diff --git a/ld/emultempl/nds32elf.em b/ld/emultempl/nds32elf.em
784index bde9e35d..36260573 100644
785--- a/ld/emultempl/nds32elf.em
786+++ b/ld/emultempl/nds32elf.em
787@@ -44,7 +44,7 @@ nds32_elf_create_output_section_statements (void)
788 if (strstr (bfd_get_target (link_info.output_bfd), "nds32") == NULL)
789 {
790 /* Check the output target is nds32. */
791- einfo (_("%F%P: error: cannot change output format whilst "
792+ fatal (_("%P: error: cannot change output format whilst "
793 "linking %s binaries\n"), "NDS32");
794 return;
795 }
796@@ -96,7 +96,7 @@ nds32_elf_after_open (void)
797 && abi_ver != (elf_elfheader (abfd)->e_flags & EF_NDS_ABI))
798 {
799 /* Incompatible objects. */
800- einfo (_("%F%P: %pB: ABI version of object files mismatched\n"),
801+ fatal (_("%P: %pB: ABI version of object files mismatched\n"),
802 abfd);
803 }
804 }
805@@ -195,7 +195,7 @@ PARSE_AND_LIST_ARGS_CASES='
806 {
807 sym_ld_script = fopen (optarg, FOPEN_WT);
808 if(sym_ld_script == NULL)
809- einfo (_("%F%P: cannot open map file %s: %E\n"), optarg);
810+ fatal (_("%P: cannot open map file %s: %E\n"), optarg);
811 }
812 break;
813 case OPTION_HYPER_RELAX:
814diff --git a/ld/emultempl/nto.em b/ld/emultempl/nto.em
815index de69e132..609d0217 100644
816--- a/ld/emultempl/nto.em
817+++ b/ld/emultempl/nto.em
818@@ -51,7 +51,7 @@ nto_create_QNX_note_section(int type)
819 is called before this function, stub_file should already be defined. */
820 if (!stub_file)
821 {
822- einfo (_("%F%P: cannot create .note section in stub BFD.\n"));
823+ fatal (_("%P: cannot create .note section in stub BFD.\n"));
824 return NULL;
825 }
826
827@@ -60,7 +60,7 @@ nto_create_QNX_note_section(int type)
828 note_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd, ".note", flags);
829 if (! note_sec)
830 {
831- einfo (_("%F%P: failed to create .note section\n"));
832+ fatal (_("%P: failed to create .note section\n"));
833 return NULL;
834 }
835
836@@ -101,7 +101,7 @@ nto_lookup_QNX_note_section(int type)
837 sec->contents = xmalloc(sec->size);
838 if (!bfd_get_section_contents (sec->owner, sec, sec->contents, (file_ptr) 0,
839 sec->size))
840- einfo (_("%F%P: %pB: can't read contents of section .note: %E\n"),
841+ fatal (_("%P: %pB: can't read contents of section .note: %E\n"),
842 sec->owner);
843
844 e_note = (Elf_External_Note *) sec->contents;
845@@ -144,7 +144,7 @@ nto_add_note_section (void) {
846
847 if (nto_lazy_stack && !link_info.stacksize)
848 {
849- einfo (_("%F%P: error: --lazy-stack must follow -zstack-size=<size>\n"));
850+ fatal (_("%P: error: --lazy-stack must follow -zstack-size=<size>\n"));
851 return;
852 }
853
854@@ -206,22 +206,22 @@ PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}'
855 PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}'
856 fprintf (file, _("\
857 --stack <size> Set size of the initial stack\n\
858- --lazy-stack Set lazy allocation of stack\n\
859+ --lazy-stack Set lazy allocation of stack\n\
860 "));
861 '
862
863 PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
864 case OPTION_STACK:
865 {
866- char *end;
867- link_info.stacksize = strtoul (optarg, &end, 0);
868- if (*end || link_info.stacksize < 0)
869- einfo (_("%F%P: invalid stack size `%s'\''\n"), optarg + 11);
870- if (!link_info.stacksize)
871- /* Use -1 for explicit no-stack, because zero means
872- 'default'. */
873- link_info.stacksize = -1;
874- break;
875+ char *end;
876+ link_info.stacksize = strtoul (optarg, &end, 0);
877+ if (*end || link_info.stacksize < 0)
878+ fatal (_("%P: invalid stack size `%s'\''\n"), optarg + 11);
879+ if (!link_info.stacksize)
880+ /* Use -1 for explicit no-stack, because zero means
881+ 'default'. */
882+ link_info.stacksize = -1;
883+ break;
884 }
885 case OPTION_LAZY_STACK:
886 nto_lazy_stack = true;
887diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
888index c6ed1110..4cb1488e 100644
889--- a/ld/emultempl/pe.em
890+++ b/ld/emultempl/pe.em
891@@ -726,7 +726,7 @@ set_pe_subsystem (void)
892
893 if (v[i].name == NULL)
894 {
895- einfo (_("%F%P: invalid subsystem type %s\n"), optarg);
896+ fatal (_("%P: invalid subsystem type %s\n"), optarg);
897 return;
898 }
899
900@@ -747,7 +747,7 @@ set_pe_value (char *name)
901 set_pe_name (name, strtoul (optarg, &end, 0));
902
903 if (end == optarg)
904- einfo (_("%F%P: invalid hex number for PE parameter '%s'\n"), optarg);
905+ fatal (_("%P: invalid hex number for PE parameter '%s'\n"), optarg);
906
907 optarg = end;
908 }
909@@ -764,7 +764,7 @@ set_pe_stack_heap (char *resname, char *comname)
910 set_pe_value (comname);
911 }
912 else if (*optarg)
913- einfo (_("%F%P: strange hex info for PE parameter '%s'\n"), optarg);
914+ fatal (_("%P: strange hex info for PE parameter '%s'\n"), optarg);
915 }
916
917 #define DEFAULT_BUILD_ID_STYLE "md5"
918@@ -780,7 +780,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
919 case OPTION_BASE_FILE:
920 link_info.base_file = fopen (optarg, FOPEN_WB);
921 if (link_info.base_file == NULL)
922- einfo (_("%F%P: cannot open base file %s\n"), optarg);
923+ fatal (_("%P: cannot open base file %s\n"), optarg);
924 break;
925
926 /* PE options. */
927@@ -1309,7 +1309,7 @@ make_runtime_ref (void)
928 = bfd_wrapped_link_hash_lookup (link_info.output_bfd, &link_info,
929 rr, true, false, true);
930 if (!h)
931- einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
932+ fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
933 else
934 {
935 if (h->type == bfd_link_hash_new)
936@@ -1607,7 +1607,7 @@ gld${EMULATION_NAME}_after_open (void)
937 if (bfd_get_flavour (link_info.output_bfd) != bfd_target_coff_flavour
938 || coff_data (link_info.output_bfd) == NULL
939 || !obj_pe (link_info.output_bfd))
940- einfo (_("%F%P: cannot perform PE operations on non PE output file '%pB'\n"),
941+ fatal (_("%P: cannot perform PE operations on non PE output file '%pB'\n"),
942 link_info.output_bfd);
943
944 pe_data (link_info.output_bfd)->pe_opthdr = pe;
945@@ -1680,7 +1680,7 @@ gld${EMULATION_NAME}_after_open (void)
946 These will only be created if the output format is an arm format,
947 hence we do not support linking and changing output formats at the
948 same time. Use a link followed by objcopy to change output formats. */
949- einfo (_("%F%P: error: cannot change output format "
950+ fatal (_("%P: error: cannot change output format "
951 "whilst linking %s binaries\n"), "ARM");
952 return;
953 }
954@@ -1740,7 +1740,7 @@ gld${EMULATION_NAME}_after_open (void)
955
956 if (!bfd_generic_link_read_symbols (is->the_bfd))
957 {
958- einfo (_("%F%P: %pB: could not read symbols: %E\n"),
959+ fatal (_("%P: %pB: could not read symbols: %E\n"),
960 is->the_bfd);
961 return;
962 }
963@@ -1912,7 +1912,7 @@ gld${EMULATION_NAME}_after_open (void)
964
965 if (!bfd_generic_link_read_symbols (is->the_bfd))
966 {
967- einfo (_("%F%P: %pB: could not read symbols: %E\n"),
968+ fatal (_("%P: %pB: could not read symbols: %E\n"),
969 is->the_bfd);
970 return;
971 }
972@@ -2023,7 +2023,7 @@ gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBU
973
974 h = bfd_link_hash_lookup (link_info.hash, buf, true, true, true);
975 if (h == (struct bfd_link_hash_entry *) NULL)
976- einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
977+ fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
978 if (h->type == bfd_link_hash_new)
979 {
980 h->type = bfd_link_hash_undefined;
981diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
982index bd2ee2ed..2d033dd3 100644
983--- a/ld/emultempl/pep.em
984+++ b/ld/emultempl/pep.em
985@@ -698,7 +698,7 @@ set_pep_subsystem (void)
986
987 if (v[i].name == NULL)
988 {
989- einfo (_("%F%P: invalid subsystem type %s\n"), optarg);
990+ fatal (_("%P: invalid subsystem type %s\n"), optarg);
991 return;
992 }
993
994@@ -719,7 +719,7 @@ set_pep_value (char *name)
995 set_pep_name (name, (bfd_vma) strtoull (optarg, &end, 0));
996
997 if (end == optarg)
998- einfo (_("%F%P: invalid hex number for PE parameter '%s'\n"), optarg);
999+ fatal (_("%P: invalid hex number for PE parameter '%s'\n"), optarg);
1000
1001 optarg = end;
1002 }
1003@@ -736,7 +736,7 @@ set_pep_stack_heap (char *resname, char *comname)
1004 set_pep_value (comname);
1005 }
1006 else if (*optarg)
1007- einfo (_("%F%P: strange hex info for PE parameter '%s'\n"), optarg);
1008+ fatal (_("%P: strange hex info for PE parameter '%s'\n"), optarg);
1009 }
1010
1011 #define DEFAULT_BUILD_ID_STYLE "md5"
1012@@ -753,7 +753,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
1013 case OPTION_BASE_FILE:
1014 link_info.base_file = fopen (optarg, FOPEN_WB);
1015 if (link_info.base_file == NULL)
1016- einfo (_("%F%P: cannot open base file %s\n"), optarg);
1017+ fatal (_("%P: cannot open base file %s\n"), optarg);
1018 break;
1019
1020 /* PE options. */
1021@@ -1306,7 +1306,7 @@ make_runtime_ref (void)
1022 = bfd_wrapped_link_hash_lookup (link_info.output_bfd, &link_info,
1023 rr, true, false, true);
1024 if (!h)
1025- einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
1026+ fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
1027 else
1028 {
1029 if (h->type == bfd_link_hash_new)
1030@@ -1606,7 +1606,7 @@ gld${EMULATION_NAME}_after_open (void)
1031 if (bfd_get_flavour (link_info.output_bfd) != bfd_target_coff_flavour
1032 || coff_data (link_info.output_bfd) == NULL
1033 || !obj_pe (link_info.output_bfd))
1034- einfo (_("%F%P: cannot perform PE operations on non PE output file '%pB'\n"),
1035+ fatal (_("%P: cannot perform PE operations on non PE output file '%pB'\n"),
1036 link_info.output_bfd);
1037
1038 pe_data (link_info.output_bfd)->pe_opthdr = pep;
1039@@ -1718,7 +1718,7 @@ gld${EMULATION_NAME}_after_open (void)
1040
1041 if (!bfd_generic_link_read_symbols (is->the_bfd))
1042 {
1043- einfo (_("%F%P: %pB: could not read symbols: %E\n"),
1044+ fatal (_("%P: %pB: could not read symbols: %E\n"),
1045 is->the_bfd);
1046 return;
1047 }
1048@@ -1907,7 +1907,7 @@ gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBU
1049
1050 h = bfd_link_hash_lookup (link_info.hash, buf, true, true, true);
1051 if (h == (struct bfd_link_hash_entry *) NULL)
1052- einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
1053+ fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
1054 if (h->type == bfd_link_hash_new)
1055 {
1056 h->type = bfd_link_hash_undefined;
1057diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em
1058index 0730a05e..ffacadc6 100644
1059--- a/ld/emultempl/ppc32elf.em
1060+++ b/ld/emultempl/ppc32elf.em
1061@@ -386,7 +386,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1062 char *end;
1063 unsigned long val = strtoul (optarg, &end, 0);
1064 if (*end || val > 5)
1065- einfo (_("%F%P: invalid --plt-align `%s'\''\n"), optarg);
1066+ fatal (_("%P: invalid --plt-align `%s'\''\n"), optarg);
1067 params.plt_stub_align = val;
1068 }
1069 else
1070@@ -419,7 +419,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1071 if (*end
1072 || (params.pagesize < 4096 && params.pagesize != 0)
1073 || params.pagesize != (params.pagesize & -params.pagesize))
1074- einfo (_("%F%P: invalid pagesize `%s'\''\n"), optarg);
1075+ fatal (_("%P: invalid pagesize `%s'\''\n"), optarg);
1076 }
1077 break;
1078
1079diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
1080index 533caed2..92bf4f58 100644
1081--- a/ld/emultempl/ppc64elf.em
1082+++ b/ld/emultempl/ppc64elf.em
1083@@ -91,7 +91,7 @@ ppc_create_output_section_statements (void)
1084 bfd_get_arch (link_info.output_bfd),
1085 bfd_get_mach (link_info.output_bfd)))
1086 {
1087- einfo (_("%F%P: can not create BFD: %E\n"));
1088+ fatal (_("%P: can not create BFD: %E\n"));
1089 return;
1090 }
1091
1092@@ -101,7 +101,7 @@ ppc_create_output_section_statements (void)
1093 if (params.save_restore_funcs < 0)
1094 params.save_restore_funcs = !bfd_link_relocatable (&link_info);
1095 if (!ppc64_elf_init_stub_bfd (&link_info, &params))
1096- einfo (_("%F%P: can not init BFD: %E\n"));
1097+ fatal (_("%P: can not init BFD: %E\n"));
1098 }
1099
1100 /* Called after opening files but before mapping sections. */
1101@@ -860,7 +860,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1102 const char *end;
1103 params.group_size = bfd_scan_vma (optarg, &end, 0);
1104 if (*end)
1105- einfo (_("%F%P: invalid number `%s'\''\n"), optarg);
1106+ fatal (_("%P: invalid number `%s'\''\n"), optarg);
1107 }
1108 break;
1109
1110@@ -886,7 +886,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1111 char *end;
1112 long val = strtol (optarg, &end, 0);
1113 if (*end || (unsigned long) val + 8 > 16)
1114- einfo (_("%F%P: invalid --plt-align `%s'\''\n"), optarg);
1115+ fatal (_("%P: invalid --plt-align `%s'\''\n"), optarg);
1116 params.plt_stub_align = val;
1117 }
1118 else
1119@@ -915,7 +915,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1120 else if (strcasecmp (optarg, "no") == 0)
1121 params.power10_stubs = 0;
1122 else
1123- einfo (_("%F%P: invalid --power10-stubs argument `%s'\''\n"),
1124+ fatal (_("%P: invalid --power10-stubs argument `%s'\''\n"),
1125 optarg);
1126 }
1127 else
1128diff --git a/ld/emultempl/riscvelf.em b/ld/emultempl/riscvelf.em
1129index fe53b2a7..006e4edb 100644
1130--- a/ld/emultempl/riscvelf.em
1131+++ b/ld/emultempl/riscvelf.em
1132@@ -141,7 +141,7 @@ riscv_create_output_section_statements (void)
1133 These will only be created if the output format is a RISC-V format,
1134 hence we do not support linking and changing output formats at the
1135 same time. Use a link followed by objcopy to change output formats. */
1136- einfo (_("%F%P: error: cannot change output format"
1137+ fatal (_("%P: error: cannot change output format"
1138 " whilst linking %s binaries\n"), "RISC-V");
1139 return;
1140 }
1141diff --git a/ld/emultempl/s390.em b/ld/emultempl/s390.em
1142index 11e7f19b..0a93d76b 100644
1143--- a/ld/emultempl/s390.em
1144+++ b/ld/emultempl/s390.em
1145@@ -34,7 +34,7 @@ static void
1146 s390_elf_create_output_section_statements (void)
1147 {
1148 if (!bfd_elf_s390_set_options (&link_info, &params))
1149- einfo (_("%F%P: can not init BFD: %E\n"));
1150+ fatal (_("%P: can not init BFD: %E\n"));
1151 }
1152
1153 EOF
1154diff --git a/ld/emultempl/scoreelf.em b/ld/emultempl/scoreelf.em
1155index 6238b5e2..6413f330 100644
1156--- a/ld/emultempl/scoreelf.em
1157+++ b/ld/emultempl/scoreelf.em
1158@@ -62,7 +62,7 @@ score_elf_after_open (void)
1159 These will only be created if the output format is an score format,
1160 hence we do not support linking and changing output formats at the
1161 same time. Use a link followed by objcopy to change output formats. */
1162- einfo (_("%F%P: error: cannot change output format "
1163+ fatal (_("%P: error: cannot change output format "
1164 "whilst linking %s binaries\n"), "S+core");
1165 return;
1166 }
1167diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
1168index cc39435c..c694b828 100644
1169--- a/ld/emultempl/spuelf.em
1170+++ b/ld/emultempl/spuelf.em
1171@@ -202,7 +202,7 @@ spu_elf_load_ovl_mgr (void)
1172 /* User supplied __ovly_load. */
1173 }
1174 else if (mgr_stream->start == mgr_stream->end)
1175- einfo (_("%F%P: no built-in overlay manager\n"));
1176+ fatal (_("%P: no built-in overlay manager\n"));
1177 else
1178 {
1179 lang_input_statement_type *ovl_is;
1180@@ -379,7 +379,7 @@ spu_elf_open_overlay_script (void)
1181 if (script == NULL)
1182 {
1183 file_err:
1184- einfo (_("%F%P: can not open script: %E\n"));
1185+ fatal (_("%P: can not open script: %E\n"));
1186 }
1187 return script;
1188 }
1189@@ -719,7 +719,7 @@ PARSE_AND_LIST_ARGS_CASES='
1190 if (*end == 0)
1191 break;
1192 }
1193- einfo (_("%F%P: invalid --local-store address range `%s'\''\n"), optarg);
1194+ fatal (_("%P: invalid --local-store address range `%s'\''\n"), optarg);
1195 }
1196 break;
1197
1198@@ -755,12 +755,12 @@ PARSE_AND_LIST_ARGS_CASES='
1199 if (!num_lines_set)
1200 params.num_lines = 32;
1201 else if ((params.num_lines & -params.num_lines) != params.num_lines)
1202- einfo (_("%F%P: invalid --num-lines/--num-regions `%u'\''\n"),
1203+ fatal (_("%P: invalid --num-lines/--num-regions `%u'\''\n"),
1204 params.num_lines);
1205 if (!line_size_set)
1206 params.line_size = 1024;
1207 else if ((params.line_size & -params.line_size) != params.line_size)
1208- einfo (_("%F%P: invalid --line-size/--region-size `%u'\''\n"),
1209+ fatal (_("%P: invalid --line-size/--region-size `%u'\''\n"),
1210 params.line_size);
1211 break;
1212
1213@@ -781,7 +781,7 @@ PARSE_AND_LIST_ARGS_CASES='
1214 && (params.ovly_flavour != ovly_soft_icache
1215 || (params.num_lines & -params.num_lines) == params.num_lines))
1216 break;
1217- einfo (_("%F%P: invalid --num-lines/--num-regions `%s'\''\n"), optarg);
1218+ fatal (_("%P: invalid --num-lines/--num-regions `%s'\''\n"), optarg);
1219 }
1220 break;
1221
1222@@ -794,7 +794,7 @@ PARSE_AND_LIST_ARGS_CASES='
1223 && (params.ovly_flavour != ovly_soft_icache
1224 || (params.line_size & -params.line_size) == params.line_size))
1225 break;
1226- einfo (_("%F%P: invalid --line-size/--region-size `%s'\''\n"), optarg);
1227+ fatal (_("%P: invalid --line-size/--region-size `%s'\''\n"), optarg);
1228 }
1229 break;
1230
1231@@ -803,7 +803,7 @@ PARSE_AND_LIST_ARGS_CASES='
1232 char *end;
1233 params.auto_overlay_fixed = strtoul (optarg, &end, 0);
1234 if (*end != 0)
1235- einfo (_("%F%P: invalid --fixed-space value `%s'\''\n"), optarg);
1236+ fatal (_("%P: invalid --fixed-space value `%s'\''\n"), optarg);
1237 }
1238 break;
1239
1240@@ -812,7 +812,7 @@ PARSE_AND_LIST_ARGS_CASES='
1241 char *end;
1242 params.auto_overlay_reserved = strtoul (optarg, &end, 0);
1243 if (*end != 0)
1244- einfo (_("%F%P: invalid --reserved-space value `%s'\''\n"), optarg);
1245+ fatal (_("%P: invalid --reserved-space value `%s'\''\n"), optarg);
1246 }
1247 break;
1248
1249@@ -821,7 +821,7 @@ PARSE_AND_LIST_ARGS_CASES='
1250 char *end;
1251 params.extra_stack_space = strtol (optarg, &end, 0);
1252 if (*end != 0)
1253- einfo (_("%F%P: invalid --extra-stack-space value `%s'\''\n"), optarg);
1254+ fatal (_("%P: invalid --extra-stack-space value `%s'\''\n"), optarg);
1255 }
1256 break;
1257
1258diff --git a/ld/emultempl/tic6xdsbt.em b/ld/emultempl/tic6xdsbt.em
1259index 524e3f73..a830be7e 100644
1260--- a/ld/emultempl/tic6xdsbt.em
1261+++ b/ld/emultempl/tic6xdsbt.em
1262@@ -59,10 +59,8 @@ tic6x_after_open (void)
1263 if (is_tic6x_target ())
1264 {
1265 if (params.dsbt_index >= params.dsbt_size)
1266- {
1267- einfo (_("%F%P: invalid --dsbt-index %d, outside DSBT size\n"),
1268- params.dsbt_index);
1269- }
1270+ fatal (_("%P: invalid --dsbt-index %d, outside DSBT size\n"),
1271+ params.dsbt_index);
1272 elf32_tic6x_setup (&link_info, &params);
1273 }
1274
1275@@ -192,7 +190,7 @@ PARSE_AND_LIST_ARGS_CASES='
1276 if (*end == 0
1277 && params.dsbt_index >= 0 && params.dsbt_index < 0x7fff)
1278 break;
1279- einfo (_("%F%P: invalid --dsbt-index %s\n"), optarg);
1280+ fatal (_("%P: invalid --dsbt-index %s\n"), optarg);
1281 }
1282 break;
1283 case OPTION_DSBT_SIZE:
1284@@ -202,7 +200,7 @@ PARSE_AND_LIST_ARGS_CASES='
1285 if (*end == 0
1286 && params.dsbt_size >= 0 && params.dsbt_size < 0x7fff)
1287 break;
1288- einfo (_("%F%P: invalid --dsbt-size %s\n"), optarg);
1289+ fatal (_("%P: invalid --dsbt-size %s\n"), optarg);
1290 }
1291 break;
1292 case OPTION_NO_MERGE_EXIDX_ENTRIES:
1293diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em
1294index 4b048bef..bbf30f4a 100644
1295--- a/ld/emultempl/ticoff.em
1296+++ b/ld/emultempl/ticoff.em
1297@@ -88,9 +88,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
1298 lang_add_output_format (buf, NULL, NULL, 0);
1299 }
1300 else
1301- {
1302- einfo (_("%F%P: invalid COFF format version %s\n"), optarg);
1303- }
1304+ fatal (_("%P: invalid COFF format version %s\n"), optarg);
1305 break;
1306 }
1307 return false;
1308diff --git a/ld/emultempl/v850elf.em b/ld/emultempl/v850elf.em
1309index 7bcd45f3..49ad2cc8 100644
1310--- a/ld/emultempl/v850elf.em
1311+++ b/ld/emultempl/v850elf.em
1312@@ -63,7 +63,7 @@ v850_create_output_section_statements (void)
1313 These will only be created if the output format is an arm format,
1314 hence we do not support linking and changing output formats at the
1315 same time. Use a link followed by objcopy to change output formats. */
1316- einfo (_("%F%P: error: cannot change output format"
1317+ fatal (_("%P: error: cannot change output format"
1318 " whilst linking %s binaries\n"), "V850");
1319 return;
1320 }
1321diff --git a/ld/emultempl/vms.em b/ld/emultempl/vms.em
1322index 67e9ea64..4ca2c942 100644
1323--- a/ld/emultempl/vms.em
1324+++ b/ld/emultempl/vms.em
1325@@ -201,7 +201,7 @@ gld${EMULATION_NAME}_before_allocation (void)
1326 && bed->elf_backend_size_dynamic_sections
1327 && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd,
1328 &link_info))
1329- einfo (_("%F%P: failed to set dynamic section sizes: %E\n"));
1330+ fatal (_("%P: failed to set dynamic section sizes: %E\n"));
1331
1332 before_allocation_default ();
1333 }
1334diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
1335index 51293539..208f730d 100644
1336--- a/ld/emultempl/xtensaelf.em
1337+++ b/ld/emultempl/xtensaelf.em
1338@@ -388,7 +388,7 @@ check_xtensa_info (bfd *abfd, asection *info_sec)
1339
1340 data = xmalloc (info_sec->size);
1341 if (! bfd_get_section_contents (abfd, info_sec, data, 0, info_sec->size))
1342- einfo (_("%F%P: %pB: cannot read contents of section %pA\n"), abfd, info_sec);
1343+ fatal (_("%P: %pB: cannot read contents of section %pA\n"), abfd, info_sec);
1344
1345 if (info_sec->size > 24
1346 && info_sec->size >= 24 + bfd_get_32 (abfd, data + 4)
1347@@ -429,13 +429,13 @@ elf_xtensa_before_allocation (void)
1348 if (is_big_endian
1349 && link_info.output_bfd->xvec->byteorder == BFD_ENDIAN_LITTLE)
1350 {
1351- einfo (_("%F%P: little endian output does not match "
1352+ fatal (_("%P: little endian output does not match "
1353 "Xtensa configuration\n"));
1354 }
1355 if (!is_big_endian
1356 && link_info.output_bfd->xvec->byteorder == BFD_ENDIAN_BIG)
1357 {
1358- einfo (_("%F%P: big endian output does not match "
1359+ fatal (_("%P: big endian output does not match "
1360 "Xtensa configuration\n"));
1361 }
1362
1363@@ -454,7 +454,7 @@ elf_xtensa_before_allocation (void)
1364 cannot go any further if there are any mismatches. */
1365 if ((is_big_endian && f->the_bfd->xvec->byteorder == BFD_ENDIAN_LITTLE)
1366 || (!is_big_endian && f->the_bfd->xvec->byteorder == BFD_ENDIAN_BIG))
1367- einfo (_("%F%P: cross-endian linking for %pB not supported\n"),
1368+ fatal (_("%P: cross-endian linking for %pB not supported\n"),
1369 f->the_bfd);
1370
1371 if (! first_bfd)
1372@@ -485,7 +485,7 @@ elf_xtensa_before_allocation (void)
1373 info_sec = bfd_make_section_with_flags (first_bfd, ".xtensa.info",
1374 SEC_HAS_CONTENTS | SEC_READONLY);
1375 if (! info_sec)
1376- einfo (_("%F%P: failed to create .xtensa.info section\n"));
1377+ fatal (_("%P: failed to create .xtensa.info section\n"));
1378 }
1379 if (info_sec)
1380 {
1381@@ -1224,7 +1224,7 @@ ld_build_required_section_dependence (lang_statement_union_type *s)
1382 lang_statement_union_type *l = iter_stack_current (&stack);
1383
1384 if (l == NULL && link_info.non_contiguous_regions)
1385- einfo (_("%F%P: Relaxation not supported with "
1386+ fatal (_("%P: Relaxation not supported with "
1387 "--enable-non-contiguous-regions.\n"));
1388
1389 if (l->header.type == lang_input_section_enum)
1390diff --git a/ld/emultempl/z80.em b/ld/emultempl/z80.em
1391index ded04136..555f6024 100644
1392--- a/ld/emultempl/z80.em
1393+++ b/ld/emultempl/z80.em
1394@@ -48,7 +48,7 @@ z80_after_open (void)
1395 const bfd_arch_info_type *info;
1396 info = bfd_arch_get_compatible (link_info.output_bfd, abfd, false);
1397 if (info == NULL)
1398- einfo (_("%F%P: %pB: Instruction sets of object files incompatible\n"),
1399+ fatal (_("%P: %pB: Instruction sets of object files incompatible\n"),
1400 abfd);
1401 else
1402 bfd_set_arch_info (link_info.output_bfd, info);
1403diff --git a/ld/ldcref.c b/ld/ldcref.c
1404index 632506a4..572d4f4d 100644
1405--- a/ld/ldcref.c
1406+++ b/ld/ldcref.c
1407@@ -514,7 +514,7 @@ check_local_sym_xref (lang_input_statement_type *statement)
1408 return;
1409
1410 if (!bfd_generic_link_read_symbols (abfd))
1411- einfo (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
1412+ fatal (_("%P: %pB: could not read symbols: %E\n"), abfd);
1413
1414 for (syms = bfd_get_outsymbols (abfd); *syms; ++syms)
1415 {
1416@@ -625,7 +625,7 @@ check_refs (const char *name,
1417 BFD might contain a prohibited cross reference. */
1418
1419 if (!bfd_generic_link_read_symbols (abfd))
1420- einfo (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
1421+ fatal (_("%P: %pB: could not read symbols: %E\n"), abfd);
1422
1423 info.sym_name = name;
1424 info.global = global;
1425@@ -687,14 +687,14 @@ check_reloc_refs (bfd *abfd, asection *sec, void *iarg)
1426
1427 relsize = bfd_get_reloc_upper_bound (abfd, sec);
1428 if (relsize < 0)
1429- einfo (_("%F%P: %pB: could not read relocs: %E\n"), abfd);
1430+ fatal (_("%P: %pB: could not read relocs: %E\n"), abfd);
1431 if (relsize == 0)
1432 return;
1433
1434 relpp = (arelent **) xmalloc (relsize);
1435 relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols);
1436 if (relcount < 0)
1437- einfo (_("%F%P: %pB: could not read relocs: %E\n"), abfd);
1438+ fatal (_("%P: %pB: could not read relocs: %E\n"), abfd);
1439
1440 p = relpp;
1441 pend = p + relcount;
1442diff --git a/ld/ldelf.c b/ld/ldelf.c
1443index d66e08dd..fb95b7a9 100644
1444--- a/ld/ldelf.c
1445+++ b/ld/ldelf.c
1446@@ -94,7 +94,7 @@ ldelf_after_parse (void)
1447 else if (!link_info.maxpagesize_is_set)
1448 link_info.maxpagesize = link_info.commonpagesize;
1449 else
1450- einfo (_("%F%P: common page size (0x%v) > maximum page size (0x%v)\n"),
1451+ fatal (_("%P: common page size (0x%v) > maximum page size (0x%v)\n"),
1452 link_info.commonpagesize, link_info.maxpagesize);
1453 }
1454 }
1455@@ -120,7 +120,7 @@ ldelf_load_symbols (lang_input_statement_type *entry)
1456
1457 if (entry->flags.just_syms
1458 && (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) != 0)
1459- einfo (_("%F%P: %pB: --just-symbols may not be used on DSO\n"),
1460+ fatal (_("%P: %pB: --just-symbols may not be used on DSO\n"),
1461 entry->the_bfd);
1462
1463 if (link_class == 0
1464@@ -320,7 +320,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux)
1465 struct bfd_link_needed_list *needs;
1466
1467 if (! bfd_elf_get_bfd_needed_list (abfd, &needs))
1468- einfo (_("%F%P: %pB: bfd_elf_get_bfd_needed_list failed: %E\n"), abfd);
1469+ fatal (_("%P: %pB: bfd_elf_get_bfd_needed_list failed: %E\n"), abfd);
1470
1471 if (needs != NULL)
1472 {
1473@@ -368,7 +368,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux)
1474 can only check that using stat. */
1475
1476 if (bfd_stat (abfd, &global_stat) != 0)
1477- einfo (_("%F%P: %pB: bfd_stat failed: %E\n"), abfd);
1478+ fatal (_("%P: %pB: bfd_stat failed: %E\n"), abfd);
1479
1480 /* First strip off everything before the last '/'. */
1481 soname = lbasename (bfd_get_filename (abfd));
1482@@ -407,7 +407,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux)
1483
1484 /* Add this file into the symbol table. */
1485 if (! bfd_link_add_symbols (abfd, &link_info))
1486- einfo (_("%F%P: %pB: error adding symbols: %E\n"), abfd);
1487+ fatal (_("%P: %pB: error adding symbols: %E\n"), abfd);
1488
1489 return true;
1490 }
1491@@ -1205,7 +1205,7 @@ ldelf_handle_dt_needed (struct elf_link_hash_table *htab,
1492 && elf_dt_name (abfd) != NULL)
1493 {
1494 if (bfd_elf_add_dt_needed_tag (abfd, &link_info) < 0)
1495- einfo (_("%F%P: failed to add DT_NEEDED dynamic tag\n"));
1496+ fatal (_("%P: failed to add DT_NEEDED dynamic tag\n"));
1497 }
1498
1499 link_info.input_bfds_tail = save_input_bfd_tail;
1500@@ -1256,10 +1256,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
1501 bfd_get_target (link_info.output_bfd));
1502
1503 if (link_info.out_implib_bfd == NULL)
1504- {
1505- einfo (_("%F%P: %s: can't open for writing: %E\n"),
1506- command_line.out_implib_filename);
1507- }
1508+ fatal (_("%P: %s: can't open for writing: %E\n"),
1509+ command_line.out_implib_filename);
1510 }
1511
1512 if (ldelf_emit_note_gnu_build_id != NULL
1513@@ -1313,7 +1311,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
1514 && (elf_tdata (abfd)->elf_header->e_type == ET_EXEC
1515 || (elf_tdata (abfd)->elf_header->e_type == ET_DYN
1516 && elf_tdata (abfd)->is_pie)))
1517- einfo (_("%F%P: cannot use executable file '%pB' as input to a link\n"),
1518+ fatal (_("%P: cannot use executable file '%pB' as input to a link\n"),
1519 abfd);
1520 }
1521
1522@@ -1367,7 +1365,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
1523 }
1524 else if (seen_type != type)
1525 {
1526- einfo (_("%F%P: compact frame descriptions incompatible with"
1527+ fatal (_("%P: compact frame descriptions incompatible with"
1528 " DWARF2 .eh_frame from %pB\n"),
1529 type == DWARF2_EH_HDR ? abfd : elfbfd);
1530 break;
1531@@ -1409,7 +1407,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
1532
1533 if (link_info.eh_frame_hdr_type == COMPACT_EH_HDR)
1534 if (!bfd_elf_parse_eh_frame_entries (NULL, &link_info))
1535- einfo (_("%F%P: failed to parse EH frame entries\n"));
1536+ fatal (_("%P: failed to parse EH frame entries\n"));
1537
1538 ldelf_handle_dt_needed (htab, use_libpath, native, is_linux,
1539 is_freebsd, elfsize, prefix);
1540@@ -1666,7 +1664,7 @@ ldelf_find_exp_assignment (etree_type *exp)
1541 &link_info,
1542 exp->assign.dst, provide,
1543 exp->assign.hidden))
1544- einfo (_("%F%P: failed to record assignment to %s: %E\n"),
1545+ fatal (_("%P: failed to record assignment to %s: %E\n"),
1546 exp->assign.dst);
1547 }
1548 ldelf_find_exp_assignment (exp->assign.src);
1549@@ -1846,7 +1844,7 @@ ldelf_before_allocation (char *audit, char *depaudit,
1550 command_line.filter_shlib, audit, depaudit,
1551 (const char * const *) command_line.auxiliary_filters,
1552 &link_info, &sinterp)))
1553- einfo (_("%F%P: failed to set dynamic section sizes: %E\n"));
1554+ fatal (_("%P: failed to set dynamic section sizes: %E\n"));
1555
1556 if (sinterp != NULL)
1557 {
1558@@ -1883,8 +1881,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
1559 msg = (char *) xmalloc ((size_t) (sz + 1));
1560 if (! bfd_get_section_contents (is->the_bfd, s, msg,
1561 (file_ptr) 0, sz))
1562- einfo (_("%F%P: %pB: can't read contents of section .gnu.warning: %E\n"),
1563- is->the_bfd);
1564+ fatal (_("%P: %pB: can't read contents of section %pA: %E\n"),
1565+ is->the_bfd, s);
1566 msg[sz] = '\0';
1567 (*link_info.callbacks->warning) (&link_info, msg,
1568 (const char *) NULL, is->the_bfd,
1569@@ -1911,7 +1909,7 @@ ldelf_before_allocation (char *audit, char *depaudit,
1570 before_allocation_default ();
1571
1572 if (!bfd_elf_size_dynsym_hash_dynstr (link_info.output_bfd, &link_info))
1573- einfo (_("%F%P: failed to set dynamic section sizes: %E\n"));
1574+ fatal (_("%P: failed to set dynamic section sizes: %E\n"));
1575
1576 if (ehdr_start != NULL)
1577 {
1578diff --git a/ld/ldelfgen.c b/ld/ldelfgen.c
1579index d3448546..1b1e49ce 100644
1580--- a/ld/ldelfgen.c
1581+++ b/ld/ldelfgen.c
1582@@ -282,7 +282,7 @@ ldelf_map_segments (bool need_layout)
1583 if (os_info->ordered != os_info->count
1584 && bfd_link_relocatable (&link_info))
1585 {
1586- einfo (_("%F%P: "
1587+ fatal (_("%P: "
1588 "%pA has both ordered and unordered sections\n"),
1589 os->bfd_section);
1590 return;
1591@@ -307,7 +307,7 @@ ldelf_map_segments (bool need_layout)
1592 if (!_bfd_elf_map_sections_to_segments (link_info.output_bfd,
1593 &link_info,
1594 &need_layout))
1595- einfo (_("%F%P: map sections to segments failed: %E\n"));
1596+ fatal (_("%P: map sections to segments failed: %E\n"));
1597
1598 if (phdr_size != elf_program_header_size (link_info.output_bfd))
1599 {
1600@@ -327,7 +327,7 @@ ldelf_map_segments (bool need_layout)
1601 while (need_layout && --tries);
1602
1603 if (tries == 0)
1604- einfo (_("%F%P: looping in map_segments\n"));
1605+ fatal (_("%P: looping in map_segments\n"));
1606
1607 if (bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
1608 && lang_phdr_list == NULL)
1609@@ -337,9 +337,8 @@ ldelf_map_segments (bool need_layout)
1610 const struct elf_backend_data *bed
1611 = get_elf_backend_data (link_info.output_bfd);
1612 if (bed->elf_backend_strip_zero_sized_dynamic_sections
1613- && !bed->elf_backend_strip_zero_sized_dynamic_sections
1614- (&link_info))
1615- einfo (_("%F%P: failed to strip zero-sized dynamic sections\n"));
1616+ && !bed->elf_backend_strip_zero_sized_dynamic_sections (&link_info))
1617+ fatal (_("%P: failed to strip zero-sized dynamic sections\n"));
1618 }
1619 }
1620
1621@@ -417,7 +416,7 @@ ldelf_acquire_strings_for_ctf
1622 {
1623 if (ctf_link_add_strtab (ctf_output, ldelf_ctf_strtab_iter_cb,
1624 &args) < 0)
1625- einfo (_("%F%P: warning: CTF strtab association failed; strings will "
1626+ fatal (_("%P: warning: CTF strtab association failed; strings will "
1627 "not be shared: %s\n"),
1628 ctf_errmsg (ctf_errno (ctf_output)));
1629 }
1630@@ -444,7 +443,7 @@ ldelf_new_dynsym_for_ctf (struct ctf_dict *ctf_output, int symidx,
1631 lsym.st_value = sym->st_value;
1632 if (ctf_link_add_linker_symbol (ctf_output, &lsym) < 0)
1633 {
1634- einfo (_("%F%P: warning: CTF symbol addition failed; CTF will "
1635+ fatal (_("%P: warning: CTF symbol addition failed; CTF will "
1636 "not be tied to symbols: %s\n"),
1637 ctf_errmsg (ctf_errno (ctf_output)));
1638 }
1639@@ -454,7 +453,7 @@ ldelf_new_dynsym_for_ctf (struct ctf_dict *ctf_output, int symidx,
1640 /* Shuffle all the symbols. */
1641
1642 if (ctf_link_shuffle_syms (ctf_output) < 0)
1643- einfo (_("%F%P: warning: CTF symbol shuffling failed; CTF will "
1644+ fatal (_("%P: warning: CTF symbol shuffling failed; CTF will "
1645 "not be tied to symbols: %s\n"),
1646 ctf_errmsg (ctf_errno (ctf_output)));
1647 }
1648diff --git a/ld/ldemul.c b/ld/ldemul.c
1649index 218abb84..b56b0492 100644
1650--- a/ld/ldemul.c
1651+++ b/ld/ldemul.c
1652@@ -343,7 +343,7 @@ ldemul_choose_mode (char *target)
1653 einfo (_("%P: unrecognised emulation mode: %s\n"), target);
1654 einfo (_("Supported emulations: "));
1655 ldemul_list_emulations (stderr);
1656- einfo ("%F\n");
1657+ fatal ("\n");
1658 }
1659
1660 void
1661diff --git a/ld/ldexp.c b/ld/ldexp.c
1662index 3c8ab2d3..45dffbc6 100644
1663--- a/ld/ldexp.c
1664+++ b/ld/ldexp.c
1665@@ -282,7 +282,7 @@ definedness_newfunc (struct bfd_hash_entry *entry,
1666 bfd_hash_allocate (table, sizeof (struct definedness_hash_entry));
1667
1668 if (ret == NULL)
1669- einfo (_("%F%P: bfd_hash_allocate failed creating symbol %s\n"), name);
1670+ fatal (_("%P: bfd_hash_allocate failed creating symbol %s\n"), name);
1671
1672 ret->by_object = 0;
1673 ret->iteration = 0;
1674@@ -313,7 +313,7 @@ update_definedness (const char *name, struct bfd_link_hash_entry *h)
1675 bfd_hash_lookup (&definedness_table, name, true, false);
1676
1677 if (defentry == NULL)
1678- einfo (_("%F%P: bfd_hash_lookup failed creating symbol %s\n"), name);
1679+ fatal (_("%P: bfd_hash_lookup failed creating symbol %s\n"), name);
1680
1681 /* If the symbol was already defined, and not by a script, then it
1682 must be defined by an object file or by the linker target code. */
1683@@ -638,7 +638,7 @@ fold_binary (etree_type *tree)
1684 expld.result.value = ((bfd_signed_vma) lhs.value
1685 % (bfd_signed_vma) expld.result.value);
1686 else if (expld.phase != lang_mark_phase_enum)
1687- einfo (_("%F%P:%pS %% by zero\n"), tree->binary.rhs);
1688+ fatal (_("%P:%pS %% by zero\n"), tree->binary.rhs);
1689 arith_result_section (&lhs);
1690 break;
1691
1692@@ -647,7 +647,7 @@ fold_binary (etree_type *tree)
1693 expld.result.value = ((bfd_signed_vma) lhs.value
1694 / (bfd_signed_vma) expld.result.value);
1695 else if (expld.phase != lang_mark_phase_enum)
1696- einfo (_("%F%P:%pS / by zero\n"), tree->binary.rhs);
1697+ fatal (_("%P:%pS / by zero\n"), tree->binary.rhs);
1698 arith_result_section (&lhs);
1699 break;
1700
1701@@ -761,7 +761,7 @@ fold_name (etree_type *tree)
1702 if (!h)
1703 {
1704 if (expld.phase != lang_first_phase_enum)
1705- einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
1706+ fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
1707 }
1708 else if (h->type == bfd_link_hash_defined
1709 || h->type == bfd_link_hash_defweak)
1710@@ -789,7 +789,7 @@ fold_name (etree_type *tree)
1711 else if (expld.phase == lang_final_phase_enum
1712 || (expld.phase != lang_mark_phase_enum
1713 && expld.assigning_to_dot))
1714- einfo (_("%F%P:%pS: undefined symbol `%s'"
1715+ fatal (_("%P:%pS: undefined symbol `%s'"
1716 " referenced in expression\n"),
1717 tree, tree->name.name);
1718 else if (h->type == bfd_link_hash_new)
1719@@ -827,7 +827,7 @@ fold_name (etree_type *tree)
1720 if (os == NULL)
1721 {
1722 if (expld.phase == lang_final_phase_enum)
1723- einfo (_("%F%P:%pS: undefined section `%s'"
1724+ fatal (_("%P:%pS: undefined section `%s'"
1725 " referenced in expression\n"),
1726 tree, tree->name.name);
1727 }
1728@@ -845,7 +845,7 @@ fold_name (etree_type *tree)
1729 if (os == NULL)
1730 {
1731 if (expld.phase == lang_final_phase_enum)
1732- einfo (_("%F%P:%pS: undefined section `%s'"
1733+ fatal (_("%P:%pS: undefined section `%s'"
1734 " referenced in expression\n"),
1735 tree, tree->name.name);
1736 }
1737@@ -873,7 +873,7 @@ fold_name (etree_type *tree)
1738 if (os == NULL)
1739 {
1740 if (expld.phase == lang_final_phase_enum)
1741- einfo (_("%F%P:%pS: undefined section `%s'"
1742+ fatal (_("%P:%pS: undefined section `%s'"
1743 " referenced in expression\n"),
1744 tree, tree->name.name);
1745 new_number (0);
1746@@ -912,7 +912,7 @@ fold_name (etree_type *tree)
1747 if (mem != NULL)
1748 new_number (mem->length);
1749 else
1750- einfo (_("%F%P:%pS: undefined MEMORY region `%s'"
1751+ fatal (_("%P:%pS: undefined MEMORY region `%s'"
1752 " referenced in expression\n"),
1753 tree, tree->name.name);
1754 }
1755@@ -926,7 +926,7 @@ fold_name (etree_type *tree)
1756 if (mem != NULL)
1757 new_rel_from_abs (mem->origin);
1758 else
1759- einfo (_("%F%P:%pS: undefined MEMORY region `%s'"
1760+ fatal (_("%P:%pS: undefined MEMORY region `%s'"
1761 " referenced in expression\n"),
1762 tree, tree->name.name);
1763 }
1764@@ -938,7 +938,7 @@ fold_name (etree_type *tree)
1765 else if (strcmp (tree->name.name, "COMMONPAGESIZE") == 0)
1766 new_number (link_info.commonpagesize);
1767 else
1768- einfo (_("%F%P:%pS: unknown constant `%s' referenced in expression\n"),
1769+ fatal (_("%P:%pS: unknown constant `%s' referenced in expression\n"),
1770 tree, tree->name.name);
1771 break;
1772
1773@@ -1086,7 +1086,7 @@ exp_fold_tree_1 (etree_type *tree)
1774 if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0)
1775 {
1776 if (tree->type.node_class != etree_assign)
1777- einfo (_("%F%P:%pS can not PROVIDE assignment to"
1778+ fatal (_("%P:%pS can not PROVIDE assignment to"
1779 " location counter\n"), tree);
1780 if (expld.phase != lang_first_phase_enum)
1781 {
1782@@ -1119,11 +1119,11 @@ exp_fold_tree_1 (etree_type *tree)
1783 || expld.section == bfd_und_section_ptr)
1784 {
1785 if (expld.phase != lang_mark_phase_enum)
1786- einfo (_("%F%P:%pS invalid assignment to"
1787+ fatal (_("%P:%pS invalid assignment to"
1788 " location counter\n"), tree);
1789 }
1790 else if (expld.dotp == NULL)
1791- einfo (_("%F%P:%pS assignment to location counter"
1792+ fatal (_("%P:%pS assignment to location counter"
1793 " invalid outside of SECTIONS\n"), tree);
1794
1795 /* After allocation, assignment to dot should not be
1796@@ -1142,7 +1142,7 @@ exp_fold_tree_1 (etree_type *tree)
1797 nextdot += expld.section->vma;
1798 if (nextdot < expld.dot
1799 && expld.section != bfd_abs_section_ptr)
1800- einfo (_("%F%P:%pS cannot move location counter backwards"
1801+ fatal (_("%P:%pS cannot move location counter backwards"
1802 " (from %V to %V)\n"),
1803 tree, expld.dot, nextdot);
1804 else
1805@@ -1202,7 +1202,7 @@ exp_fold_tree_1 (etree_type *tree)
1806 h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst,
1807 true, false, true);
1808 if (h == NULL)
1809- einfo (_("%F%P:%s: hash creation failed\n"),
1810+ fatal (_("%P:%s: hash creation failed\n"),
1811 tree->assign.dst);
1812 }
1813
1814@@ -1578,7 +1578,7 @@ exp_get_vma (etree_type *tree, lang_output_section_statement_type *os,
1815 if (expld.result.valid_p)
1816 return expld.result.value;
1817 else if (name != NULL && expld.phase != lang_mark_phase_enum)
1818- einfo (_("%F%P:%pS: nonconstant expression for %s\n"),
1819+ fatal (_("%P:%pS: nonconstant expression for %s\n"),
1820 tree, name);
1821 }
1822 return def;
1823@@ -1621,7 +1621,7 @@ exp_get_fill (etree_type *tree, fill_type *def, char *name)
1824 if (!expld.result.valid_p)
1825 {
1826 if (name != NULL && expld.phase != lang_mark_phase_enum)
1827- einfo (_("%F%P:%pS: nonconstant expression for %s\n"),
1828+ fatal (_("%P:%pS: nonconstant expression for %s\n"),
1829 tree, name);
1830 return def;
1831 }
1832@@ -1681,7 +1681,7 @@ exp_get_abs_int (etree_type *tree, int def, char *name)
1833 }
1834 else if (name != NULL && expld.phase != lang_mark_phase_enum)
1835 {
1836- einfo (_("%F%P:%pS: nonconstant expression for %s\n"),
1837+ fatal (_("%P:%pS: nonconstant expression for %s\n"),
1838 tree, name);
1839 }
1840 }
1841@@ -1707,7 +1707,7 @@ ldexp_init (void)
1842 definedness_newfunc,
1843 sizeof (struct definedness_hash_entry),
1844 13))
1845- einfo (_("%F%P: can not create hash table: %E\n"));
1846+ fatal (_("%P: can not create hash table: %E\n"));
1847 }
1848
1849 /* Convert absolute symbols defined by a script from "dot" (also
1850diff --git a/ld/ldfile.c b/ld/ldfile.c
1851index 49d899ee..ddab0d37 100644
1852--- a/ld/ldfile.c
1853+++ b/ld/ldfile.c
1854@@ -183,7 +183,7 @@ ldfile_add_remap_file (const char * file)
1855
1856 if (*p == '\0')
1857 {
1858- einfo ("%F%P: malformed remap file entry: %s\n", line);
1859+ fatal ("%P: malformed remap file entry: %s\n", line);
1860 continue;
1861 }
1862
1863@@ -195,7 +195,7 @@ ldfile_add_remap_file (const char * file)
1864
1865 if (*p == '\0')
1866 {
1867- einfo ("%F%P: malformed remap file entry: %s\n", line);
1868+ fatal ("%P: malformed remap file entry: %s\n", line);
1869 continue;
1870 }
1871
1872@@ -365,7 +365,7 @@ ldfile_try_open_bfd (const char *attempt,
1873 if (entry->the_bfd == NULL)
1874 {
1875 if (bfd_get_error () == bfd_error_invalid_target)
1876- einfo (_("%F%P: invalid BFD target `%s'\n"), entry->target);
1877+ fatal (_("%P: invalid BFD target `%s'\n"), entry->target);
1878 return false;
1879 }
1880
1881@@ -508,7 +508,7 @@ ldfile_try_open_bfd (const char *attempt,
1882
1883 if (!entry->flags.dynamic && (entry->the_bfd->flags & DYNAMIC) != 0)
1884 {
1885- einfo (_("%F%P: attempted static link of dynamic object `%s'\n"),
1886+ fatal (_("%P: attempted static link of dynamic object `%s'\n"),
1887 attempt);
1888 bfd_close (entry->the_bfd);
1889 entry->the_bfd = NULL;
1890@@ -919,7 +919,7 @@ ldfile_open_command_file_1 (const char *name, enum script_open_style open_how)
1891 if ((open_how != script_nonT || script->open_how != script_nonT)
1892 && strcmp (name, script->name) == 0)
1893 {
1894- einfo (_("%F%P: error: linker script file '%s'"
1895+ fatal (_("%P: error: linker script file '%s'"
1896 " appears multiple times\n"), name);
1897 return;
1898 }
1899@@ -941,7 +941,7 @@ ldfile_open_command_file_1 (const char *name, enum script_open_style open_how)
1900 if (ldlex_input_stack == NULL)
1901 {
1902 bfd_set_error (bfd_error_system_call);
1903- einfo (_("%F%P: cannot open linker script file %s: %E\n"), name);
1904+ fatal (_("%P: cannot open linker script file %s: %E\n"), name);
1905 return;
1906 }
1907
1908@@ -1012,5 +1012,5 @@ ldfile_set_output_arch (const char *string, enum bfd_architecture defarch)
1909 else if (defarch != bfd_arch_unknown)
1910 ldfile_output_architecture = defarch;
1911 else
1912- einfo (_("%F%P: cannot represent machine `%s'\n"), string);
1913+ fatal (_("%P: cannot represent machine `%s'\n"), string);
1914 }
1915diff --git a/ld/ldgram.y b/ld/ldgram.y
1916index 0d531fdd..c2f1e298 100644
1917--- a/ld/ldgram.y
1918+++ b/ld/ldgram.y
1919@@ -209,7 +209,7 @@ mri_script_command:
1920 CHIP exp
1921 | CHIP exp ',' exp
1922 | NAME {
1923- einfo(_("%F%P: unrecognised keyword in MRI style script '%s'\n"),$1);
1924+ fatal (_("%P: unrecognised keyword in MRI style script '%s'\n"), $1);
1925 }
1926 | LIST {
1927 config.map_filename = "-";
1928@@ -1547,7 +1547,7 @@ yyerror (const char *arg)
1929 einfo (_("%P:%s: file format not recognized; treating as linker script\n"),
1930 ldlex_filename ());
1931 if (error_index > 0 && error_index < ERROR_NAME_MAX)
1932- einfo (_("%F%P:%pS: %s in %s\n"), NULL, arg, error_names[error_index - 1]);
1933+ fatal (_("%P:%pS: %s in %s\n"), NULL, arg, error_names[error_index - 1]);
1934 else
1935- einfo ("%F%P:%pS: %s\n", NULL, arg);
1936+ fatal ("%P:%pS: %s\n", NULL, arg);
1937 }
1938diff --git a/ld/ldlang.c b/ld/ldlang.c
1939index 229401c8..9bf5fcbe 100644
1940--- a/ld/ldlang.c
1941+++ b/ld/ldlang.c
1942@@ -1325,7 +1325,7 @@ output_section_statement_table_init (void)
1943 output_section_statement_newfunc,
1944 sizeof (struct out_section_hash_entry),
1945 61))
1946- einfo (_("%F%P: can not create hash table: %E\n"));
1947+ fatal (_("%P: can not create hash table: %E\n"));
1948 }
1949
1950 static void
1951@@ -1453,7 +1453,7 @@ lang_memory_region_alias (const char *alias, const char *region_name)
1952 the default memory region. */
1953 if (strcmp (region_name, DEFAULT_MEMORY_REGION) == 0
1954 || strcmp (alias, DEFAULT_MEMORY_REGION) == 0)
1955- einfo (_("%F%P:%pS: error: alias for default memory region\n"), NULL);
1956+ fatal (_("%P:%pS: error: alias for default memory region\n"), NULL);
1957
1958 /* Look for the target region and check if the alias is not already
1959 in use. */
1960@@ -1464,14 +1464,14 @@ lang_memory_region_alias (const char *alias, const char *region_name)
1961 if (region == NULL && strcmp (n->name, region_name) == 0)
1962 region = r;
1963 if (strcmp (n->name, alias) == 0)
1964- einfo (_("%F%P:%pS: error: redefinition of memory region "
1965+ fatal (_("%P:%pS: error: redefinition of memory region "
1966 "alias `%s'\n"),
1967 NULL, alias);
1968 }
1969
1970 /* Check if the target region exists. */
1971 if (region == NULL)
1972- einfo (_("%F%P:%pS: error: memory region `%s' "
1973+ fatal (_("%P:%pS: error: memory region `%s' "
1974 "for alias `%s' does not exist\n"),
1975 NULL, region_name, alias);
1976
1977@@ -1532,7 +1532,7 @@ lang_output_section_statement_lookup (const char *name,
1978 if (entry == NULL)
1979 {
1980 if (create)
1981- einfo (_("%F%P: failed creating section `%s': %E\n"), name);
1982+ fatal (_("%P: failed creating section `%s': %E\n"), name);
1983 return NULL;
1984 }
1985
1986@@ -1567,7 +1567,7 @@ lang_output_section_statement_lookup (const char *name,
1987 name));
1988 if (entry == NULL)
1989 {
1990- einfo (_("%F%P: failed creating section `%s': %E\n"), name);
1991+ fatal (_("%P: failed creating section `%s': %E\n"), name);
1992 return NULL;
1993 }
1994 entry->root = last_ent->root;
1995@@ -2426,7 +2426,7 @@ static void
1996 init_os (lang_output_section_statement_type *s, flagword flags)
1997 {
1998 if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
1999- einfo (_("%F%P: illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
2000+ fatal (_("%P: illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
2001
2002 if (!s->dup_output)
2003 s->bfd_section = bfd_get_section_by_name (link_info.output_bfd, s->name);
2004@@ -2435,7 +2435,7 @@ init_os (lang_output_section_statement_type *s, flagword flags)
2005 s->name, flags);
2006 if (s->bfd_section == NULL)
2007 {
2008- einfo (_("%F%P: output format %s cannot represent section"
2009+ fatal (_("%P: output format %s cannot represent section"
2010 " called %s: %E\n"),
2011 link_info.output_bfd->xvec->name, s->name);
2012 }
2013@@ -3023,11 +3023,11 @@ load_symbols (lang_input_statement_type *entry,
2014 for (p = matching; *p != NULL; p++)
2015 einfo (" %s", *p);
2016 free (matching);
2017- einfo ("%F\n");
2018+ fatal ("\n");
2019 }
2020 else if (err != bfd_error_file_not_recognized
2021 || place == NULL)
2022- einfo (_("%F%P: %pB: file not recognized: %E\n"), entry->the_bfd);
2023+ fatal (_("%P: %pB: file not recognized: %E\n"), entry->the_bfd);
2024
2025 bfd_close (entry->the_bfd);
2026 entry->the_bfd = NULL;
2027@@ -3100,7 +3100,7 @@ load_symbols (lang_input_statement_type *entry,
2028
2029 if (!bfd_check_format (member, bfd_object))
2030 {
2031- einfo (_("%F%P: %pB: member %pB in archive is not an object\n"),
2032+ fatal (_("%P: %pB: member %pB in archive is not an object\n"),
2033 entry->the_bfd, member);
2034 loaded = false;
2035 }
2036@@ -3115,7 +3115,7 @@ load_symbols (lang_input_statement_type *entry,
2037 substitute BFD for us. */
2038 if (!bfd_link_add_symbols (subsbfd, &link_info))
2039 {
2040- einfo (_("%F%P: %pB: error adding symbols: %E\n"), member);
2041+ fatal (_("%P: %pB: error adding symbols: %E\n"), member);
2042 loaded = false;
2043 }
2044 }
2045@@ -3129,7 +3129,7 @@ load_symbols (lang_input_statement_type *entry,
2046 if (bfd_link_add_symbols (entry->the_bfd, &link_info))
2047 entry->flags.loaded = true;
2048 else
2049- einfo (_("%F%P: %pB: error adding symbols: %E\n"), entry->the_bfd);
2050+ fatal (_("%P: %pB: error adding symbols: %E\n"), entry->the_bfd);
2051
2052 return entry->flags.loaded;
2053 }
2054@@ -3370,7 +3370,7 @@ open_output (const char *name)
2055 {
2056 char *in = lrealpath (f->local_sym_name);
2057 if (filename_cmp (in, out) == 0)
2058- einfo (_("%F%P: input file '%s' is the same as output file\n"),
2059+ fatal (_("%P: input file '%s' is the same as output file\n"),
2060 f->filename);
2061 free (in);
2062 }
2063@@ -3432,23 +3432,23 @@ open_output (const char *name)
2064 if (link_info.output_bfd == NULL)
2065 {
2066 if (bfd_get_error () == bfd_error_invalid_target)
2067- einfo (_("%F%P: target %s not found\n"), output_target);
2068+ fatal (_("%P: target %s not found\n"), output_target);
2069
2070- einfo (_("%F%P: cannot open output file %s: %E\n"), name);
2071+ fatal (_("%P: cannot open output file %s: %E\n"), name);
2072 }
2073
2074 delete_output_file_on_failure = true;
2075
2076 if (!bfd_set_format (link_info.output_bfd, bfd_object))
2077- einfo (_("%F%P: %s: can not make object file: %E\n"), name);
2078+ fatal (_("%P: %s: can not make object file: %E\n"), name);
2079 if (!bfd_set_arch_mach (link_info.output_bfd,
2080- ldfile_output_architecture,
2081- ldfile_output_machine))
2082- einfo (_("%F%P: %s: can not set architecture: %E\n"), name);
2083+ ldfile_output_architecture,
2084+ ldfile_output_machine))
2085+ fatal (_("%P: %s: can not set architecture: %E\n"), name);
2086
2087 link_info.hash = bfd_link_hash_table_create (link_info.output_bfd);
2088 if (link_info.hash == NULL)
2089- einfo (_("%F%P: can not create hash table: %E\n"));
2090+ fatal (_("%P: can not create hash table: %E\n"));
2091
2092 bfd_set_gp_size (link_info.output_bfd, g_switch_value);
2093 }
2094@@ -3662,7 +3662,7 @@ open_input_bfds (lang_statement_union_type *s,
2095
2096 /* Exit if any of the files were missing. */
2097 if (input_flags.missing_file)
2098- einfo ("%F");
2099+ fatal ("");
2100 }
2101
2102 #ifdef ENABLE_LIBCTF
2103@@ -3973,7 +3973,7 @@ insert_undefined (const char *name)
2104
2105 h = bfd_link_hash_lookup (link_info.hash, name, true, false, true);
2106 if (h == NULL)
2107- einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
2108+ fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
2109 if (h->type == bfd_link_hash_new)
2110 {
2111 h->type = bfd_link_hash_undefined;
2112@@ -4259,7 +4259,7 @@ map_input_to_output_sections
2113 else if (strcmp (name, "SHT_PREINIT_ARRAY") == 0)
2114 type = SHT_PREINIT_ARRAY;
2115 else
2116- einfo (_ ("%F%P: invalid type for output section `%s'\n"),
2117+ fatal (_ ("%P: invalid type for output section `%s'\n"),
2118 os->name);
2119 }
2120 else
2121@@ -4268,7 +4268,7 @@ map_input_to_output_sections
2122 if (expld.result.valid_p)
2123 type = expld.result.value;
2124 else
2125- einfo (_ ("%F%P: invalid type for output section `%s'\n"),
2126+ fatal (_ ("%P: invalid type for output section `%s'\n"),
2127 os->name);
2128 }
2129 break;
2130@@ -4417,7 +4417,7 @@ process_insert_statements (lang_statement_union_type **start)
2131 }
2132 if (where == NULL)
2133 {
2134- einfo (_("%F%P: %s not found for insert\n"), i->where);
2135+ fatal (_("%P: %s not found for insert\n"), i->where);
2136 return;
2137 }
2138
2139@@ -5499,12 +5499,12 @@ size_input_section
2140 if (dot + TO_ADDR (i->size) > end)
2141 {
2142 if (i->flags & SEC_LINKER_CREATED)
2143- einfo (_("%F%P: Output section `%pA' not large enough for "
2144+ fatal (_("%P: Output section `%pA' not large enough for "
2145 "the linker-created stubs section `%pA'.\n"),
2146 i->output_section, i);
2147
2148 if (i->rawsize && i->rawsize != i->size)
2149- einfo (_("%F%P: Relaxation not supported with "
2150+ fatal (_("%P: Relaxation not supported with "
2151 "--enable-non-contiguous-regions (section `%pA' "
2152 "would overflow `%pA' after it changed size).\n"),
2153 i, i->output_section);
2154@@ -5860,7 +5860,7 @@ lang_size_sections_1
2155 dot += expld.result.section->vma;
2156 }
2157 else if (expld.phase != lang_mark_phase_enum)
2158- einfo (_("%F%P:%pS: non constant or forward reference"
2159+ fatal (_("%P:%pS: non constant or forward reference"
2160 " address expression for section %s\n"),
2161 os->addr_tree, os->name);
2162 }
2163@@ -5943,7 +5943,7 @@ lang_size_sections_1
2164 overridden by the using the --no-check-sections
2165 switch. */
2166 if (command_line.check_section_addresses)
2167- einfo (_("%F%P: error: no memory region specified"
2168+ fatal (_("%P: error: no memory region specified"
2169 " for loadable section `%s'\n"),
2170 bfd_section_name (os->bfd_section));
2171 else
2172@@ -6250,7 +6250,7 @@ lang_size_sections_1
2173 bool again;
2174
2175 if (!bfd_relax_section (i->owner, i, &link_info, &again))
2176- einfo (_("%F%P: can't relax section: %E\n"));
2177+ fatal (_("%P: can't relax section: %E\n"));
2178 if (again)
2179 *relax = true;
2180 }
2181@@ -6659,7 +6659,7 @@ lang_do_assignments_1 (lang_statement_union_type *s,
2182 s->data_statement.value += expld.result.section->vma;
2183 }
2184 else if (expld.phase == lang_final_phase_enum)
2185- einfo (_("%F%P: invalid data statement\n"));
2186+ fatal (_("%P: invalid data statement\n"));
2187 {
2188 unsigned int size;
2189 switch (s->data_statement.type)
2190@@ -6692,7 +6692,7 @@ lang_do_assignments_1 (lang_statement_union_type *s,
2191 if (expld.result.valid_p)
2192 s->reloc_statement.addend_value = expld.result.value;
2193 else if (expld.phase == lang_final_phase_enum)
2194- einfo (_("%F%P: invalid reloc statement\n"));
2195+ fatal (_("%P: invalid reloc statement\n"));
2196 dot += TO_ADDR (bfd_get_reloc_size (s->reloc_statement.howto));
2197 break;
2198
2199@@ -7110,7 +7110,7 @@ lang_end (void)
2200 break;
2201 }
2202 if (!sym)
2203- einfo (_("%F%P: --gc-sections requires a defined symbol root "
2204+ fatal (_("%P: --gc-sections requires a defined symbol root "
2205 "specified by -e or -u\n"));
2206 }
2207
2208@@ -7135,7 +7135,7 @@ lang_end (void)
2209 + bfd_section_vma (h->u.def.section->output_section)
2210 + h->u.def.section->output_offset);
2211 if (!bfd_set_start_address (link_info.output_bfd, val))
2212- einfo (_("%F%P: %s: can't set start address\n"), entry_symbol.name);
2213+ fatal (_("%P: %s: can't set start address\n"), entry_symbol.name);
2214 }
2215 else
2216 {
2217@@ -7148,7 +7148,7 @@ lang_end (void)
2218 if (*send == '\0')
2219 {
2220 if (!bfd_set_start_address (link_info.output_bfd, val))
2221- einfo (_("%F%P: can't set start address\n"));
2222+ fatal (_("%P: can't set start address\n"));
2223 }
2224 /* BZ 2004952: Only use the start of the entry section for executables. */
2225 else if bfd_link_executable (&link_info)
2226@@ -7167,7 +7167,7 @@ lang_end (void)
2227 bfd_section_vma (ts));
2228 if (!bfd_set_start_address (link_info.output_bfd,
2229 bfd_section_vma (ts)))
2230- einfo (_("%F%P: can't set start address\n"));
2231+ fatal (_("%P: can't set start address\n"));
2232 }
2233 else
2234 {
2235@@ -7236,11 +7236,10 @@ lang_check (void)
2236 != bfd_get_flavour (link_info.output_bfd)))
2237 && (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0)
2238 {
2239- einfo (_("%F%P: relocatable linking with relocations from"
2240+ fatal (_("%P: relocatable linking with relocations from"
2241 " format %s (%pB) to format %s (%pB) is not supported\n"),
2242 bfd_get_target (input_bfd), input_bfd,
2243 bfd_get_target (link_info.output_bfd), link_info.output_bfd);
2244- /* einfo with %F exits. */
2245 }
2246
2247 if (compatible == NULL)
2248@@ -7341,7 +7340,7 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info)
2249
2250 section = h->u.c.p->section;
2251 if (!bfd_define_common_symbol (link_info.output_bfd, &link_info, h))
2252- einfo (_("%F%P: could not define common symbol `%pT': %E\n"),
2253+ fatal (_("%P: could not define common symbol `%pT': %E\n"),
2254 h->root.string);
2255
2256 if (config.map_file != NULL)
2257@@ -7519,7 +7518,7 @@ lang_set_flags (lang_memory_region_type *ptr, const char *flags, int invert)
2258 break;
2259
2260 default:
2261- einfo (_("%F%P: invalid character %c (%d) in flags\n"),
2262+ fatal (_("%P: invalid character %c (%d) in flags\n"),
2263 *flags, *flags);
2264 break;
2265 }
2266@@ -7631,7 +7630,7 @@ lang_enter_output_section_statement (const char *output_section_statement_name,
2267
2268 os->align_lma_with_input = align_with_input == ALIGN_WITH_INPUT;
2269 if (os->align_lma_with_input && align != NULL)
2270- einfo (_("%F%P:%pS: error: align with input and explicit align specified\n"),
2271+ fatal (_("%P:%pS: error: align with input and explicit align specified\n"),
2272 NULL);
2273
2274 os->subsection_alignment = subalign;
2275@@ -8143,7 +8142,7 @@ lang_process (void)
2276 lang_place_undefineds ();
2277
2278 if (!bfd_section_already_linked_table_init ())
2279- einfo (_("%F%P: can not create hash table: %E\n"));
2280+ fatal (_("%P: can not create hash table: %E\n"));
2281
2282 /* A first pass through the memory regions ensures that if any region
2283 references a symbol for its origin or length then this symbol will be
2284@@ -8181,7 +8180,7 @@ lang_process (void)
2285 files = file_chain;
2286 inputfiles = input_file_chain;
2287 if (plugin_call_all_symbols_read ())
2288- einfo (_("%F%P: %s: plugin reported error after all symbols read\n"),
2289+ fatal (_("%P: %s: plugin reported error after all symbols read\n"),
2290 plugin_error_plugin ());
2291 link_info.lto_all_symbols_read = true;
2292 /* Open any newly added files, updating the file chains. */
2293@@ -8758,9 +8757,7 @@ void
2294 lang_startup (const char *name)
2295 {
2296 if (first_file->filename != NULL)
2297- {
2298- einfo (_("%F%P: multiple STARTUP files\n"));
2299- }
2300+ fatal (_("%P: multiple STARTUP files\n"));
2301 first_file->filename = name;
2302 first_file->local_sym_name = name;
2303 first_file->flags.real = true;
2304@@ -8984,7 +8981,7 @@ lang_record_phdrs (void)
2305 break;
2306 }
2307 if (last == NULL)
2308- einfo (_("%F%P: no sections assigned to phdrs\n"));
2309+ fatal (_("%P: no sections assigned to phdrs\n"));
2310 }
2311 pl = last;
2312 }
2313@@ -9022,7 +9019,7 @@ lang_record_phdrs (void)
2314 if (!bfd_record_phdr (link_info.output_bfd, l->type,
2315 l->flags != NULL, flags, l->at != NULL,
2316 at, l->filehdr, l->phdrs, c, secs))
2317- einfo (_("%F%P: bfd_record_phdr failed: %E\n"));
2318+ fatal (_("%P: bfd_record_phdr failed: %E\n"));
2319 }
2320
2321 free (secs);
2322diff --git a/ld/ldlex.l b/ld/ldlex.l
2323index e113c908..7cbade08 100644
2324--- a/ld/ldlex.l
2325+++ b/ld/ldlex.l
2326@@ -504,9 +504,7 @@ void
2327 lex_push_file (FILE *file, const char *name, unsigned int sysrooted)
2328 {
2329 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
2330- {
2331- einfo (_("%F:includes nested too deeply\n"));
2332- }
2333+ fatal (_("%P: includes nested too deeply\n"));
2334 file_name_stack[include_stack_ptr] = name;
2335 lineno_stack[include_stack_ptr] = lineno;
2336 sysrooted_stack[include_stack_ptr] = input_flags.sysrooted;
2337@@ -568,9 +566,7 @@ lex_redirect (const char *string, const char *fake_filename, unsigned int count)
2338
2339 yy_init = 0;
2340 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
2341- {
2342- einfo (_("%F: macros nested too deeply\n"));
2343- }
2344+ fatal (_("%P: macros nested too deeply\n"));
2345 file_name_stack[include_stack_ptr] = fake_filename;
2346 lineno_stack[include_stack_ptr] = lineno;
2347 include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
2348@@ -674,7 +670,7 @@ yy_input (char *buf, int max_size)
2349 {
2350 result = fread (buf, 1, max_size, yyin);
2351 if (result < max_size && ferror (yyin))
2352- einfo (_("%F%P: read in flex scanner failed\n"));
2353+ fatal (_("%P: read in flex scanner failed\n"));
2354 }
2355 }
2356 return result;
2357@@ -711,7 +707,7 @@ comment (void)
2358
2359 if (c == 0)
2360 {
2361- einfo (_("%F%P: EOF in comment\n"));
2362+ fatal (_("%P: EOF in comment\n"));
2363 break;
2364 }
2365 }
2366@@ -732,7 +728,7 @@ lex_warn_invalid (char *where, char *what)
2367 if (ldfile_assumed_script)
2368 {
2369 bfd_set_error (bfd_error_file_not_recognized);
2370- einfo (_("%F%s: file not recognized: %E\n"), ldlex_filename ());
2371+ fatal (_("%s: file not recognized: %E\n"), ldlex_filename ());
2372 }
2373
2374 if (! ISPRINT (*what))
2375diff --git a/ld/ldmain.c b/ld/ldmain.c
2376index 3cd5516c..878d9536 100644
2377--- a/ld/ldmain.c
2378+++ b/ld/ldmain.c
2379@@ -192,7 +192,7 @@ write_dependency_file (void)
2380 out = fopen (config.dependency_file, FOPEN_WT);
2381 if (out == NULL)
2382 {
2383- einfo (_("%F%P: cannot open dependency file %s: %E\n"),
2384+ fatal (_("%P: cannot open dependency file %s: %E\n"),
2385 config.dependency_file);
2386 }
2387
2388@@ -265,7 +265,7 @@ main (int argc, char **argv)
2389 expandargv (&argc, &argv);
2390
2391 if (bfd_init () != BFD_INIT_MAGIC)
2392- einfo (_("%F%P: fatal error: libbfd ABI mismatch\n"));
2393+ fatal (_("%P: fatal error: libbfd ABI mismatch\n"));
2394
2395 bfd_set_error_program_name (program_name);
2396
2397@@ -467,13 +467,13 @@ main (int argc, char **argv)
2398 xexit (0);
2399
2400 if (link_info.inhibit_common_definition && !bfd_link_dll (&link_info))
2401- einfo (_("%F%P: --no-define-common may not be used without -shared\n"));
2402+ fatal (_("%P: --no-define-common may not be used without -shared\n"));
2403
2404 if (!lang_has_input_file)
2405 {
2406 if (version_printed || command_line.print_output_format)
2407 xexit (0);
2408- einfo (_("%F%P: no input files\n"));
2409+ fatal (_("%P: no input files\n"));
2410 }
2411
2412 if (verbose)
2413@@ -493,7 +493,7 @@ main (int argc, char **argv)
2414 if (config.map_file == (FILE *) NULL)
2415 {
2416 bfd_set_error (bfd_error_system_call);
2417- einfo (_("%F%P: cannot open map file %s: %E\n"),
2418+ einfo (_("%P: cannot open map file %s: %E\n"),
2419 config.map_filename);
2420 }
2421 }
2422@@ -568,7 +568,7 @@ main (int argc, char **argv)
2423 bfd *obfd = link_info.output_bfd;
2424 link_info.output_bfd = NULL;
2425 if (!bfd_close (obfd))
2426- einfo (_("%F%P: %s: final close failed: %E\n"), output_filename);
2427+ fatal (_("%P: %s: final close failed: %E\n"), output_filename);
2428
2429 /* If the --force-exe-suffix is enabled, and we're making an
2430 executable file and it doesn't end in .exe, copy it to one
2431@@ -595,10 +595,10 @@ main (int argc, char **argv)
2432 dst = fopen (dst_name, FOPEN_WB);
2433
2434 if (!src)
2435- einfo (_("%F%P: unable to open for source of copy `%s'\n"),
2436+ fatal (_("%P: unable to open for source of copy `%s'\n"),
2437 output_filename);
2438 if (!dst)
2439- einfo (_("%F%P: unable to open for destination of copy `%s'\n"),
2440+ fatal (_("%P: unable to open for destination of copy `%s'\n"),
2441 dst_name);
2442 while ((l = fread (buf, 1, bsize, src)) > 0)
2443 {
2444@@ -709,7 +709,7 @@ get_emulation (int argc, char **argv)
2445 i++;
2446 }
2447 else
2448- einfo (_("%F%P: missing argument to -m\n"));
2449+ fatal (_("%P: missing argument to -m\n"));
2450 }
2451 else if (strcmp (argv[i], "-mips1") == 0
2452 || strcmp (argv[i], "-mips2") == 0
2453@@ -763,11 +763,11 @@ add_ysym (const char *name)
2454 bfd_hash_newfunc,
2455 sizeof (struct bfd_hash_entry),
2456 61))
2457- einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
2458+ fatal (_("%P: bfd_hash_table_init failed: %E\n"));
2459 }
2460
2461 if (bfd_hash_lookup (link_info.notice_hash, name, true, true) == NULL)
2462- einfo (_("%F%P: bfd_hash_lookup failed: %E\n"));
2463+ fatal (_("%P: bfd_hash_lookup failed: %E\n"));
2464 }
2465
2466 void
2467@@ -780,11 +780,11 @@ add_ignoresym (struct bfd_link_info *info, const char *name)
2468 bfd_hash_newfunc,
2469 sizeof (struct bfd_hash_entry),
2470 61))
2471- einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
2472+ fatal (_("%P: bfd_hash_table_init failed: %E\n"));
2473 }
2474
2475 if (bfd_hash_lookup (info->ignore_hash, name, true, true) == NULL)
2476- einfo (_("%F%P: bfd_hash_lookup failed: %E\n"));
2477+ fatal (_("%P: bfd_hash_lookup failed: %E\n"));
2478 }
2479
2480 /* Record a symbol to be wrapped, from the --wrap option. */
2481@@ -800,11 +800,11 @@ add_wrap (const char *name)
2482 bfd_hash_newfunc,
2483 sizeof (struct bfd_hash_entry),
2484 61))
2485- einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
2486+ fatal (_("%P: bfd_hash_table_init failed: %E\n"));
2487 }
2488
2489 if (bfd_hash_lookup (link_info.wrap_hash, name, true, true) == NULL)
2490- einfo (_("%F%P: bfd_hash_lookup failed: %E\n"));
2491+ fatal (_("%P: bfd_hash_lookup failed: %E\n"));
2492 }
2493
2494 /* Handle the -retain-symbols-file option. */
2495@@ -832,7 +832,7 @@ add_keepsyms_file (const char *filename)
2496 xmalloc (sizeof (struct bfd_hash_table));
2497 if (!bfd_hash_table_init (link_info.keep_hash, bfd_hash_newfunc,
2498 sizeof (struct bfd_hash_entry)))
2499- einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
2500+ fatal (_("%P: bfd_hash_table_init failed: %E\n"));
2501
2502 bufsize = 100;
2503 buf = (char *) xmalloc (bufsize);
2504@@ -862,7 +862,7 @@ add_keepsyms_file (const char *filename)
2505 buf[len] = '\0';
2506
2507 if (bfd_hash_lookup (link_info.keep_hash, buf, true, true) == NULL)
2508- einfo (_("%F%P: bfd_hash_lookup for insertion failed: %E\n"));
2509+ fatal (_("%P: bfd_hash_lookup for insertion failed: %E\n"));
2510 }
2511 }
2512
2513@@ -1269,7 +1269,7 @@ constructor_callback (struct bfd_link_info *info,
2514 if (bfd_reloc_type_lookup (info->output_bfd, BFD_RELOC_CTOR) == NULL
2515 && (bfd_link_relocatable (info)
2516 || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL))
2517- einfo (_("%F%P: BFD backend error: BFD_RELOC_CTOR unsupported\n"));
2518+ fatal (_("%P: BFD backend error: BFD_RELOC_CTOR unsupported\n"));
2519
2520 s = set_name;
2521 if (bfd_get_symbol_leading_char (abfd) != '\0')
2522@@ -1281,7 +1281,7 @@ constructor_callback (struct bfd_link_info *info,
2523
2524 h = bfd_link_hash_lookup (info->hash, set_name, true, true, true);
2525 if (h == (struct bfd_link_hash_entry *) NULL)
2526- einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
2527+ fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
2528 if (h->type == bfd_link_hash_new)
2529 {
2530 h->type = bfd_link_hash_undefined;
2531@@ -1314,7 +1314,7 @@ symbol_warning (const char *warning, const char *symbol, bfd *abfd)
2532 struct warning_callback_info cinfo;
2533
2534 if (!bfd_generic_link_read_symbols (abfd))
2535- einfo (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
2536+ fatal (_("%P: %pB: could not read symbols: %E\n"), abfd);
2537
2538 cinfo.found = false;
2539 cinfo.warning = warning;
2540@@ -1376,14 +1376,14 @@ warning_find_reloc (bfd *abfd, asection *sec, void *iarg)
2541
2542 relsize = bfd_get_reloc_upper_bound (abfd, sec);
2543 if (relsize < 0)
2544- einfo (_("%F%P: %pB: could not read relocs: %E\n"), abfd);
2545+ fatal (_("%P: %pB: could not read relocs: %E\n"), abfd);
2546 if (relsize == 0)
2547 return;
2548
2549 relpp = (arelent **) xmalloc (relsize);
2550 relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols);
2551 if (relcount < 0)
2552- einfo (_("%F%P: %pB: could not read relocs: %E\n"), abfd);
2553+ fatal (_("%P: %pB: could not read relocs: %E\n"), abfd);
2554
2555 p = relpp;
2556 pend = p + relcount;
2557diff --git a/ld/ldmisc.c b/ld/ldmisc.c
2558index 3c862ea4..d1257214 100644
2559--- a/ld/ldmisc.c
2560+++ b/ld/ldmisc.c
2561@@ -70,7 +70,7 @@
2562 void
2563 vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning)
2564 {
2565- bool fatal = false;
2566+ bool isfatal = false;
2567 const char *scan;
2568 int arg_type;
2569 unsigned int arg_count = 0;
2570@@ -282,7 +282,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning)
2571
2572 case 'F':
2573 /* Error is fatal. */
2574- fatal = true;
2575+ isfatal = true;
2576 break;
2577
2578 case 'P':
2579@@ -324,7 +324,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning)
2580 if (abfd != NULL)
2581 {
2582 if (!bfd_generic_link_read_symbols (abfd))
2583- einfo (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
2584+ fatal (_("%P: %pB: could not read symbols: %E\n"), abfd);
2585
2586 asymbols = bfd_get_outsymbols (abfd);
2587 }
2588@@ -587,7 +587,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning)
2589 if (is_warning && config.fatal_warnings)
2590 config.make_executable = false;
2591
2592- if (fatal)
2593+ if (isfatal)
2594 xexit (1);
2595 }
2596
2597@@ -620,10 +620,25 @@ einfo (const char *fmt, ...)
2598 fflush (stderr);
2599 }
2600
2601+/* Fatal error. */
2602+
2603+void
2604+fatal (const char *fmt, ...)
2605+{
2606+ va_list arg;
2607+
2608+ fflush (stdout);
2609+ va_start (arg, fmt);
2610+ vfinfo (stderr, fmt, arg, true);
2611+ va_end (arg);
2612+ fflush (stderr);
2613+ xexit (1);
2614+}
2615+
2616 void
2617 info_assert (const char *file, unsigned int line)
2618 {
2619- einfo (_("%F%P: internal error %s %d\n"), file, line);
2620+ fatal (_("%P: internal error %s %d\n"), file, line);
2621 }
2622
2623 /* ('m' for map) Format info message and print on map. */
2624@@ -692,6 +707,5 @@ ld_abort (const char *file, int line, const char *fn)
2625 else
2626 einfo (_("%P: internal error: aborting at %s:%d\n"),
2627 file, line);
2628- einfo (_("%F%P: please report this bug\n"));
2629- xexit (1);
2630+ fatal (_("%P: please report this bug\n"));
2631 }
2632diff --git a/ld/ldmisc.h b/ld/ldmisc.h
2633index e8b982fe..f763ab8f 100644
2634--- a/ld/ldmisc.h
2635+++ b/ld/ldmisc.h
2636@@ -23,6 +23,7 @@
2637
2638 extern void vfinfo (FILE *fp, const char *fmt, va_list arg, bool is_warning);
2639 extern void einfo (const char *, ...);
2640+extern void fatal (const char *, ...) ATTRIBUTE_NORETURN;
2641 extern void minfo (const char *, ...);
2642 extern void info_msg (const char *, ...);
2643 extern void lfinfo (FILE *, const char *, ...);
2644diff --git a/ld/ldwrite.c b/ld/ldwrite.c
2645index 46fb33c8..ace5e564 100644
2646--- a/ld/ldwrite.c
2647+++ b/ld/ldwrite.c
2648@@ -57,14 +57,14 @@ build_link_order (lang_statement_union_type *statement)
2649
2650 link_order = bfd_new_link_order (link_info.output_bfd, output_section);
2651 if (link_order == NULL)
2652- einfo (_("%F%P: bfd_new_link_order failed: %E\n"));
2653+ fatal (_("%P: bfd_new_link_order failed: %E\n"));
2654
2655 link_order->type = bfd_data_link_order;
2656 link_order->offset = statement->data_statement.output_offset;
2657 link_order->u.data.contents = bfd_alloc (link_info.output_bfd,
2658 QUAD_SIZE);
2659 if (link_order->u.data.contents == NULL)
2660- einfo (_("%F%P: bfd_new_link_order failed: %E\n"));
2661+ fatal (_("%P: bfd_new_link_order failed: %E\n"));
2662
2663 value = statement->data_statement.value;
2664
2665@@ -170,7 +170,7 @@ build_link_order (lang_statement_union_type *statement)
2666
2667 link_order = bfd_new_link_order (link_info.output_bfd, output_section);
2668 if (link_order == NULL)
2669- einfo (_("%F%P: bfd_new_link_order failed: %E\n"));
2670+ fatal (_("%P: bfd_new_link_order failed: %E\n"));
2671
2672 link_order->offset = rs->output_offset;
2673 link_order->size = bfd_get_reloc_size (rs->howto);
2674@@ -178,7 +178,7 @@ build_link_order (lang_statement_union_type *statement)
2675 link_order->u.reloc.p = (struct bfd_link_order_reloc *)
2676 bfd_alloc (link_info.output_bfd, sizeof (struct bfd_link_order_reloc));
2677 if (link_order->u.reloc.p == NULL)
2678- einfo (_("%F%P: bfd_new_link_order failed: %E\n"));
2679+ fatal (_("%P: bfd_new_link_order failed: %E\n"));
2680
2681 link_order->u.reloc.p->reloc = rs->reloc;
2682 link_order->u.reloc.p->addend = rs->addend_value;
2683@@ -224,7 +224,7 @@ build_link_order (lang_statement_union_type *statement)
2684 link_order = bfd_new_link_order (link_info.output_bfd,
2685 output_section);
2686 if (link_order == NULL)
2687- einfo (_("%F%P: bfd_new_link_order failed: %E\n"));
2688+ fatal (_("%P: bfd_new_link_order failed: %E\n"));
2689
2690 if ((i->flags & SEC_NEVER_LOAD) != 0
2691 && (i->flags & SEC_DEBUGGING) == 0)
2692@@ -265,7 +265,7 @@ build_link_order (lang_statement_union_type *statement)
2693 link_order = bfd_new_link_order (link_info.output_bfd,
2694 output_section);
2695 if (link_order == NULL)
2696- einfo (_("%F%P: bfd_new_link_order failed: %E\n"));
2697+ fatal (_("%P: bfd_new_link_order failed: %E\n"));
2698 link_order->type = bfd_data_link_order;
2699 link_order->size = statement->padding_statement.size;
2700 link_order->offset = statement->padding_statement.output_offset;
2701@@ -334,8 +334,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
2702 if (startswith (name, ".stab")
2703 || strcmp (name, "$GDB_SYMBOLS$") == 0)
2704 {
2705- einfo (_ ("%F%P: cannot create split section name for %s\n"), name);
2706- /* Silence gcc warnings. einfo exits, so we never reach here. */
2707+ fatal (_ ("%P: cannot create split section name for %s\n"), name);
2708 return NULL;
2709 }
2710 tname[5] = 0;
2711@@ -346,8 +345,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
2712 || (h = bfd_link_hash_lookup (link_info.hash,
2713 sname, true, true, false)) == NULL)
2714 {
2715- einfo (_("%F%P: clone section failed: %E\n"));
2716- /* Silence gcc warnings. einfo exits, so we never reach here. */
2717+ fatal (_("%P: clone section failed: %E\n"));
2718 return NULL;
2719 }
2720 free (tname);
2721@@ -554,7 +552,7 @@ ldwrite (void)
2722 out. */
2723
2724 if (bfd_get_error () != bfd_error_no_error)
2725- einfo (_("%F%P: final link failed: %E\n"));
2726+ fatal (_("%P: final link failed: %E\n"));
2727 else
2728 xexit (1);
2729 }
2730diff --git a/ld/lexsup.c b/ld/lexsup.c
2731index e9939000..00346348 100644
2732--- a/ld/lexsup.c
2733+++ b/ld/lexsup.c
2734@@ -810,7 +810,8 @@ parse_args (unsigned argc, char **argv)
2735 && optc != argv[last_optind][1])
2736 {
2737 if (optarg)
2738- einfo (_("%F%P: Error: unable to disambiguate: %s (did you mean -%s ?)\n"),
2739+ fatal (_("%P: Error: unable to disambiguate: "
2740+ "%s (did you mean -%s ?)\n"),
2741 argv[last_optind], argv[last_optind]);
2742 else
2743 einfo (_("%P: Warning: grouped short command line options are deprecated: %s\n"), argv[last_optind]);
2744@@ -850,7 +851,7 @@ parse_args (unsigned argc, char **argv)
2745 /* Fall through. */
2746
2747 default:
2748- einfo (_("%F%P: use the --help option for usage information\n"));
2749+ fatal (_("%P: use the --help option for usage information\n"));
2750 break;
2751
2752 case 1: /* File name. */
2753@@ -869,7 +870,7 @@ parse_args (unsigned argc, char **argv)
2754 || strcmp (optarg, "default") == 0)
2755 input_flags.dynamic = true;
2756 else
2757- einfo (_("%F%P: unrecognized -a option `%s'\n"), optarg);
2758+ fatal (_("%P: unrecognized -a option `%s'\n"), optarg);
2759 break;
2760 case OPTION_ASSERT:
2761 /* FIXME: We just ignore these, but we should handle them. */
2762@@ -882,7 +883,7 @@ parse_args (unsigned argc, char **argv)
2763 else if (strcmp (optarg, "pure-text") == 0)
2764 ;
2765 else
2766- einfo (_("%F%P: unrecognized -assert option `%s'\n"), optarg);
2767+ fatal (_("%P: unrecognized -assert option `%s'\n"), optarg);
2768 break;
2769 case 'A':
2770 ldfile_add_arch (optarg);
2771@@ -926,8 +927,7 @@ parse_args (unsigned argc, char **argv)
2772
2773 style = cplus_demangle_name_to_style (optarg);
2774 if (style == unknown_demangling)
2775- einfo (_("%F%P: unknown demangling style `%s'\n"),
2776- optarg);
2777+ fatal (_("%P: unknown demangling style `%s'\n"), optarg);
2778
2779 cplus_demangle_set_style (style);
2780 }
2781@@ -1034,7 +1034,7 @@ parse_args (unsigned argc, char **argv)
2782 char *end;
2783 g_switch_value = strtoul (optarg, &end, 0);
2784 if (*end)
2785- einfo (_("%F%P: invalid number `%s'\n"), optarg);
2786+ fatal (_("%P: invalid number `%s'\n"), optarg);
2787 }
2788 break;
2789 case 'g':
2790@@ -1130,7 +1130,7 @@ parse_args (unsigned argc, char **argv)
2791 link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
2792 }
2793 else
2794- einfo (_("%F%P: bad --unresolved-symbols option: %s\n"), optarg);
2795+ fatal (_("%P: bad --unresolved-symbols option: %s\n"), optarg);
2796 break;
2797 case OPTION_WARN_UNRESOLVED_SYMBOLS:
2798 link_info.warn_unresolved_syms = true;
2799@@ -1217,7 +1217,7 @@ parse_args (unsigned argc, char **argv)
2800 break;
2801 case OPTION_PLUGIN_OPT:
2802 if (plugin_opt_plugin_arg (optarg))
2803- einfo (_("%F%P: bad -plugin-opt option\n"));
2804+ fatal (_("%P: bad -plugin-opt option\n"));
2805 break;
2806 #endif /* BFD_SUPPORTS_PLUGINS */
2807 case 'q':
2808@@ -1234,11 +1234,11 @@ parse_args (unsigned argc, char **argv)
2809 an error message here. We cannot just make this a warning,
2810 increment optind, and continue because getopt is too confused
2811 and will seg-fault the next time around. */
2812- einfo(_("%F%P: unrecognised option: %s\n"), argv[optind]);
2813+ fatal(_("%P: unrecognised option: %s\n"), argv[optind]);
2814
2815 if (bfd_link_pic (&link_info))
2816- einfo (_("%F%P: -r and %s may not be used together\n"),
2817- bfd_link_dll (&link_info) ? "-shared" : "-pie");
2818+ fatal (_("%P: -r and %s may not be used together\n"),
2819+ bfd_link_dll (&link_info) ? "-shared" : "-pie");
2820
2821 link_info.type = type_relocatable;
2822 config.build_constructors = false;
2823@@ -1347,7 +1347,7 @@ parse_args (unsigned argc, char **argv)
2824 if (config.has_shared)
2825 {
2826 if (bfd_link_relocatable (&link_info))
2827- einfo (_("%F%P: -r and %s may not be used together\n"),
2828+ fatal (_("%P: -r and %s may not be used together\n"),
2829 "-shared");
2830
2831 link_info.type = type_dll;
2832@@ -1359,7 +1359,7 @@ parse_args (unsigned argc, char **argv)
2833 link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
2834 }
2835 else
2836- einfo (_("%F%P: -shared not supported\n"));
2837+ fatal (_("%P: -shared not supported\n"));
2838 break;
2839 case OPTION_NO_PIE:
2840 link_info.type = type_pde;
2841@@ -1368,12 +1368,12 @@ parse_args (unsigned argc, char **argv)
2842 if (config.has_shared)
2843 {
2844 if (bfd_link_relocatable (&link_info))
2845- einfo (_("%F%P: -r and %s may not be used together\n"), "-pie");
2846+ fatal (_("%P: -r and %s may not be used together\n"), "-pie");
2847
2848 link_info.type = type_pie;
2849 }
2850 else
2851- einfo (_("%F%P: -pie not supported\n"));
2852+ fatal (_("%P: -pie not supported\n"));
2853 break;
2854 case 'h': /* Used on Solaris. */
2855 case OPTION_SONAME:
2856@@ -1390,7 +1390,7 @@ parse_args (unsigned argc, char **argv)
2857 else if (strcmp (optarg, N_("ascending")) == 0)
2858 config.sort_common = sort_ascending;
2859 else
2860- einfo (_("%F%P: invalid common section sorting option: %s\n"),
2861+ fatal (_("%P: invalid common section sorting option: %s\n"),
2862 optarg);
2863 break;
2864 case OPTION_SORT_SECTION:
2865@@ -1399,8 +1399,7 @@ parse_args (unsigned argc, char **argv)
2866 else if (strcmp (optarg, N_("alignment")) == 0)
2867 sort_section = by_alignment;
2868 else
2869- einfo (_("%F%P: invalid section sorting option: %s\n"),
2870- optarg);
2871+ fatal (_("%P: invalid section sorting option: %s\n"), optarg);
2872 break;
2873 case OPTION_STATS:
2874 config.stats = true;
2875@@ -1436,14 +1435,14 @@ parse_args (unsigned argc, char **argv)
2876 /* Check for <something>=<somthing>... */
2877 optarg2 = strchr (optarg, '=');
2878 if (optarg2 == NULL)
2879- einfo (_("%F%P: invalid argument to option"
2880+ fatal (_("%P: invalid argument to option"
2881 " \"--section-start\"\n"));
2882
2883 optarg2++;
2884
2885 /* So far so good. Are all the args present? */
2886 if ((*optarg == '\0') || (*optarg2 == '\0'))
2887- einfo (_("%F%P: missing argument(s) to option"
2888+ fatal (_("%P: missing argument(s) to option"
2889 " \"--section-start\"\n"));
2890
2891 /* We must copy the section name as set_section_start
2892@@ -1487,8 +1486,8 @@ parse_args (unsigned argc, char **argv)
2893 /* Fall through. */
2894 case OPTION_UR:
2895 if (bfd_link_pic (&link_info))
2896- einfo (_("%F%P: -r and %s may not be used together\n"),
2897- bfd_link_dll (&link_info) ? "-shared" : "-pie");
2898+ fatal (_("%P: -r and %s may not be used together\n"),
2899+ bfd_link_dll (&link_info) ? "-shared" : "-pie");
2900
2901 link_info.type = type_relocatable;
2902 config.build_constructors = true;
2903@@ -1518,7 +1517,7 @@ parse_args (unsigned argc, char **argv)
2904 char *end;
2905 int level ATTRIBUTE_UNUSED = strtoul (optarg, &end, 0);
2906 if (*end)
2907- einfo (_("%F%P: invalid number `%s'\n"), optarg);
2908+ fatal (_("%P: invalid number `%s'\n"), optarg);
2909 #if BFD_SUPPORTS_PLUGINS
2910 report_plugin_symbols = level > 1;
2911 #endif /* BFD_SUPPORTS_PLUGINS */
2912@@ -1713,7 +1712,7 @@ parse_args (unsigned argc, char **argv)
2913 break;
2914 case ')':
2915 if (! ingroup)
2916- einfo (_("%F%P: group ended before it began (--help for usage)\n"));
2917+ fatal (_("%P: group ended before it began (--help for usage)\n"));
2918
2919 lang_leave_group ();
2920 ingroup--;
2921@@ -1729,7 +1728,7 @@ parse_args (unsigned argc, char **argv)
2922
2923 case OPTION_REMAP_INPUTS_FILE:
2924 if (! ldfile_add_remap_file (optarg))
2925- einfo (_("%F%P: failed to add remap file %s\n"), optarg);
2926+ fatal (_("%P: failed to add remap file %s\n"), optarg);
2927 break;
2928
2929 case OPTION_REMAP_INPUTS:
2930@@ -1738,7 +1737,7 @@ parse_args (unsigned argc, char **argv)
2931 if (optarg2 == NULL)
2932 /* FIXME: Should we allow --remap-inputs=@myfile as a synonym
2933 for --remap-inputs-file=myfile ? */
2934- einfo (_("%F%P: invalid argument to option --remap-inputs\n"));
2935+ fatal (_("%P: invalid argument to option --remap-inputs\n"));
2936 size_t len = optarg2 - optarg;
2937 char * pattern = xmalloc (len + 1);
2938 memcpy (pattern, optarg, len);
2939@@ -1759,8 +1758,7 @@ parse_args (unsigned argc, char **argv)
2940 char *end;
2941 bfd_size_type cache_size = strtoul (optarg, &end, 0);
2942 if (*end != '\0')
2943- einfo (_("%F%P: invalid cache memory size: %s\n"),
2944- optarg);
2945+ fatal (_("%P: invalid cache memory size: %s\n"), optarg);
2946 link_info.max_cache_size = cache_size;
2947 }
2948 break;
2949@@ -1785,7 +1783,7 @@ parse_args (unsigned argc, char **argv)
2950
2951 case OPTION_POP_STATE:
2952 if (input_flags.pushed == NULL)
2953- einfo (_("%F%P: no state pushed before popping\n"));
2954+ fatal (_("%P: no state pushed before popping\n"));
2955 else
2956 {
2957 struct lang_input_statement_flags *oldp = input_flags.pushed;
2958@@ -1808,7 +1806,7 @@ parse_args (unsigned argc, char **argv)
2959 else if (strcasecmp (optarg, "discard") == 0)
2960 config.orphan_handling = orphan_handling_discard;
2961 else
2962- einfo (_("%F%P: invalid argument to option"
2963+ fatal (_("%P: invalid argument to option"
2964 " \"--orphan-handling\"\n"));
2965 break;
2966
2967@@ -1853,7 +1851,7 @@ parse_args (unsigned argc, char **argv)
2968 else if (strcmp (optarg, "share-duplicated") == 0)
2969 config.ctf_share_duplicated = true;
2970 else
2971- einfo (_("%F%P: bad --ctf-share-types option: %s\n"), optarg);
2972+ fatal (_("%P: bad --ctf-share-types option: %s\n"), optarg);
2973 break;
2974 }
2975 }
2976@@ -2048,7 +2046,7 @@ parse_args (unsigned argc, char **argv)
2977 if (config.no_section_header)
2978 {
2979 if (bfd_link_relocatable (&link_info))
2980- einfo (_("%F%P: -r and -z nosectionheader may not be used together\n"));
2981+ fatal (_("%P: -r and -z nosectionheader may not be used together\n"));
2982
2983 link_info.strip = strip_all;
2984 }
2985@@ -2056,9 +2054,9 @@ parse_args (unsigned argc, char **argv)
2986 if (!bfd_link_dll (&link_info))
2987 {
2988 if (command_line.filter_shlib)
2989- einfo (_("%F%P: -F may not be used without -shared\n"));
2990+ fatal (_("%P: -F may not be used without -shared\n"));
2991 if (command_line.auxiliary_filters)
2992- einfo (_("%F%P: -f may not be used without -shared\n"));
2993+ fatal (_("%P: -f may not be used without -shared\n"));
2994 }
2995
2996 /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I
2997@@ -2099,7 +2097,7 @@ set_section_start (char *sect, char *valstr)
2998 const char *end;
2999 bfd_vma val = bfd_scan_vma (valstr, &end, 16);
3000 if (*end)
3001- einfo (_("%F%P: invalid hex number `%s'\n"), valstr);
3002+ fatal (_("%P: invalid hex number `%s'\n"), valstr);
3003 lang_section_start (sect, exp_intop (val), NULL);
3004 }
3005
3006@@ -2112,7 +2110,7 @@ set_segment_start (const char *section, char *valstr)
3007
3008 bfd_vma val = bfd_scan_vma (valstr, &end, 16);
3009 if (*end)
3010- einfo (_("%F%P: invalid hex number `%s'\n"), valstr);
3011+ fatal (_("%P: invalid hex number `%s'\n"), valstr);
3012 /* If we already have an entry for this segment, update the existing
3013 value. */
3014 name = section + 1;
3015diff --git a/ld/mri.c b/ld/mri.c
3016index 766f3174..7c8e59fa 100644
3017--- a/ld/mri.c
3018+++ b/ld/mri.c
3019@@ -288,7 +288,7 @@ mri_format (const char *name)
3020 lang_add_output_format ("srec", NULL, NULL, 1);
3021
3022 else
3023- einfo (_("%F%P: unknown format type %s\n"), name);
3024+ fatal (_("%P: unknown format type %s\n"), name);
3025 }
3026
3027 void
3028diff --git a/ld/pe-dll.c b/ld/pe-dll.c
3029index 95eef84f..800d00c8 100644
3030--- a/ld/pe-dll.c
3031+++ b/ld/pe-dll.c
3032@@ -756,7 +756,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *
3033
3034 if (!bfd_generic_link_read_symbols (b))
3035 {
3036- einfo (_("%F%P: %pB: could not read symbols: %E\n"), b);
3037+ fatal (_("%P: %pB: could not read symbols: %E\n"), b);
3038 return;
3039 }
3040
3041@@ -1048,7 +1048,7 @@ build_filler_bfd (bool include_edata)
3042 bfd_get_arch (link_info.output_bfd),
3043 bfd_get_mach (link_info.output_bfd)))
3044 {
3045- einfo (_("%F%P: can not create BFD: %E\n"));
3046+ fatal (_("%P: can not create BFD: %E\n"));
3047 return;
3048 }
3049
3050@@ -1326,7 +1326,7 @@ pe_walk_relocs (struct bfd_link_info *info,
3051
3052 if (!bfd_generic_link_read_symbols (b))
3053 {
3054- einfo (_("%F%P: %pB: could not read symbols: %E\n"), b);
3055+ fatal (_("%P: %pB: could not read symbols: %E\n"), b);
3056 return;
3057 }
3058
3059@@ -1407,7 +1407,7 @@ pe_find_data_imports (const char *symhead,
3060 if (!bfd_hash_table_init (import_hash,
3061 bfd_hash_newfunc,
3062 sizeof (struct bfd_hash_entry)))
3063- einfo (_("%F%P: bfd_hash_table_init failed: %E\n"));
3064+ fatal (_("%P: bfd_hash_table_init failed: %E\n"));
3065 }
3066 else
3067 import_hash = NULL;
3068@@ -1447,7 +1447,7 @@ pe_find_data_imports (const char *symhead,
3069
3070 if (!bfd_generic_link_read_symbols (b))
3071 {
3072- einfo (_("%F%P: %pB: could not read symbols: %E\n"), b);
3073+ fatal (_("%P: %pB: could not read symbols: %E\n"), b);
3074 return;
3075 }
3076
3077@@ -1549,7 +1549,7 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
3078
3079 if (!bfd_generic_link_read_symbols (b))
3080 {
3081- einfo (_("%F%P: %pB: could not read symbols: %E\n"), b);
3082+ fatal (_("%P: %pB: could not read symbols: %E\n"), b);
3083 return;
3084 }
3085
3086diff --git a/ld/plugin.c b/ld/plugin.c
3087index e9828690..0a99d406 100644
3088--- a/ld/plugin.c
3089+++ b/ld/plugin.c
3090@@ -252,7 +252,7 @@ plugin_opt_plugin (const char *plugin)
3091 newplug->name = plugin;
3092 newplug->dlhandle = dlopen (plugin, RTLD_NOW);
3093 if (!newplug->dlhandle)
3094- einfo (_("%F%P: %s: error loading plugin: %s\n"), plugin, dlerror ());
3095+ fatal (_("%P: %s: error loading plugin: %s\n"), plugin, dlerror ());
3096
3097 /* Check if plugin has been loaded already. */
3098 while (curplug)
3099@@ -345,7 +345,7 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate)
3100 }
3101 }
3102 report_error:
3103- einfo (_("%F%P: could not create dummy IR bfd: %E\n"));
3104+ fatal (_("%P: could not create dummy IR bfd: %E\n"));
3105 return NULL;
3106 }
3107
3108@@ -426,7 +426,7 @@ asymbol_from_plugin_symbol (bfd *abfd, asymbol *asym,
3109 unsigned char visibility;
3110
3111 if (!elfsym)
3112- einfo (_("%F%P: %s: non-ELF symbol in ELF BFD!\n"), asym->name);
3113+ fatal (_("%P: %s: non-ELF symbol in ELF BFD!\n"), asym->name);
3114
3115 if (ldsym->def == LDPK_COMMON)
3116 {
3117@@ -437,7 +437,7 @@ asymbol_from_plugin_symbol (bfd *abfd, asymbol *asym,
3118 switch (ldsym->visibility)
3119 {
3120 default:
3121- einfo (_("%F%P: unknown ELF symbol visibility: %d!\n"),
3122+ fatal (_("%P: unknown ELF symbol visibility: %d!\n"),
3123 ldsym->visibility);
3124 return LDPS_ERR;
3125
3126@@ -555,7 +555,7 @@ get_view (const void *handle, const void **viewp)
3127
3128 /* FIXME: einfo should support %lld. */
3129 if ((off_t) size != input->filesize)
3130- einfo (_("%F%P: unsupported input file size: %s (%ld bytes)\n"),
3131+ fatal (_("%P: unsupported input file size: %s (%ld bytes)\n"),
3132 input->name, (long) input->filesize);
3133
3134 /* Check the cached view buffer. */
3135@@ -826,7 +826,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms,
3136 && blhe->type != bfd_link_hash_common)
3137 {
3138 /* We should not have a new, indirect or warning symbol here. */
3139- einfo (_("%F%P: %s: plugin symbol table corrupt (sym type %d)\n"),
3140+ fatal (_("%P: %s: plugin symbol table corrupt (sym type %d)\n"),
3141 called_plugin->name, blhe->type);
3142 }
3143
3144@@ -978,13 +978,14 @@ message (int level, const char *format, ...)
3145 case LDPL_ERROR:
3146 default:
3147 {
3148- char *newfmt = concat (level == LDPL_FATAL ? "%F" : "%X",
3149- _("%P: error: "), format, "\n",
3150+ char *newfmt = concat (_("%X%P: error: "), format, "\n",
3151 (const char *) NULL);
3152 fflush (stdout);
3153 vfinfo (stderr, newfmt, args, true);
3154 fflush (stderr);
3155 free (newfmt);
3156+ if (level == LDPL_FATAL)
3157+ fatal ("");
3158 }
3159 break;
3160 }
3161@@ -1127,14 +1128,14 @@ plugin_load_plugins (void)
3162 if (!onloadfn)
3163 onloadfn = (ld_plugin_onload) dlsym (curplug->dlhandle, "_onload");
3164 if (!onloadfn)
3165- einfo (_("%F%P: %s: error loading plugin: %s\n"),
3166+ fatal (_("%P: %s: error loading plugin: %s\n"),
3167 curplug->name, dlerror ());
3168 set_tv_plugin_args (curplug, &my_tv[tv_header_size]);
3169 called_plugin = curplug;
3170 rv = (*onloadfn) (my_tv);
3171 called_plugin = NULL;
3172 if (rv != LDPS_OK)
3173- einfo (_("%F%P: %s: plugin error: %d\n"), curplug->name, rv);
3174+ fatal (_("%P: %s: plugin error: %d\n"), curplug->name, rv);
3175 curplug = curplug->next;
3176 }
3177
3178@@ -1193,7 +1194,7 @@ plugin_strdup (bfd *abfd, const char *str)
3179 strlength = strlen (str) + 1;
3180 copy = bfd_alloc (abfd, strlength);
3181 if (copy == NULL)
3182- einfo (_("%F%P: plugin_strdup failed to allocate memory: %s\n"),
3183+ fatal (_("%P: plugin_strdup failed to allocate memory: %s\n"),
3184 bfd_get_error ());
3185 memcpy (copy, str, strlength);
3186 return copy;
3187@@ -1230,7 +1231,7 @@ plugin_object_p (bfd *ibfd, bool known_used)
3188
3189 input = bfd_alloc (abfd, sizeof (*input));
3190 if (input == NULL)
3191- einfo (_("%F%P: plugin failed to allocate memory for input: %s\n"),
3192+ fatal (_("%P: plugin failed to allocate memory for input: %s\n"),
3193 bfd_get_error ());
3194
3195 if (!bfd_plugin_open_input (ibfd, &file))
3196@@ -1258,7 +1259,7 @@ plugin_object_p (bfd *ibfd, bool known_used)
3197 claimed = 0;
3198
3199 if (plugin_call_claim_file (&file, &claimed, known_used))
3200- einfo (_("%F%P: %s: plugin reported error claiming file\n"),
3201+ fatal (_("%P: %s: plugin reported error claiming file\n"),
3202 plugin_error_plugin ());
3203
3204 if (input->fd != -1
3205--
32062.43.0
3207
diff --git a/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-1153-2.patch b/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-1153-2.patch
new file mode 100644
index 0000000000..2b473914b7
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0020-CVE-2025-1153-2.patch
@@ -0,0 +1,840 @@
1From 31e9e2e8d1090da0c1da97a70005d8841fff8ddd Mon Sep 17 00:00:00 2001
2From: Alan Modra <amodra@gmail.com>
3Date: Sun, 16 Feb 2025 23:34:55 +1030
4Subject: [PATCH] PR 32603, more ld -w misbehaviour
5
6Commit 8d97c1a53f3d claimed to replace all einfo calls using %F with
7a call to fatal. It did so only for the ld/ directory. This patch
8adds a "fatal" to linker callbacks, and replaces those calls in bfd/
9too.
10
11Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31e9e2e8d1090da0c1da97a70005d8841fff8ddd]
12CVE: CVE-2025-1153
13
14Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
15---
16 bfd/archive.c | 4 ++--
17 bfd/coff-aarch64.c | 4 +---
18 bfd/coffgen.c | 2 +-
19 bfd/elf-ifunc.c | 4 ++--
20 bfd/elf-m10300.c | 4 ++--
21 bfd/elf-properties.c | 4 ++--
22 bfd/elf.c | 4 ++--
23 bfd/elf32-arm.c | 2 +-
24 bfd/elf32-avr.c | 4 ++--
25 bfd/elf32-csky.c | 2 +-
26 bfd/elf32-frv.c | 4 ++--
27 bfd/elf32-hppa.c | 6 ++---
28 bfd/elf32-i386.c | 4 ++--
29 bfd/elf32-m68hc11.c | 2 +-
30 bfd/elf32-m68hc12.c | 2 +-
31 bfd/elf32-metag.c | 2 +-
32 bfd/elf32-spu.c | 5 ++--
33 bfd/elf64-ia64-vms.c | 4 ++--
34 bfd/elf64-ppc.c | 4 ++--
35 bfd/elf64-x86-64.c | 14 +++++------
36 bfd/elflink.c | 8 +++----
37 bfd/elfnn-aarch64.c | 6 ++---
38 bfd/elfnn-ia64.c | 4 ++--
39 bfd/elfnn-kvx.c | 2 +-
40 bfd/elfnn-loongarch.c | 4 ++--
41 bfd/elfxx-aarch64.c | 6 ++---
42 bfd/elfxx-sparc.c | 4 ++--
43 bfd/elfxx-x86.c | 56 +++++++++++++++++++++----------------------
44 bfd/linker.c | 2 +-
45 bfd/reloc.c | 4 ++--
46 bfd/reloc16.c | 4 ++--
47 bfd/xcofflink.c | 2 +-
48 include/bfdlink.h | 3 +++
49 ld/ldmain.c | 1 +
50 34 files changed, 94 insertions(+), 93 deletions(-)
51
52diff --git a/bfd/archive.c b/bfd/archive.c
53index 9f3fbce9..0f617276 100644
54--- a/bfd/archive.c
55+++ b/bfd/archive.c
56@@ -749,8 +749,8 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos,
57 case bfd_error_system_call:
58 if (info != NULL)
59 {
60- info->callbacks->einfo
61- (_("%F%P: %pB(%s): error opening thin archive member: %E\n"),
62+ info->callbacks->fatal
63+ (_("%P: %pB(%s): error opening thin archive member: %E\n"),
64 archive, filename);
65 break;
66 }
67diff --git a/bfd/coff-aarch64.c b/bfd/coff-aarch64.c
68index 825963c0..53f539e0 100644
69--- a/bfd/coff-aarch64.c
70+++ b/bfd/coff-aarch64.c
71@@ -876,10 +876,8 @@ coff_pe_aarch64_relocate_section (bfd *output_bfd,
72 }
73
74 default:
75- info->callbacks->einfo (_("%F%P: Unhandled relocation type %u\n"),
76+ info->callbacks->fatal (_("%P: Unhandled relocation type %u\n"),
77 rel->r_type);
78- BFD_FAIL ();
79- return false;
80 }
81 }
82
83diff --git a/bfd/coffgen.c b/bfd/coffgen.c
84index cc1c6557..3270cd2f 100644
85--- a/bfd/coffgen.c
86+++ b/bfd/coffgen.c
87@@ -2793,7 +2793,7 @@ _bfd_coff_section_already_linked (bfd *abfd,
88
89 /* This is the first section with this name. Record it. */
90 if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
91- info->callbacks->einfo (_("%F%P: already_linked_table: %E\n"));
92+ info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
93 return false;
94 }
95
96diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c
97index 42a3bcdf..58a1ca5e 100644
98--- a/bfd/elf-ifunc.c
99+++ b/bfd/elf-ifunc.c
100@@ -139,9 +139,9 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
101 || info->export_dynamic)
102 && h->pointer_equality_needed)
103 {
104- info->callbacks->einfo
105+ info->callbacks->fatal
106 /* xgettext:c-format */
107- (_("%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
108+ (_("%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
109 "equality in `%pB' can not be used when making an "
110 "executable; recompile with -fPIE and relink with -pie\n"),
111 h->root.root.string,
112diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
113index 24ea43a7..cf6bb13b 100644
114--- a/bfd/elf-m10300.c
115+++ b/bfd/elf-m10300.c
116@@ -2646,8 +2646,8 @@ mn10300_elf_relax_section (bfd *abfd,
117 bfd_vma align_gap_adjustment;
118
119 if (bfd_link_relocatable (link_info))
120- (*link_info->callbacks->einfo)
121- (_("%P%F: --relax and -r may not be used together\n"));
122+ link_info->callbacks->fatal
123+ (_("%P: --relax and -r may not be used together\n"));
124
125 /* Assume nothing changes. */
126 *again = false;
127diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c
128index ee8bd37f..a4591472 100644
129--- a/bfd/elf-properties.c
130+++ b/bfd/elf-properties.c
131@@ -665,11 +665,11 @@ _bfd_elf_link_setup_gnu_properties (struct bfd_link_info *info)
132 | SEC_HAS_CONTENTS
133 | SEC_DATA));
134 if (sec == NULL)
135- info->callbacks->einfo (_("%F%P: failed to create GNU property section\n"));
136+ info->callbacks->fatal (_("%P: failed to create GNU property section\n"));
137
138 if (!bfd_set_section_alignment (sec,
139 elfclass == ELFCLASS64 ? 3 : 2))
140- info->callbacks->einfo (_("%F%pA: failed to align section\n"),
141+ info->callbacks->fatal (_("%pA: failed to align section\n"),
142 sec);
143
144 elf_section_type (sec) = SHT_NOTE;
145diff --git a/bfd/elf.c b/bfd/elf.c
146index 8bffd3c5..8e4e1e7f 100644
147--- a/bfd/elf.c
148+++ b/bfd/elf.c
149@@ -5188,8 +5188,8 @@ _bfd_elf_map_sections_to_segments (bfd *abfd,
150 && need_layout != NULL
151 && bed->size_relative_relocs
152 && !bed->size_relative_relocs (info, need_layout))
153- info->callbacks->einfo
154- (_("%F%P: failed to size relative relocations\n"));
155+ info->callbacks->fatal
156+ (_("%P: failed to size relative relocations\n"));
157 }
158
159 if (no_user_phdrs && bfd_count_sections (abfd) != 0)
160diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
161index 4ad7c354..b4a822f1 100644
162--- a/bfd/elf32-arm.c
163+++ b/bfd/elf32-arm.c
164@@ -5053,7 +5053,7 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
165 section. The user should fix his linker script. */
166 if (stub_entry->target_section->output_section == NULL
167 && info->non_contiguous_regions)
168- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
169+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
170 "Retry without --enable-non-contiguous-regions.\n"),
171 stub_entry->target_section);
172
173diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
174index 20e03bd7..912f7533 100644
175--- a/bfd/elf32-avr.c
176+++ b/bfd/elf32-avr.c
177@@ -2484,8 +2484,8 @@ elf32_avr_relax_section (bfd *abfd,
178 shrinkable = false;
179
180 if (bfd_link_relocatable (link_info))
181- (*link_info->callbacks->einfo)
182- (_("%P%F: --relax and -r may not be used together\n"));
183+ link_info->callbacks->fatal
184+ (_("%P: --relax and -r may not be used together\n"));
185
186 htab = avr_link_hash_table (link_info);
187 if (htab == NULL)
188diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c
189index 9479705d..edff65a9 100644
190--- a/bfd/elf32-csky.c
191+++ b/bfd/elf32-csky.c
192@@ -3728,7 +3728,7 @@ csky_build_one_stub (struct bfd_hash_entry *gen_entry,
193 section. The user should fix his linker script. */
194 if (stub_entry->target_section->output_section == NULL
195 && info->non_contiguous_regions)
196- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
197+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
198 "Retry without --enable-non-contiguous-regions.\n"),
199 stub_entry->target_section);
200
201diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
202index 5b66b074..245db7c2 100644
203--- a/bfd/elf32-frv.c
204+++ b/bfd/elf32-frv.c
205@@ -5617,8 +5617,8 @@ elf32_frvfdpic_relax_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
206 struct _frvfdpic_dynamic_got_plt_info gpinfo;
207
208 if (bfd_link_relocatable (info))
209- (*info->callbacks->einfo)
210- (_("%P%F: --relax and -r may not be used together\n"));
211+ info->callbacks->fatal
212+ (_("%P: --relax and -r may not be used together\n"));
213
214 /* If we return early, we didn't change anything. */
215 *again = false;
216diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
217index c2a7ad98..f1e67a06 100644
218--- a/bfd/elf32-hppa.c
219+++ b/bfd/elf32-hppa.c
220@@ -729,7 +729,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
221 section. The user should fix his linker script. */
222 if (hsh->target_section->output_section == NULL
223 && info->non_contiguous_regions)
224- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output "
225+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
226 "section. Retry without "
227 "--enable-non-contiguous-regions.\n"),
228 hsh->target_section);
229@@ -758,7 +758,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
230 section. The user should fix his linker script. */
231 if (hsh->target_section->output_section == NULL
232 && info->non_contiguous_regions)
233- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output "
234+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
235 "section. Retry without "
236 "--enable-non-contiguous-regions.\n"),
237 hsh->target_section);
238@@ -839,7 +839,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
239 section. The user should fix his linker script. */
240 if (hsh->target_section->output_section == NULL
241 && info->non_contiguous_regions)
242- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output "
243+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
244 "section. Retry without "
245 "--enable-non-contiguous-regions.\n"),
246 hsh->target_section);
247diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
248index e2f88a11..1637e39f 100644
249--- a/bfd/elf32-i386.c
250+++ b/bfd/elf32-i386.c
251@@ -4092,8 +4092,8 @@ elf_i386_finish_dynamic_sections (bfd *output_bfd,
252 {
253 if (bfd_is_abs_section (htab->elf.splt->output_section))
254 {
255- info->callbacks->einfo
256- (_("%F%P: discarded output section: `%pA'\n"),
257+ info->callbacks->fatal
258+ (_("%P: discarded output section: `%pA'\n"),
259 htab->elf.splt);
260 return false;
261 }
262diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
263index 5fc611f5..6f705718 100644
264--- a/bfd/elf32-m68hc11.c
265+++ b/bfd/elf32-m68hc11.c
266@@ -419,7 +419,7 @@ m68hc11_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
267 section. The user should fix his linker script. */
268 if (stub_entry->target_section->output_section == NULL
269 && info->non_contiguous_regions)
270- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
271+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
272 "Retry without --enable-non-contiguous-regions.\n"),
273 stub_entry->target_section);
274
275diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
276index 1be174c0..bdfb9ca5 100644
277--- a/bfd/elf32-m68hc12.c
278+++ b/bfd/elf32-m68hc12.c
279@@ -539,7 +539,7 @@ m68hc12_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
280 section. The user should fix his linker script. */
281 if (stub_entry->target_section->output_section == NULL
282 && info->non_contiguous_regions)
283- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
284+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
285 "Retry without --enable-non-contiguous-regions.\n"),
286 stub_entry->target_section);
287
288diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c
289index de14dfe5..49f93cc7 100644
290--- a/bfd/elf32-metag.c
291+++ b/bfd/elf32-metag.c
292@@ -3342,7 +3342,7 @@ metag_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
293 section. The user should fix his linker script. */
294 if (hsh->target_section->output_section == NULL
295 && info->non_contiguous_regions)
296- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
297+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
298 "Retry without --enable-non-contiguous-regions.\n"),
299 hsh->target_section);
300
301diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
302index 881d4d8e..dd5d5fbe 100644
303--- a/bfd/elf32-spu.c
304+++ b/bfd/elf32-spu.c
305@@ -4689,8 +4689,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
306 file_err:
307 bfd_set_error (bfd_error_system_call);
308 err_exit:
309- info->callbacks->einfo (_("%F%P: auto overlay error: %E\n"));
310- xexit (1);
311+ info->callbacks->fatal (_("%P: auto overlay error: %E\n"));
312 }
313
314 /* Provide an estimate of total stack required. */
315@@ -4743,7 +4742,7 @@ spu_elf_final_link (bfd *output_bfd, struct bfd_link_info *info)
316 info->callbacks->einfo (_("%X%P: stack/lrlive analysis error: %E\n"));
317
318 if (!spu_elf_build_stubs (info))
319- info->callbacks->einfo (_("%F%P: can not build overlay stubs: %E\n"));
320+ info->callbacks->fatal (_("%P: can not build overlay stubs: %E\n"));
321
322 return bfd_elf_final_link (output_bfd, info);
323 }
324diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c
325index 2f37e90c..b1eaaac0 100644
326--- a/bfd/elf64-ia64-vms.c
327+++ b/bfd/elf64-ia64-vms.c
328@@ -361,8 +361,8 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec,
329 *again = false;
330
331 if (bfd_link_relocatable (link_info))
332- (*link_info->callbacks->einfo)
333- (_("%P%F: --relax and -r may not be used together\n"));
334+ link_info->callbacks->fatal
335+ (_("%P: --relax and -r may not be used together\n"));
336
337 /* Don't even try to relax for non-ELF outputs. */
338 if (!is_elf_hash_table (link_info->hash))
339diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
340index 720d6ac9..7b798732 100644
341--- a/bfd/elf64-ppc.c
342+++ b/bfd/elf64-ppc.c
343@@ -12289,7 +12289,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
344 if (stub_entry->target_section != NULL
345 && stub_entry->target_section->output_section == NULL
346 && info->non_contiguous_regions)
347- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
348+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
349 "Retry without --enable-non-contiguous-regions.\n"),
350 stub_entry->target_section);
351
352@@ -12297,7 +12297,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
353 if (stub_entry->group->stub_sec != NULL
354 && stub_entry->group->stub_sec->output_section == NULL
355 && info->non_contiguous_regions)
356- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
357+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
358 "Retry without --enable-non-contiguous-regions.\n"),
359 stub_entry->group->stub_sec);
360
361diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
362index c3fb375c..a22d57d7 100644
363--- a/bfd/elf64-x86-64.c
364+++ b/bfd/elf64-x86-64.c
365@@ -3706,8 +3706,8 @@ elf_x86_64_relocate_section (bfd *output_bfd,
366 || (roff - 3 + 22) > input_section->size)
367 {
368 corrupt_input:
369- info->callbacks->einfo
370- (_("%F%P: corrupt input: %pB\n"),
371+ info->callbacks->fatal
372+ (_("%P: corrupt input: %pB\n"),
373 input_bfd);
374 return false;
375 }
376@@ -4679,7 +4679,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
377 /* Check PC-relative offset overflow in PLT entry. */
378 if ((plt_got_pcrel_offset + 0x80000000) > 0xffffffff)
379 /* xgettext:c-format */
380- info->callbacks->einfo (_("%F%pB: PC-relative offset overflow in PLT entry for `%s'\n"),
381+ info->callbacks->fatal (_("%pB: PC-relative offset overflow in PLT entry for `%s'\n"),
382 output_bfd, h->root.root.string);
383
384 bfd_put_32 (output_bfd, plt_got_pcrel_offset,
385@@ -4752,7 +4752,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
386 will overflow first. */
387 if (plt0_offset > 0x80000000)
388 /* xgettext:c-format */
389- info->callbacks->einfo (_("%F%pB: branch displacement overflow in PLT entry for `%s'\n"),
390+ info->callbacks->fatal (_("%pB: branch displacement overflow in PLT entry for `%s'\n"),
391 output_bfd, h->root.root.string);
392 bfd_put_32 (output_bfd, - plt0_offset,
393 (plt->contents + h->plt.offset
394@@ -4805,7 +4805,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
395 if ((got_after_plt && got_pcrel_offset < 0)
396 || (!got_after_plt && got_pcrel_offset > 0))
397 /* xgettext:c-format */
398- info->callbacks->einfo (_("%F%pB: PC-relative offset overflow in GOT PLT entry for `%s'\n"),
399+ info->callbacks->fatal (_("%pB: PC-relative offset overflow in GOT PLT entry for `%s'\n"),
400 output_bfd, h->root.root.string);
401
402 bfd_put_32 (output_bfd, got_pcrel_offset,
403@@ -5092,8 +5092,8 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
404 {
405 if (bfd_is_abs_section (htab->elf.splt->output_section))
406 {
407- info->callbacks->einfo
408- (_("%F%P: discarded output section: `%pA'\n"),
409+ info->callbacks->fatal
410+ (_("%P: discarded output section: `%pA'\n"),
411 htab->elf.splt);
412 return false;
413 }
414diff --git a/bfd/elflink.c b/bfd/elflink.c
415index 8af6898a..dba176cc 100644
416--- a/bfd/elflink.c
417+++ b/bfd/elflink.c
418@@ -12891,8 +12891,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
419 if (info->enable_dt_relr
420 && bed->finish_relative_relocs
421 && !bed->finish_relative_relocs (info))
422- info->callbacks->einfo
423- (_("%F%P: %pB: failed to finish relative relocations\n"), abfd);
424+ info->callbacks->fatal
425+ (_("%P: %pB: failed to finish relative relocations\n"), abfd);
426
427 /* Since ELF permits relocations to be against local symbols, we
428 must have the local symbols available when we do the relocations.
429@@ -14087,7 +14087,7 @@ _bfd_elf_gc_mark_extra_sections (struct bfd_link_info *info,
430 else if (strcmp (bfd_section_name (isec),
431 "__patchable_function_entries") == 0
432 && elf_linked_to_section (isec) == NULL)
433- info->callbacks->einfo (_("%F%P: %pB(%pA): error: "
434+ info->callbacks->fatal (_("%P: %pB(%pA): error: "
435 "need linked-to section "
436 "for --gc-sections\n"),
437 isec->owner, isec);
438@@ -15264,7 +15264,7 @@ _bfd_elf_section_already_linked (bfd *abfd,
439
440 /* This is the first section with this name. Record it. */
441 if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
442- info->callbacks->einfo (_("%F%P: already_linked_table: %E\n"));
443+ info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
444 return sec->output_section == bfd_abs_section_ptr;
445 }
446
447diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
448index 109517db..0f454d23 100644
449--- a/bfd/elfnn-aarch64.c
450+++ b/bfd/elfnn-aarch64.c
451@@ -3272,7 +3272,7 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry,
452 section. The user should fix his linker script. */
453 if (stub_entry->target_section->output_section == NULL
454 && info->non_contiguous_regions)
455- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
456+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
457 "Retry without "
458 "--enable-non-contiguous-regions.\n"),
459 stub_entry->target_section);
460@@ -9008,9 +9008,9 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
461 asection *s = p->sec->output_section;
462 if (s != NULL && (s->flags & SEC_READONLY) != 0)
463 {
464- info->callbacks->einfo
465+ info->callbacks->fatal
466 /* xgettext:c-format */
467- (_ ("%F%P: %pB: copy relocation against non-copyable "
468+ (_ ("%P: %pB: copy relocation against non-copyable "
469 "protected symbol `%s'\n"),
470 p->sec->owner, h->root.root.string);
471 return false;
472diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
473index 7081ba1b..41d9e6fe 100644
474--- a/bfd/elfnn-ia64.c
475+++ b/bfd/elfnn-ia64.c
476@@ -361,8 +361,8 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec,
477 *again = false;
478
479 if (bfd_link_relocatable (link_info))
480- (*link_info->callbacks->einfo)
481- (_("%P%F: --relax and -r may not be used together\n"));
482+ link_info->callbacks->fatal
483+ (_("%P: --relax and -r may not be used together\n"));
484
485 /* Don't even try to relax for non-ELF outputs. */
486 if (!is_elf_hash_table (link_info->hash))
487diff --git a/bfd/elfnn-kvx.c b/bfd/elfnn-kvx.c
488index ae5ed6bf..b752891b 100644
489--- a/bfd/elfnn-kvx.c
490+++ b/bfd/elfnn-kvx.c
491@@ -927,7 +927,7 @@ kvx_build_one_stub (struct bfd_hash_entry *gen_entry,
492 section. The user should fix his linker script. */
493 if (stub_entry->target_section->output_section == NULL
494 && info->non_contiguous_regions)
495- info->callbacks->einfo (_("%F%P: Could not assign '%pA' to an output section. "
496+ info->callbacks->fatal (_("%P: Could not assign '%pA' to an output section. "
497 "Retry without "
498 "--enable-non-contiguous-regions.\n"),
499 stub_entry->target_section);
500diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
501index a7daea67..a8c4226d 100644
502--- a/bfd/elfnn-loongarch.c
503+++ b/bfd/elfnn-loongarch.c
504@@ -1445,9 +1445,9 @@ local_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
505 || info->export_dynamic)
506 && h->pointer_equality_needed)
507 {
508- info->callbacks->einfo
509+ info->callbacks->fatal
510 /* xgettext:c-format. */
511- (_("%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
512+ (_("%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
513 "equality in `%pB' can not be used when making an "
514 "executable; recompile with -fPIE and relink with -pie\n"),
515 h->root.root.string,
516diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
517index d1279adc..161c8a52 100644
518--- a/bfd/elfxx-aarch64.c
519+++ b/bfd/elfxx-aarch64.c
520@@ -754,12 +754,12 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
521 | SEC_HAS_CONTENTS
522 | SEC_DATA));
523 if (sec == NULL)
524- info->callbacks->einfo (
525- _("%F%P: failed to create GNU property section\n"));
526+ info->callbacks->fatal (
527+ _("%P: failed to create GNU property section\n"));
528
529 align = (bfd_get_mach (ebfd) & bfd_mach_aarch64_ilp32) ? 2 : 3;
530 if (!bfd_set_section_alignment (sec, align))
531- info->callbacks->einfo (_("%F%pA: failed to align section\n"),
532+ info->callbacks->fatal (_("%pA: failed to align section\n"),
533 sec);
534
535 elf_section_type (sec) = SHT_NOTE;
536diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
537index 6f5062bb..95b1928d 100644
538--- a/bfd/elfxx-sparc.c
539+++ b/bfd/elfxx-sparc.c
540@@ -2680,8 +2680,8 @@ _bfd_sparc_elf_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
541 bool *again)
542 {
543 if (bfd_link_relocatable (link_info))
544- (*link_info->callbacks->einfo)
545- (_("%P%F: --relax and -r may not be used together\n"));
546+ link_info->callbacks->fatal
547+ (_("%P: --relax and -r may not be used together\n"));
548
549 *again = false;
550 sec_do_relax (section) = 1;
551diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
552index 8c261cf8..606c8905 100644
553--- a/bfd/elfxx-x86.c
554+++ b/bfd/elfxx-x86.c
555@@ -531,9 +531,9 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
556 asection *s = p->sec->output_section;
557 if (s != NULL && (s->flags & SEC_READONLY) != 0)
558 {
559- info->callbacks->einfo
560+ info->callbacks->fatal
561 /* xgettext:c-format */
562- (_("%F%P: %pB: copy relocation against non-copyable "
563+ (_("%P: %pB: copy relocation against non-copyable "
564 "protected symbol `%s' in %pB\n"),
565 p->sec->owner, h->root.root.string,
566 h->root.u.def.section->owner);
567@@ -1030,9 +1030,9 @@ elf_x86_relative_reloc_record_add
568
569 if (relative_reloc->data == NULL)
570 {
571- info->callbacks->einfo
572+ info->callbacks->fatal
573 /* xgettext:c-format */
574- (_("%F%P: %pB: failed to allocate relative reloc record\n"),
575+ (_("%P: %pB: failed to allocate relative reloc record\n"),
576 info->output_bfd);
577 return false;
578 }
579@@ -1388,9 +1388,9 @@ elf64_dt_relr_bitmap_add
580
581 if (bitmap->u.elf64 == NULL)
582 {
583- info->callbacks->einfo
584+ info->callbacks->fatal
585 /* xgettext:c-format */
586- (_("%F%P: %pB: failed to allocate 64-bit DT_RELR bitmap\n"),
587+ (_("%P: %pB: failed to allocate 64-bit DT_RELR bitmap\n"),
588 info->output_bfd);
589 }
590
591@@ -1424,9 +1424,9 @@ elf32_dt_relr_bitmap_add
592
593 if (bitmap->u.elf32 == NULL)
594 {
595- info->callbacks->einfo
596+ info->callbacks->fatal
597 /* xgettext:c-format */
598- (_("%F%P: %pB: failed to allocate 32-bit DT_RELR bitmap\n"),
599+ (_("%P: %pB: failed to allocate 32-bit DT_RELR bitmap\n"),
600 info->output_bfd);
601 }
602
603@@ -1750,9 +1750,9 @@ elf_x86_compute_dl_relr_bitmap
604 *need_layout = true;
605 }
606 else
607- info->callbacks->einfo
608+ info->callbacks->fatal
609 /* xgettext:c-format */
610- (_("%F%P: %pB: size of compact relative reloc section is "
611+ (_("%P: %pB: size of compact relative reloc section is "
612 "changed: new (%lu) != old (%lu)\n"),
613 info->output_bfd, htab->dt_relr_bitmap.count,
614 dt_relr_bitmap_count);
615@@ -1772,9 +1772,9 @@ elf_x86_write_dl_relr_bitmap (struct bfd_link_info *info,
616
617 contents = (unsigned char *) bfd_alloc (sec->owner, size);
618 if (contents == NULL)
619- info->callbacks->einfo
620+ info->callbacks->fatal
621 /* xgettext:c-format */
622- (_("%F%P: %pB: failed to allocate compact relative reloc section\n"),
623+ (_("%P: %pB: failed to allocate compact relative reloc section\n"),
624 info->output_bfd);
625
626 /* Cache the section contents for elf_link_input_bfd. */
627@@ -2219,9 +2219,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
628 else
629 name = bfd_elf_sym_name (input_section->owner, symtab_hdr,
630 sym, NULL);
631- info->callbacks->einfo
632+ info->callbacks->fatal
633 /* xgettext:c-format */
634- (_("%F%P: %pB: relocation %s against absolute symbol "
635+ (_("%P: %pB: relocation %s against absolute symbol "
636 "`%s' in section `%pA' is disallowed\n"),
637 input_section->owner, internal_reloc.howto->name, name,
638 input_section);
639@@ -3429,9 +3429,9 @@ _bfd_x86_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
640 s = p->sec->output_section;
641 if (s != NULL && (s->flags & SEC_READONLY) != 0)
642 {
643- info->callbacks->einfo
644+ info->callbacks->fatal
645 /* xgettext:c-format */
646- (_("%F%P: %pB: copy relocation against non-copyable "
647+ (_("%P: %pB: copy relocation against non-copyable "
648 "protected symbol `%s' in %pB\n"),
649 p->sec->owner, h->root.root.string,
650 h->root.u.def.section->owner);
651@@ -4138,12 +4138,12 @@ _bfd_x86_elf_link_setup_gnu_properties
652 | SEC_HAS_CONTENTS
653 | SEC_DATA));
654 if (sec == NULL)
655- info->callbacks->einfo (_("%F%P: failed to create GNU property section\n"));
656+ info->callbacks->fatal (_("%P: failed to create GNU property section\n"));
657
658 if (!bfd_set_section_alignment (sec, class_align))
659 {
660 error_alignment:
661- info->callbacks->einfo (_("%F%pA: failed to align section\n"),
662+ info->callbacks->fatal (_("%pA: failed to align section\n"),
663 sec);
664 }
665
666@@ -4404,7 +4404,7 @@ _bfd_x86_elf_link_setup_gnu_properties
667 && !elf_vxworks_create_dynamic_sections (dynobj, info,
668 &htab->srelplt2))
669 {
670- info->callbacks->einfo (_("%F%P: failed to create VxWorks dynamic sections\n"));
671+ info->callbacks->fatal (_("%P: failed to create VxWorks dynamic sections\n"));
672 return pbfd;
673 }
674
675@@ -4413,7 +4413,7 @@ _bfd_x86_elf_link_setup_gnu_properties
676 don't need to do it in check_relocs. */
677 if (htab->elf.sgot == NULL
678 && !_bfd_elf_create_got_section (dynobj, info))
679- info->callbacks->einfo (_("%F%P: failed to create GOT sections\n"));
680+ info->callbacks->fatal (_("%P: failed to create GOT sections\n"));
681
682 got_align = (bed->target_id == X86_64_ELF_DATA) ? 3 : 2;
683
684@@ -4431,7 +4431,7 @@ _bfd_x86_elf_link_setup_gnu_properties
685 /* Create the ifunc sections here so that check_relocs can be
686 simplified. */
687 if (!_bfd_elf_create_ifunc_sections (dynobj, info))
688- info->callbacks->einfo (_("%F%P: failed to create ifunc sections\n"));
689+ info->callbacks->fatal (_("%P: failed to create ifunc sections\n"));
690
691 plt_alignment = bfd_log2 (htab->plt.plt_entry_size);
692
693@@ -4468,7 +4468,7 @@ _bfd_x86_elf_link_setup_gnu_properties
694 ".plt.got",
695 pltflags);
696 if (sec == NULL)
697- info->callbacks->einfo (_("%F%P: failed to create GOT PLT section\n"));
698+ info->callbacks->fatal (_("%P: failed to create GOT PLT section\n"));
699
700 if (!bfd_set_section_alignment (sec, non_lazy_plt_alignment))
701 goto error_alignment;
702@@ -4487,7 +4487,7 @@ _bfd_x86_elf_link_setup_gnu_properties
703 ".plt.sec",
704 pltflags);
705 if (sec == NULL)
706- info->callbacks->einfo (_("%F%P: failed to create IBT-enabled PLT section\n"));
707+ info->callbacks->fatal (_("%P: failed to create IBT-enabled PLT section\n"));
708
709 if (!bfd_set_section_alignment (sec, plt_alignment))
710 goto error_alignment;
711@@ -4507,7 +4507,7 @@ _bfd_x86_elf_link_setup_gnu_properties
712 ".eh_frame",
713 flags);
714 if (sec == NULL)
715- info->callbacks->einfo (_("%F%P: failed to create PLT .eh_frame section\n"));
716+ info->callbacks->fatal (_("%P: failed to create PLT .eh_frame section\n"));
717
718 if (!bfd_set_section_alignment (sec, class_align))
719 goto error_alignment;
720@@ -4520,7 +4520,7 @@ _bfd_x86_elf_link_setup_gnu_properties
721 ".eh_frame",
722 flags);
723 if (sec == NULL)
724- info->callbacks->einfo (_("%F%P: failed to create GOT PLT .eh_frame section\n"));
725+ info->callbacks->fatal (_("%P: failed to create GOT PLT .eh_frame section\n"));
726
727 if (!bfd_set_section_alignment (sec, class_align))
728 goto error_alignment;
729@@ -4534,7 +4534,7 @@ _bfd_x86_elf_link_setup_gnu_properties
730 ".eh_frame",
731 flags);
732 if (sec == NULL)
733- info->callbacks->einfo (_("%F%P: failed to create the second PLT .eh_frame section\n"));
734+ info->callbacks->fatal (_("%P: failed to create the second PLT .eh_frame section\n"));
735
736 if (!bfd_set_section_alignment (sec, class_align))
737 goto error_alignment;
738@@ -4554,7 +4554,7 @@ _bfd_x86_elf_link_setup_gnu_properties
739 ".sframe",
740 flags);
741 if (sec == NULL)
742- info->callbacks->einfo (_("%F%P: failed to create PLT .sframe section\n"));
743+ info->callbacks->fatal (_("%P: failed to create PLT .sframe section\n"));
744
745 // FIXME check this
746 // if (!bfd_set_section_alignment (sec, class_align))
747@@ -4569,7 +4569,7 @@ _bfd_x86_elf_link_setup_gnu_properties
748 ".sframe",
749 flags);
750 if (sec == NULL)
751- info->callbacks->einfo (_("%F%P: failed to create second PLT .sframe section\n"));
752+ info->callbacks->fatal (_("%P: failed to create second PLT .sframe section\n"));
753
754 htab->plt_second_sframe = sec;
755 }
756diff --git a/bfd/linker.c b/bfd/linker.c
757index 0821db55..5b912221 100644
758--- a/bfd/linker.c
759+++ b/bfd/linker.c
760@@ -2982,7 +2982,7 @@ _bfd_generic_section_already_linked (bfd *abfd ATTRIBUTE_UNUSED,
761
762 /* This is the first section with this name. Record it. */
763 if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
764- info->callbacks->einfo (_("%F%P: already_linked_table: %E\n"));
765+ info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
766 return false;
767 }
768
769diff --git a/bfd/reloc.c b/bfd/reloc.c
770index 7583b7fd..1fee86f1 100644
771--- a/bfd/reloc.c
772+++ b/bfd/reloc.c
773@@ -8465,8 +8465,8 @@ bfd_generic_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
774 bool *again)
775 {
776 if (bfd_link_relocatable (link_info))
777- (*link_info->callbacks->einfo)
778- (_("%P%F: --relax and -r may not be used together\n"));
779+ link_info->callbacks->fatal
780+ (_("%P: --relax and -r may not be used together\n"));
781
782 *again = false;
783 return true;
784diff --git a/bfd/reloc16.c b/bfd/reloc16.c
785index ff5412dc..a16d6b20 100644
786--- a/bfd/reloc16.c
787+++ b/bfd/reloc16.c
788@@ -151,8 +151,8 @@ bfd_coff_reloc16_relax_section (bfd *abfd,
789 long reloc_count;
790
791 if (bfd_link_relocatable (link_info))
792- (*link_info->callbacks->einfo)
793- (_("%P%F: --relax and -r may not be used together\n"));
794+ link_info->callbacks->fatal
795+ (_("%P: --relax and -r may not be used together\n"));
796
797 /* We only do global relaxation once. It is not safe to do it multiple
798 times (see discussion of the "shrinks" array below). */
799diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
800index 6ef9abcd..9b01cc37 100644
801--- a/bfd/xcofflink.c
802+++ b/bfd/xcofflink.c
803@@ -4681,7 +4681,7 @@ xcoff_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
804 if (hstub->target_section != NULL
805 && hstub->target_section->output_section == NULL
806 && info->non_contiguous_regions)
807- info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
808+ info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
809 "Retry without --enable-non-contiguous-regions.\n"),
810 hstub->target_section);
811
812diff --git a/include/bfdlink.h b/include/bfdlink.h
813index eac07d78..0d03fa70 100644
814--- a/include/bfdlink.h
815+++ b/include/bfdlink.h
816@@ -868,6 +868,9 @@ struct bfd_link_callbacks
817 (struct bfd_link_info *, struct bfd_link_hash_entry *h,
818 struct bfd_link_hash_entry *inh,
819 bfd *abfd, asection *section, bfd_vma address, flagword flags);
820+ /* Fatal error. */
821+ void (*fatal)
822+ (const char *fmt, ...) ATTRIBUTE_NORETURN;
823 /* Error or warning link info message. */
824 void (*einfo)
825 (const char *fmt, ...);
826diff --git a/ld/ldmain.c b/ld/ldmain.c
827index 878d9536..a61086c3 100644
828--- a/ld/ldmain.c
829+++ b/ld/ldmain.c
830@@ -146,6 +146,7 @@ static struct bfd_link_callbacks link_callbacks =
831 reloc_dangerous,
832 unattached_reloc,
833 notice,
834+ fatal,
835 einfo,
836 info_msg,
837 minfo,
838--
8392.43.0
840
diff --git a/meta/recipes-devtools/binutils/binutils/0021-CVE-2025-1153-3.patch b/meta/recipes-devtools/binutils/binutils/0021-CVE-2025-1153-3.patch
new file mode 100644
index 0000000000..8aef77d2f8
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0021-CVE-2025-1153-3.patch
@@ -0,0 +1,3756 @@
1From fe459e33c676883b5f28cc96c00e242973d906a9 Mon Sep 17 00:00:00 2001
2From: Alan Modra <amodra@gmail.com>
3Date: Thu, 24 Apr 2025 10:01:29 +0930
4Subject: [PATCH] PR 32603, revert message changes
5
6This puts back %F into translated fatal error messages
7(and reverts a few other small changes), to not disturb
8translation work
9
10Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fe459e33c676883b5f28cc96c00e242973d906a9]
11CVE: CVE-2025-1153
12
13Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
14---
15 bfd/archive.c | 2 +-
16 bfd/coff-aarch64.c | 2 +-
17 bfd/coffgen.c | 2 +-
18 bfd/elf-ifunc.c | 2 +-
19 bfd/elf-m10300.c | 2 +-
20 bfd/elf-properties.c | 4 +-
21 bfd/elf.c | 2 +-
22 bfd/elf32-arm.c | 2 +-
23 bfd/elf32-avr.c | 2 +-
24 bfd/elf32-csky.c | 2 +-
25 bfd/elf32-frv.c | 2 +-
26 bfd/elf32-hppa.c | 6 +--
27 bfd/elf32-i386.c | 2 +-
28 bfd/elf32-m68hc11.c | 2 +-
29 bfd/elf32-m68hc12.c | 2 +-
30 bfd/elf32-metag.c | 2 +-
31 bfd/elf32-spu.c | 4 +-
32 bfd/elf64-ia64-vms.c | 2 +-
33 bfd/elf64-ppc.c | 4 +-
34 bfd/elf64-x86-64.c | 10 ++---
35 bfd/elflink.c | 6 +--
36 bfd/elfnn-aarch64.c | 4 +-
37 bfd/elfnn-ia64.c | 2 +-
38 bfd/elfnn-kvx.c | 2 +-
39 bfd/elfnn-loongarch.c | 2 +-
40 bfd/elfxx-aarch64.c | 4 +-
41 bfd/elfxx-sparc.c | 2 +-
42 bfd/elfxx-x86.c | 42 +++++++++---------
43 bfd/linker.c | 2 +-
44 bfd/reloc.c | 2 +-
45 bfd/reloc16.c | 2 +-
46 bfd/xcofflink.c | 2 +-
47 ld/emulparams/call_nop.sh | 6 +--
48 ld/emulparams/cet.sh | 2 +-
49 ld/emulparams/elf32mcore.sh | 2 +-
50 ld/emulparams/x86-64-lam.sh | 6 +--
51 ld/emulparams/x86-64-level.sh | 2 +-
52 ld/emultempl/aarch64elf.em | 6 +--
53 ld/emultempl/aix.em | 41 +++++++++---------
54 ld/emultempl/armelf.em | 10 ++---
55 ld/emultempl/avrelf.em | 2 +-
56 ld/emultempl/beos.em | 18 ++++----
57 ld/emultempl/cr16elf.em | 4 +-
58 ld/emultempl/cskyelf.em | 4 +-
59 ld/emultempl/elf.em | 14 +++---
60 ld/emultempl/hppaelf.em | 4 +-
61 ld/emultempl/kvxelf.em | 4 +-
62 ld/emultempl/loongarchelf.em | 2 +-
63 ld/emultempl/m68hc1xelf.em | 2 +-
64 ld/emultempl/m68kelf.em | 4 +-
65 ld/emultempl/metagelf.em | 4 +-
66 ld/emultempl/mipself.em | 2 +-
67 ld/emultempl/mmix-elfnmmo.em | 2 +-
68 ld/emultempl/nds32elf.em | 6 +--
69 ld/emultempl/nto.em | 10 ++---
70 ld/emultempl/pe.em | 20 ++++-----
71 ld/emultempl/pep.em | 16 +++----
72 ld/emultempl/ppc32elf.em | 4 +-
73 ld/emultempl/ppc64elf.em | 10 ++---
74 ld/emultempl/riscvelf.em | 2 +-
75 ld/emultempl/s390.em | 2 +-
76 ld/emultempl/scoreelf.em | 2 +-
77 ld/emultempl/spuelf.em | 20 ++++-----
78 ld/emultempl/tic6xdsbt.em | 6 +--
79 ld/emultempl/ticoff.em | 2 +-
80 ld/emultempl/v850elf.em | 2 +-
81 ld/emultempl/vms.em | 2 +-
82 ld/emultempl/xtensaelf.em | 12 ++---
83 ld/emultempl/z80.em | 2 +-
84 ld/ldcref.c | 8 ++--
85 ld/ldelf.c | 30 ++++++-------
86 ld/ldelfgen.c | 14 +++---
87 ld/ldexp.c | 42 +++++++++---------
88 ld/ldfile.c | 14 +++---
89 ld/ldgram.y | 6 +--
90 ld/ldlang.c | 82 +++++++++++++++++------------------
91 ld/ldlex.l | 10 ++---
92 ld/ldmain.c | 44 +++++++++----------
93 ld/ldmisc.c | 6 +--
94 ld/ldwrite.c | 18 ++++----
95 ld/lexsup.c | 64 +++++++++++++--------------
96 ld/mri.c | 2 +-
97 ld/pe-dll.c | 12 ++---
98 ld/plugin.c | 27 ++++++------
99 84 files changed, 384 insertions(+), 384 deletions(-)
100
101diff --git a/bfd/archive.c b/bfd/archive.c
102index 0f617276..0596a304 100644
103--- a/bfd/archive.c
104+++ b/bfd/archive.c
105@@ -750,7 +750,7 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos,
106 if (info != NULL)
107 {
108 info->callbacks->fatal
109- (_("%P: %pB(%s): error opening thin archive member: %E\n"),
110+ (_("%F%P: %pB(%s): error opening thin archive member: %E\n"),
111 archive, filename);
112 break;
113 }
114diff --git a/bfd/coff-aarch64.c b/bfd/coff-aarch64.c
115index 53f539e0..06007e6d 100644
116--- a/bfd/coff-aarch64.c
117+++ b/bfd/coff-aarch64.c
118@@ -876,7 +876,7 @@ coff_pe_aarch64_relocate_section (bfd *output_bfd,
119 }
120
121 default:
122- info->callbacks->fatal (_("%P: Unhandled relocation type %u\n"),
123+ info->callbacks->fatal (_("%F%P: Unhandled relocation type %u\n"),
124 rel->r_type);
125 }
126 }
127diff --git a/bfd/coffgen.c b/bfd/coffgen.c
128index 3270cd2f..5e24210d 100644
129--- a/bfd/coffgen.c
130+++ b/bfd/coffgen.c
131@@ -2793,7 +2793,7 @@ _bfd_coff_section_already_linked (bfd *abfd,
132
133 /* This is the first section with this name. Record it. */
134 if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
135- info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
136+ info->callbacks->fatal (_("%F%P: already_linked_table: %E\n"));
137 return false;
138 }
139
140diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c
141index 58a1ca5e..cb623563 100644
142--- a/bfd/elf-ifunc.c
143+++ b/bfd/elf-ifunc.c
144@@ -141,7 +141,7 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
145 {
146 info->callbacks->fatal
147 /* xgettext:c-format */
148- (_("%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
149+ (_("%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
150 "equality in `%pB' can not be used when making an "
151 "executable; recompile with -fPIE and relink with -pie\n"),
152 h->root.root.string,
153diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
154index cf6bb13b..129485fa 100644
155--- a/bfd/elf-m10300.c
156+++ b/bfd/elf-m10300.c
157@@ -2647,7 +2647,7 @@ mn10300_elf_relax_section (bfd *abfd,
158
159 if (bfd_link_relocatable (link_info))
160 link_info->callbacks->fatal
161- (_("%P: --relax and -r may not be used together\n"));
162+ (_("%P%F: --relax and -r may not be used together\n"));
163
164 /* Assume nothing changes. */
165 *again = false;
166diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c
167index a4591472..2e8cc8af 100644
168--- a/bfd/elf-properties.c
169+++ b/bfd/elf-properties.c
170@@ -665,11 +665,11 @@ _bfd_elf_link_setup_gnu_properties (struct bfd_link_info *info)
171 | SEC_HAS_CONTENTS
172 | SEC_DATA));
173 if (sec == NULL)
174- info->callbacks->fatal (_("%P: failed to create GNU property section\n"));
175+ info->callbacks->fatal (_("%F%P: failed to create GNU property section\n"));
176
177 if (!bfd_set_section_alignment (sec,
178 elfclass == ELFCLASS64 ? 3 : 2))
179- info->callbacks->fatal (_("%pA: failed to align section\n"),
180+ info->callbacks->fatal (_("%F%pA: failed to align section\n"),
181 sec);
182
183 elf_section_type (sec) = SHT_NOTE;
184diff --git a/bfd/elf.c b/bfd/elf.c
185index 8e4e1e7f..883aef5e 100644
186--- a/bfd/elf.c
187+++ b/bfd/elf.c
188@@ -5189,7 +5189,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd,
189 && bed->size_relative_relocs
190 && !bed->size_relative_relocs (info, need_layout))
191 info->callbacks->fatal
192- (_("%P: failed to size relative relocations\n"));
193+ (_("%F%P: failed to size relative relocations\n"));
194 }
195
196 if (no_user_phdrs && bfd_count_sections (abfd) != 0)
197diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
198index b4a822f1..bb413bb9 100644
199--- a/bfd/elf32-arm.c
200+++ b/bfd/elf32-arm.c
201@@ -5053,7 +5053,7 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
202 section. The user should fix his linker script. */
203 if (stub_entry->target_section->output_section == NULL
204 && info->non_contiguous_regions)
205- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
206+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
207 "Retry without --enable-non-contiguous-regions.\n"),
208 stub_entry->target_section);
209
210diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
211index 912f7533..fd9f18dd 100644
212--- a/bfd/elf32-avr.c
213+++ b/bfd/elf32-avr.c
214@@ -2485,7 +2485,7 @@ elf32_avr_relax_section (bfd *abfd,
215
216 if (bfd_link_relocatable (link_info))
217 link_info->callbacks->fatal
218- (_("%P: --relax and -r may not be used together\n"));
219+ (_("%P%F: --relax and -r may not be used together\n"));
220
221 htab = avr_link_hash_table (link_info);
222 if (htab == NULL)
223diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c
224index edff65a9..3ec0622e 100644
225--- a/bfd/elf32-csky.c
226+++ b/bfd/elf32-csky.c
227@@ -3728,7 +3728,7 @@ csky_build_one_stub (struct bfd_hash_entry *gen_entry,
228 section. The user should fix his linker script. */
229 if (stub_entry->target_section->output_section == NULL
230 && info->non_contiguous_regions)
231- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
232+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
233 "Retry without --enable-non-contiguous-regions.\n"),
234 stub_entry->target_section);
235
236diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
237index 245db7c2..cac2663e 100644
238--- a/bfd/elf32-frv.c
239+++ b/bfd/elf32-frv.c
240@@ -5618,7 +5618,7 @@ elf32_frvfdpic_relax_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
241
242 if (bfd_link_relocatable (info))
243 info->callbacks->fatal
244- (_("%P: --relax and -r may not be used together\n"));
245+ (_("%P%F: --relax and -r may not be used together\n"));
246
247 /* If we return early, we didn't change anything. */
248 *again = false;
249diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
250index f1e67a06..0d0682de 100644
251--- a/bfd/elf32-hppa.c
252+++ b/bfd/elf32-hppa.c
253@@ -729,7 +729,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
254 section. The user should fix his linker script. */
255 if (hsh->target_section->output_section == NULL
256 && info->non_contiguous_regions)
257- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
258+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output "
259 "section. Retry without "
260 "--enable-non-contiguous-regions.\n"),
261 hsh->target_section);
262@@ -758,7 +758,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
263 section. The user should fix his linker script. */
264 if (hsh->target_section->output_section == NULL
265 && info->non_contiguous_regions)
266- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
267+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output "
268 "section. Retry without "
269 "--enable-non-contiguous-regions.\n"),
270 hsh->target_section);
271@@ -839,7 +839,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
272 section. The user should fix his linker script. */
273 if (hsh->target_section->output_section == NULL
274 && info->non_contiguous_regions)
275- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
276+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output "
277 "section. Retry without "
278 "--enable-non-contiguous-regions.\n"),
279 hsh->target_section);
280diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
281index 1637e39f..42b96134 100644
282--- a/bfd/elf32-i386.c
283+++ b/bfd/elf32-i386.c
284@@ -4093,7 +4093,7 @@ elf_i386_finish_dynamic_sections (bfd *output_bfd,
285 if (bfd_is_abs_section (htab->elf.splt->output_section))
286 {
287 info->callbacks->fatal
288- (_("%P: discarded output section: `%pA'\n"),
289+ (_("%F%P: discarded output section: `%pA'\n"),
290 htab->elf.splt);
291 return false;
292 }
293diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
294index 6f705718..4b127ac7 100644
295--- a/bfd/elf32-m68hc11.c
296+++ b/bfd/elf32-m68hc11.c
297@@ -419,7 +419,7 @@ m68hc11_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
298 section. The user should fix his linker script. */
299 if (stub_entry->target_section->output_section == NULL
300 && info->non_contiguous_regions)
301- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
302+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
303 "Retry without --enable-non-contiguous-regions.\n"),
304 stub_entry->target_section);
305
306diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
307index bdfb9ca5..9a2f4638 100644
308--- a/bfd/elf32-m68hc12.c
309+++ b/bfd/elf32-m68hc12.c
310@@ -539,7 +539,7 @@ m68hc12_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
311 section. The user should fix his linker script. */
312 if (stub_entry->target_section->output_section == NULL
313 && info->non_contiguous_regions)
314- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
315+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
316 "Retry without --enable-non-contiguous-regions.\n"),
317 stub_entry->target_section);
318
319diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c
320index 49f93cc7..94be520e 100644
321--- a/bfd/elf32-metag.c
322+++ b/bfd/elf32-metag.c
323@@ -3342,7 +3342,7 @@ metag_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
324 section. The user should fix his linker script. */
325 if (hsh->target_section->output_section == NULL
326 && info->non_contiguous_regions)
327- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
328+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
329 "Retry without --enable-non-contiguous-regions.\n"),
330 hsh->target_section);
331
332diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
333index dd5d5fbe..c535b1f1 100644
334--- a/bfd/elf32-spu.c
335+++ b/bfd/elf32-spu.c
336@@ -4689,7 +4689,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
337 file_err:
338 bfd_set_error (bfd_error_system_call);
339 err_exit:
340- info->callbacks->fatal (_("%P: auto overlay error: %E\n"));
341+ info->callbacks->fatal (_("%F%P: auto overlay error: %E\n"));
342 }
343
344 /* Provide an estimate of total stack required. */
345@@ -4742,7 +4742,7 @@ spu_elf_final_link (bfd *output_bfd, struct bfd_link_info *info)
346 info->callbacks->einfo (_("%X%P: stack/lrlive analysis error: %E\n"));
347
348 if (!spu_elf_build_stubs (info))
349- info->callbacks->fatal (_("%P: can not build overlay stubs: %E\n"));
350+ info->callbacks->fatal (_("%F%P: can not build overlay stubs: %E\n"));
351
352 return bfd_elf_final_link (output_bfd, info);
353 }
354diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c
355index b1eaaac0..3c29e0d6 100644
356--- a/bfd/elf64-ia64-vms.c
357+++ b/bfd/elf64-ia64-vms.c
358@@ -362,7 +362,7 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec,
359
360 if (bfd_link_relocatable (link_info))
361 link_info->callbacks->fatal
362- (_("%P: --relax and -r may not be used together\n"));
363+ (_("%P%F: --relax and -r may not be used together\n"));
364
365 /* Don't even try to relax for non-ELF outputs. */
366 if (!is_elf_hash_table (link_info->hash))
367diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
368index 7b798732..68d681a5 100644
369--- a/bfd/elf64-ppc.c
370+++ b/bfd/elf64-ppc.c
371@@ -12289,7 +12289,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
372 if (stub_entry->target_section != NULL
373 && stub_entry->target_section->output_section == NULL
374 && info->non_contiguous_regions)
375- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
376+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
377 "Retry without --enable-non-contiguous-regions.\n"),
378 stub_entry->target_section);
379
380@@ -12297,7 +12297,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
381 if (stub_entry->group->stub_sec != NULL
382 && stub_entry->group->stub_sec->output_section == NULL
383 && info->non_contiguous_regions)
384- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
385+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
386 "Retry without --enable-non-contiguous-regions.\n"),
387 stub_entry->group->stub_sec);
388
389diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
390index a22d57d7..41341cd8 100644
391--- a/bfd/elf64-x86-64.c
392+++ b/bfd/elf64-x86-64.c
393@@ -3707,7 +3707,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
394 {
395 corrupt_input:
396 info->callbacks->fatal
397- (_("%P: corrupt input: %pB\n"),
398+ (_("%F%P: corrupt input: %pB\n"),
399 input_bfd);
400 return false;
401 }
402@@ -4679,7 +4679,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
403 /* Check PC-relative offset overflow in PLT entry. */
404 if ((plt_got_pcrel_offset + 0x80000000) > 0xffffffff)
405 /* xgettext:c-format */
406- info->callbacks->fatal (_("%pB: PC-relative offset overflow in PLT entry for `%s'\n"),
407+ info->callbacks->fatal (_("%F%pB: PC-relative offset overflow in PLT entry for `%s'\n"),
408 output_bfd, h->root.root.string);
409
410 bfd_put_32 (output_bfd, plt_got_pcrel_offset,
411@@ -4752,7 +4752,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
412 will overflow first. */
413 if (plt0_offset > 0x80000000)
414 /* xgettext:c-format */
415- info->callbacks->fatal (_("%pB: branch displacement overflow in PLT entry for `%s'\n"),
416+ info->callbacks->fatal (_("%F%pB: branch displacement overflow in PLT entry for `%s'\n"),
417 output_bfd, h->root.root.string);
418 bfd_put_32 (output_bfd, - plt0_offset,
419 (plt->contents + h->plt.offset
420@@ -4805,7 +4805,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
421 if ((got_after_plt && got_pcrel_offset < 0)
422 || (!got_after_plt && got_pcrel_offset > 0))
423 /* xgettext:c-format */
424- info->callbacks->fatal (_("%pB: PC-relative offset overflow in GOT PLT entry for `%s'\n"),
425+ info->callbacks->fatal (_("%F%pB: PC-relative offset overflow in GOT PLT entry for `%s'\n"),
426 output_bfd, h->root.root.string);
427
428 bfd_put_32 (output_bfd, got_pcrel_offset,
429@@ -5093,7 +5093,7 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
430 if (bfd_is_abs_section (htab->elf.splt->output_section))
431 {
432 info->callbacks->fatal
433- (_("%P: discarded output section: `%pA'\n"),
434+ (_("%F%P: discarded output section: `%pA'\n"),
435 htab->elf.splt);
436 return false;
437 }
438diff --git a/bfd/elflink.c b/bfd/elflink.c
439index dba176cc..0c3ea0a3 100644
440--- a/bfd/elflink.c
441+++ b/bfd/elflink.c
442@@ -12892,7 +12892,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
443 && bed->finish_relative_relocs
444 && !bed->finish_relative_relocs (info))
445 info->callbacks->fatal
446- (_("%P: %pB: failed to finish relative relocations\n"), abfd);
447+ (_("%F%P: %pB: failed to finish relative relocations\n"), abfd);
448
449 /* Since ELF permits relocations to be against local symbols, we
450 must have the local symbols available when we do the relocations.
451@@ -14087,7 +14087,7 @@ _bfd_elf_gc_mark_extra_sections (struct bfd_link_info *info,
452 else if (strcmp (bfd_section_name (isec),
453 "__patchable_function_entries") == 0
454 && elf_linked_to_section (isec) == NULL)
455- info->callbacks->fatal (_("%P: %pB(%pA): error: "
456+ info->callbacks->fatal (_("%F%P: %pB(%pA): error: "
457 "need linked-to section "
458 "for --gc-sections\n"),
459 isec->owner, isec);
460@@ -15264,7 +15264,7 @@ _bfd_elf_section_already_linked (bfd *abfd,
461
462 /* This is the first section with this name. Record it. */
463 if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
464- info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
465+ info->callbacks->fatal (_("%F%P: already_linked_table: %E\n"));
466 return sec->output_section == bfd_abs_section_ptr;
467 }
468
469diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
470index 0f454d23..d7a85ef0 100644
471--- a/bfd/elfnn-aarch64.c
472+++ b/bfd/elfnn-aarch64.c
473@@ -3272,7 +3272,7 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry,
474 section. The user should fix his linker script. */
475 if (stub_entry->target_section->output_section == NULL
476 && info->non_contiguous_regions)
477- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
478+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
479 "Retry without "
480 "--enable-non-contiguous-regions.\n"),
481 stub_entry->target_section);
482@@ -9010,7 +9010,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
483 {
484 info->callbacks->fatal
485 /* xgettext:c-format */
486- (_ ("%P: %pB: copy relocation against non-copyable "
487+ (_ ("%F%P: %pB: copy relocation against non-copyable "
488 "protected symbol `%s'\n"),
489 p->sec->owner, h->root.root.string);
490 return false;
491diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
492index 41d9e6fe..8d576c81 100644
493--- a/bfd/elfnn-ia64.c
494+++ b/bfd/elfnn-ia64.c
495@@ -362,7 +362,7 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec,
496
497 if (bfd_link_relocatable (link_info))
498 link_info->callbacks->fatal
499- (_("%P: --relax and -r may not be used together\n"));
500+ (_("%P%F: --relax and -r may not be used together\n"));
501
502 /* Don't even try to relax for non-ELF outputs. */
503 if (!is_elf_hash_table (link_info->hash))
504diff --git a/bfd/elfnn-kvx.c b/bfd/elfnn-kvx.c
505index b752891b..9bbbc929 100644
506--- a/bfd/elfnn-kvx.c
507+++ b/bfd/elfnn-kvx.c
508@@ -927,7 +927,7 @@ kvx_build_one_stub (struct bfd_hash_entry *gen_entry,
509 section. The user should fix his linker script. */
510 if (stub_entry->target_section->output_section == NULL
511 && info->non_contiguous_regions)
512- info->callbacks->fatal (_("%P: Could not assign '%pA' to an output section. "
513+ info->callbacks->fatal (_("%F%P: Could not assign '%pA' to an output section. "
514 "Retry without "
515 "--enable-non-contiguous-regions.\n"),
516 stub_entry->target_section);
517diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
518index a8c4226d..12ee56a9 100644
519--- a/bfd/elfnn-loongarch.c
520+++ b/bfd/elfnn-loongarch.c
521@@ -1447,7 +1447,7 @@ local_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
522 {
523 info->callbacks->fatal
524 /* xgettext:c-format. */
525- (_("%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
526+ (_("%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
527 "equality in `%pB' can not be used when making an "
528 "executable; recompile with -fPIE and relink with -pie\n"),
529 h->root.root.string,
530diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
531index 161c8a52..2aa7dd54 100644
532--- a/bfd/elfxx-aarch64.c
533+++ b/bfd/elfxx-aarch64.c
534@@ -755,11 +755,11 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
535 | SEC_DATA));
536 if (sec == NULL)
537 info->callbacks->fatal (
538- _("%P: failed to create GNU property section\n"));
539+ _("%F%P: failed to create GNU property section\n"));
540
541 align = (bfd_get_mach (ebfd) & bfd_mach_aarch64_ilp32) ? 2 : 3;
542 if (!bfd_set_section_alignment (sec, align))
543- info->callbacks->fatal (_("%pA: failed to align section\n"),
544+ info->callbacks->fatal (_("%F%pA: failed to align section\n"),
545 sec);
546
547 elf_section_type (sec) = SHT_NOTE;
548diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
549index 95b1928d..76057d3b 100644
550--- a/bfd/elfxx-sparc.c
551+++ b/bfd/elfxx-sparc.c
552@@ -2681,7 +2681,7 @@ _bfd_sparc_elf_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
553 {
554 if (bfd_link_relocatable (link_info))
555 link_info->callbacks->fatal
556- (_("%P: --relax and -r may not be used together\n"));
557+ (_("%P%F: --relax and -r may not be used together\n"));
558
559 *again = false;
560 sec_do_relax (section) = 1;
561diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
562index 606c8905..803d6a54 100644
563--- a/bfd/elfxx-x86.c
564+++ b/bfd/elfxx-x86.c
565@@ -533,7 +533,7 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
566 {
567 info->callbacks->fatal
568 /* xgettext:c-format */
569- (_("%P: %pB: copy relocation against non-copyable "
570+ (_("%F%P: %pB: copy relocation against non-copyable "
571 "protected symbol `%s' in %pB\n"),
572 p->sec->owner, h->root.root.string,
573 h->root.u.def.section->owner);
574@@ -1032,7 +1032,7 @@ elf_x86_relative_reloc_record_add
575 {
576 info->callbacks->fatal
577 /* xgettext:c-format */
578- (_("%P: %pB: failed to allocate relative reloc record\n"),
579+ (_("%F%P: %pB: failed to allocate relative reloc record\n"),
580 info->output_bfd);
581 return false;
582 }
583@@ -1390,7 +1390,7 @@ elf64_dt_relr_bitmap_add
584 {
585 info->callbacks->fatal
586 /* xgettext:c-format */
587- (_("%P: %pB: failed to allocate 64-bit DT_RELR bitmap\n"),
588+ (_("%F%P: %pB: failed to allocate 64-bit DT_RELR bitmap\n"),
589 info->output_bfd);
590 }
591
592@@ -1426,7 +1426,7 @@ elf32_dt_relr_bitmap_add
593 {
594 info->callbacks->fatal
595 /* xgettext:c-format */
596- (_("%P: %pB: failed to allocate 32-bit DT_RELR bitmap\n"),
597+ (_("%F%P: %pB: failed to allocate 32-bit DT_RELR bitmap\n"),
598 info->output_bfd);
599 }
600
601@@ -1563,7 +1563,7 @@ elf_x86_size_or_finish_relative_reloc
602 if (!bfd_malloc_and_get_section (sec->owner,
603 sec,
604 &contents))
605- info->callbacks->einfo
606+ info->callbacks->fatal
607 /* xgettext:c-format */
608 (_("%F%P: %pB: failed to allocate memory for section `%pA'\n"),
609 info->output_bfd, sec);
610@@ -1752,7 +1752,7 @@ elf_x86_compute_dl_relr_bitmap
611 else
612 info->callbacks->fatal
613 /* xgettext:c-format */
614- (_("%P: %pB: size of compact relative reloc section is "
615+ (_("%F%P: %pB: size of compact relative reloc section is "
616 "changed: new (%lu) != old (%lu)\n"),
617 info->output_bfd, htab->dt_relr_bitmap.count,
618 dt_relr_bitmap_count);
619@@ -1774,7 +1774,7 @@ elf_x86_write_dl_relr_bitmap (struct bfd_link_info *info,
620 if (contents == NULL)
621 info->callbacks->fatal
622 /* xgettext:c-format */
623- (_("%P: %pB: failed to allocate compact relative reloc section\n"),
624+ (_("%F%P: %pB: failed to allocate compact relative reloc section\n"),
625 info->output_bfd);
626
627 /* Cache the section contents for elf_link_input_bfd. */
628@@ -2221,7 +2221,7 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
629 sym, NULL);
630 info->callbacks->fatal
631 /* xgettext:c-format */
632- (_("%P: %pB: relocation %s against absolute symbol "
633+ (_("%F%P: %pB: relocation %s against absolute symbol "
634 "`%s' in section `%pA' is disallowed\n"),
635 input_section->owner, internal_reloc.howto->name, name,
636 input_section);
637@@ -3431,7 +3431,7 @@ _bfd_x86_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
638 {
639 info->callbacks->fatal
640 /* xgettext:c-format */
641- (_("%P: %pB: copy relocation against non-copyable "
642+ (_("%F%P: %pB: copy relocation against non-copyable "
643 "protected symbol `%s' in %pB\n"),
644 p->sec->owner, h->root.root.string,
645 h->root.u.def.section->owner);
646@@ -4138,12 +4138,12 @@ _bfd_x86_elf_link_setup_gnu_properties
647 | SEC_HAS_CONTENTS
648 | SEC_DATA));
649 if (sec == NULL)
650- info->callbacks->fatal (_("%P: failed to create GNU property section\n"));
651+ info->callbacks->fatal (_("%F%P: failed to create GNU property section\n"));
652
653 if (!bfd_set_section_alignment (sec, class_align))
654 {
655 error_alignment:
656- info->callbacks->fatal (_("%pA: failed to align section\n"),
657+ info->callbacks->fatal (_("%F%pA: failed to align section\n"),
658 sec);
659 }
660
661@@ -4404,7 +4404,7 @@ _bfd_x86_elf_link_setup_gnu_properties
662 && !elf_vxworks_create_dynamic_sections (dynobj, info,
663 &htab->srelplt2))
664 {
665- info->callbacks->fatal (_("%P: failed to create VxWorks dynamic sections\n"));
666+ info->callbacks->fatal (_("%F%P: failed to create VxWorks dynamic sections\n"));
667 return pbfd;
668 }
669
670@@ -4413,7 +4413,7 @@ _bfd_x86_elf_link_setup_gnu_properties
671 don't need to do it in check_relocs. */
672 if (htab->elf.sgot == NULL
673 && !_bfd_elf_create_got_section (dynobj, info))
674- info->callbacks->fatal (_("%P: failed to create GOT sections\n"));
675+ info->callbacks->fatal (_("%F%P: failed to create GOT sections\n"));
676
677 got_align = (bed->target_id == X86_64_ELF_DATA) ? 3 : 2;
678
679@@ -4431,7 +4431,7 @@ _bfd_x86_elf_link_setup_gnu_properties
680 /* Create the ifunc sections here so that check_relocs can be
681 simplified. */
682 if (!_bfd_elf_create_ifunc_sections (dynobj, info))
683- info->callbacks->fatal (_("%P: failed to create ifunc sections\n"));
684+ info->callbacks->fatal (_("%F%P: failed to create ifunc sections\n"));
685
686 plt_alignment = bfd_log2 (htab->plt.plt_entry_size);
687
688@@ -4468,7 +4468,7 @@ _bfd_x86_elf_link_setup_gnu_properties
689 ".plt.got",
690 pltflags);
691 if (sec == NULL)
692- info->callbacks->fatal (_("%P: failed to create GOT PLT section\n"));
693+ info->callbacks->fatal (_("%F%P: failed to create GOT PLT section\n"));
694
695 if (!bfd_set_section_alignment (sec, non_lazy_plt_alignment))
696 goto error_alignment;
697@@ -4487,7 +4487,7 @@ _bfd_x86_elf_link_setup_gnu_properties
698 ".plt.sec",
699 pltflags);
700 if (sec == NULL)
701- info->callbacks->fatal (_("%P: failed to create IBT-enabled PLT section\n"));
702+ info->callbacks->fatal (_("%F%P: failed to create IBT-enabled PLT section\n"));
703
704 if (!bfd_set_section_alignment (sec, plt_alignment))
705 goto error_alignment;
706@@ -4507,7 +4507,7 @@ _bfd_x86_elf_link_setup_gnu_properties
707 ".eh_frame",
708 flags);
709 if (sec == NULL)
710- info->callbacks->fatal (_("%P: failed to create PLT .eh_frame section\n"));
711+ info->callbacks->fatal (_("%F%P: failed to create PLT .eh_frame section\n"));
712
713 if (!bfd_set_section_alignment (sec, class_align))
714 goto error_alignment;
715@@ -4520,7 +4520,7 @@ _bfd_x86_elf_link_setup_gnu_properties
716 ".eh_frame",
717 flags);
718 if (sec == NULL)
719- info->callbacks->fatal (_("%P: failed to create GOT PLT .eh_frame section\n"));
720+ info->callbacks->fatal (_("%F%P: failed to create GOT PLT .eh_frame section\n"));
721
722 if (!bfd_set_section_alignment (sec, class_align))
723 goto error_alignment;
724@@ -4534,7 +4534,7 @@ _bfd_x86_elf_link_setup_gnu_properties
725 ".eh_frame",
726 flags);
727 if (sec == NULL)
728- info->callbacks->fatal (_("%P: failed to create the second PLT .eh_frame section\n"));
729+ info->callbacks->fatal (_("%F%P: failed to create the second PLT .eh_frame section\n"));
730
731 if (!bfd_set_section_alignment (sec, class_align))
732 goto error_alignment;
733@@ -4554,7 +4554,7 @@ _bfd_x86_elf_link_setup_gnu_properties
734 ".sframe",
735 flags);
736 if (sec == NULL)
737- info->callbacks->fatal (_("%P: failed to create PLT .sframe section\n"));
738+ info->callbacks->fatal (_("%F%P: failed to create PLT .sframe section\n"));
739
740 // FIXME check this
741 // if (!bfd_set_section_alignment (sec, class_align))
742@@ -4569,7 +4569,7 @@ _bfd_x86_elf_link_setup_gnu_properties
743 ".sframe",
744 flags);
745 if (sec == NULL)
746- info->callbacks->fatal (_("%P: failed to create second PLT .sframe section\n"));
747+ info->callbacks->fatal (_("%F%P: failed to create second PLT .sframe section\n"));
748
749 htab->plt_second_sframe = sec;
750 }
751diff --git a/bfd/linker.c b/bfd/linker.c
752index 5b912221..7940e587 100644
753--- a/bfd/linker.c
754+++ b/bfd/linker.c
755@@ -2982,7 +2982,7 @@ _bfd_generic_section_already_linked (bfd *abfd ATTRIBUTE_UNUSED,
756
757 /* This is the first section with this name. Record it. */
758 if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
759- info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
760+ info->callbacks->fatal (_("%F%P: already_linked_table: %E\n"));
761 return false;
762 }
763
764diff --git a/bfd/reloc.c b/bfd/reloc.c
765index 1fee86f1..433f8e74 100644
766--- a/bfd/reloc.c
767+++ b/bfd/reloc.c
768@@ -8466,7 +8466,7 @@ bfd_generic_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
769 {
770 if (bfd_link_relocatable (link_info))
771 link_info->callbacks->fatal
772- (_("%P: --relax and -r may not be used together\n"));
773+ (_("%P%F: --relax and -r may not be used together\n"));
774
775 *again = false;
776 return true;
777diff --git a/bfd/reloc16.c b/bfd/reloc16.c
778index a16d6b20..b45ac263 100644
779--- a/bfd/reloc16.c
780+++ b/bfd/reloc16.c
781@@ -152,7 +152,7 @@ bfd_coff_reloc16_relax_section (bfd *abfd,
782
783 if (bfd_link_relocatable (link_info))
784 link_info->callbacks->fatal
785- (_("%P: --relax and -r may not be used together\n"));
786+ (_("%P%F: --relax and -r may not be used together\n"));
787
788 /* We only do global relaxation once. It is not safe to do it multiple
789 times (see discussion of the "shrinks" array below). */
790diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
791index 9b01cc37..e0165d20 100644
792--- a/bfd/xcofflink.c
793+++ b/bfd/xcofflink.c
794@@ -4681,7 +4681,7 @@ xcoff_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
795 if (hstub->target_section != NULL
796 && hstub->target_section->output_section == NULL
797 && info->non_contiguous_regions)
798- info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
799+ info->callbacks->fatal (_("%F%P: Could not assign `%pA' to an output section. "
800 "Retry without --enable-non-contiguous-regions.\n"),
801 hstub->target_section);
802
803diff --git a/ld/emulparams/call_nop.sh b/ld/emulparams/call_nop.sh
804index 7dd6dfb1..450d05ab 100644
805--- a/ld/emulparams/call_nop.sh
806+++ b/ld/emulparams/call_nop.sh
807@@ -20,7 +20,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP='
808 char *end;
809 params.call_nop_byte = strtoul (optarg + 16 , &end, 0);
810 if (*end)
811- fatal (_("%P: invalid number for -z call-nop=prefix-: %s\n"),
812+ fatal (_("%F%P: invalid number for -z call-nop=prefix-: %s\n"),
813 optarg + 16);
814 params.call_nop_as_suffix = false;
815 }
816@@ -29,12 +29,12 @@ PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP='
817 char *end;
818 params.call_nop_byte = strtoul (optarg + 16, &end, 0);
819 if (*end)
820- fatal (_("%P: invalid number for -z call-nop=suffix-: %s\n"),
821+ fatal (_("%F%P: invalid number for -z call-nop=suffix-: %s\n"),
822 optarg + 16);
823 params.call_nop_as_suffix = true;
824 }
825 else
826- fatal (_("%P: unsupported option: -z %s\n"), optarg);
827+ fatal (_("%F%P: unsupported option: -z %s\n"), optarg);
828 }
829 '
830
831diff --git a/ld/emulparams/cet.sh b/ld/emulparams/cet.sh
832index e463441d..824bcf0e 100644
833--- a/ld/emulparams/cet.sh
834+++ b/ld/emulparams/cet.sh
835@@ -29,7 +29,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_CET='
836 | prop_report_ibt
837 | prop_report_shstk);
838 else
839- fatal (_("%P: invalid option for -z cet-report=: %s\n"),
840+ fatal (_("%F%P: invalid option for -z cet-report=: %s\n"),
841 optarg + 11);
842 }
843 '
844diff --git a/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh
845index 275a796f..99261ca8 100644
846--- a/ld/emulparams/elf32mcore.sh
847+++ b/ld/emulparams/elf32mcore.sh
848@@ -46,6 +46,6 @@ PARSE_AND_LIST_ARGS_CASES='
849 case OPTION_BASE_FILE:
850 link_info.base_file = fopen (optarg, FOPEN_WB);
851 if (link_info.base_file == NULL)
852- fatal (_("%P: cannot open base file %s\n"), optarg);
853+ fatal (_("%F%P: cannot open base file %s\n"), optarg);
854 break;
855 '
856diff --git a/ld/emulparams/x86-64-lam.sh b/ld/emulparams/x86-64-lam.sh
857index 6e629ebb..8675a01f 100644
858--- a/ld/emulparams/x86-64-lam.sh
859+++ b/ld/emulparams/x86-64-lam.sh
860@@ -25,7 +25,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_LAM='
861 else if (strcmp (optarg + 15, "error") == 0)
862 params.lam_u48_report = prop_report_error;
863 else
864- fatal (_("%P: invalid option for -z lam-u48-report=: %s\n"),
865+ fatal (_("%F%P: invalid option for -z lam-u48-report=: %s\n"),
866 optarg + 15);
867 }
868 else if (strcmp (optarg, "lam-u57") == 0)
869@@ -39,7 +39,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_LAM='
870 else if (strcmp (optarg + 15, "error") == 0)
871 params.lam_u57_report = prop_report_error;
872 else
873- fatal (_("%P: invalid option for -z lam-u57-report=: %s\n"),
874+ fatal (_("%F%P: invalid option for -z lam-u57-report=: %s\n"),
875 optarg + 15);
876 }
877 else if (strncmp (optarg, "lam-report=", 11) == 0)
878@@ -60,7 +60,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_LAM='
879 params.lam_u57_report = prop_report_error;
880 }
881 else
882- fatal (_("%P: invalid option for -z lam-report=: %s\n"),
883+ fatal (_("%F%P: invalid option for -z lam-report=: %s\n"),
884 optarg + 11);
885 }
886 '
887diff --git a/ld/emulparams/x86-64-level.sh b/ld/emulparams/x86-64-level.sh
888index 7e27cf1e..3002a1f7 100644
889--- a/ld/emulparams/x86-64-level.sh
890+++ b/ld/emulparams/x86-64-level.sh
891@@ -10,7 +10,7 @@ PARSE_AND_LIST_ARGS_CASE_Z_X86_64_LEVEL='
892 char *end;
893 unsigned int level = strtoul (optarg + 8 , &end, 10);
894 if (*end != '\0' || level < 2 || level > 4)
895- fatal (_("%P: invalid x86-64 ISA level: %s\n"), optarg);
896+ fatal (_("%F%P: invalid x86-64 ISA level: %s\n"), optarg);
897 params.isa_level = level;
898 }
899 '
900diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
901index a6637718..1cdd433d 100644
902--- a/ld/emultempl/aarch64elf.em
903+++ b/ld/emultempl/aarch64elf.em
904@@ -316,7 +316,7 @@ aarch64_elf_create_output_section_statements (void)
905 These will only be created if the output format is an arm format,
906 hence we do not support linking and changing output formats at the
907 same time. Use a link followed by objcopy to change output formats. */
908- fatal (_("%P: error: cannot change output format "
909+ fatal (_("%F%P: error: cannot change output format "
910 "whilst linking %s binaries\n"), "AArch64");
911 return;
912 }
913@@ -342,7 +342,7 @@ aarch64_elf_create_output_section_statements (void)
914 bfd_get_arch (link_info.output_bfd),
915 bfd_get_mach (link_info.output_bfd)))
916 {
917- fatal (_("%P: can not create BFD: %E\n"));
918+ fatal (_("%F%P: can not create BFD: %E\n"));
919 return;
920 }
921
922@@ -468,7 +468,7 @@ PARSE_AND_LIST_ARGS_CASES='
923
924 group_size = bfd_scan_vma (optarg, &end, 0);
925 if (*end)
926- fatal (_("%P: invalid number `%s'\''\n"), optarg);
927+ fatal (_("%F%P: invalid number `%s'\''\n"), optarg);
928 }
929 break;
930 '
931diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
932index 29acdbc9..85bd45fa 100644
933--- a/ld/emultempl/aix.em
934+++ b/ld/emultempl/aix.em
935@@ -335,7 +335,7 @@ read_file_list (const char *filename)
936 f = fopen (filename, FOPEN_RT);
937 if (f == NULL)
938 {
939- fatal (_("%P: cannot open %s\n"), filename);
940+ fatal (_("%F%P: cannot open %s\n"), filename);
941 return;
942 }
943 if (fseek (f, 0L, SEEK_END) == -1)
944@@ -383,7 +383,7 @@ read_file_list (const char *filename)
945
946 error:
947 fclose (f);
948- fatal (_("%P: cannot read %s\n"), optarg);
949+ fatal (_("%F%P: cannot read %s\n"), optarg);
950 }
951
952 static bool
953@@ -734,7 +734,7 @@ gld${EMULATION_NAME}_after_open (void)
954 size = (p->count + 2) * 4;
955 if (!bfd_xcoff_link_record_set (link_info.output_bfd, &link_info,
956 p->h, size))
957- fatal (_("%P: bfd_xcoff_link_record_set failed: %E\n"));
958+ fatal (_("%F%P: bfd_xcoff_link_record_set failed: %E\n"));
959 }
960 }
961
962@@ -764,9 +764,9 @@ gld${EMULATION_NAME}_before_allocation (void)
963
964 h = bfd_link_hash_lookup (link_info.hash, el->name, false, false, false);
965 if (h == NULL)
966- fatal (_("%P: bfd_link_hash_lookup of export symbol failed: %E\n"));
967+ fatal (_("%F%P: bfd_link_hash_lookup of export symbol failed: %E\n"));
968 if (!bfd_xcoff_export_symbol (link_info.output_bfd, &link_info, h))
969- fatal (_("%P: bfd_xcoff_export_symbol failed: %E\n"));
970+ fatal (_("%F%P: bfd_xcoff_export_symbol failed: %E\n"));
971 }
972
973 /* Track down all relocations called for by the linker script (these
974@@ -849,7 +849,7 @@ gld${EMULATION_NAME}_before_allocation (void)
975 (link_info.output_bfd, &link_info, libpath, entry_symbol.name,
976 file_align, maxstack, maxdata, gc && !unix_ld,
977 modtype, textro, flags, special_sections, rtld))
978- fatal (_("%P: failed to set dynamic section sizes: %E\n"));
979+ fatal (_("%F%P: failed to set dynamic section sizes: %E\n"));
980
981 /* Look through the special sections, and put them in the right
982 place in the link ordering. This is especially magic. */
983@@ -871,8 +871,8 @@ gld${EMULATION_NAME}_before_allocation (void)
984 is = NULL;
985 os = lang_output_section_get (sec->output_section);
986 if (os == NULL)
987- fatal (_("%P: can't find output section %pA\n"),
988- sec->output_section);
989+ fatal (_("%F%P: can't find output section %s\n"),
990+ sec->output_section->name);
991
992 for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->header.next)
993 {
994@@ -908,7 +908,8 @@ gld${EMULATION_NAME}_before_allocation (void)
995
996 if (is == NULL)
997 {
998- fatal (_("%P: can't find %pA in output section\n"), sec);
999+ fatal (_("%F%P: can't find %s in output section\n"),
1000+ bfd_section_name (sec));
1001 }
1002
1003 /* Now figure out where the section should go. */
1004@@ -1161,7 +1162,7 @@ gld${EMULATION_NAME}_after_allocation (void)
1005
1006 /* Now that everything is in place, finalize the dynamic sections. */
1007 if (!bfd_xcoff_build_dynamic_sections (link_info.output_bfd, &link_info))
1008- fatal (_("%P: failed to layout dynamic sections: %E\n"));
1009+ fatal (_("%F%P: failed to layout dynamic sections: %E\n"));
1010
1011 if (!bfd_link_relocatable (&link_info))
1012 {
1013@@ -1312,7 +1313,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
1014 if (f == NULL)
1015 {
1016 bfd_set_error (bfd_error_system_call);
1017- fatal ("%P: %s: %E\n", filename);
1018+ fatal ("%F%P: %s: %E\n", filename);
1019 return;
1020 }
1021
1022@@ -1374,7 +1375,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
1023 obstack_free (o, obstack_base (o));
1024 }
1025 else if (*s == '(')
1026- fatal (_("%P:%s:%d: #! ([member]) is not supported "
1027+ fatal (_("%F%P:%s:%d: #! ([member]) is not supported "
1028 "in import files\n"),
1029 filename, lineno);
1030 else
1031@@ -1391,7 +1392,7 @@ gld${EMULATION_NAME}_read_file (const char *filename, bool import)
1032 *s = '\0';
1033 if (!bfd_xcoff_split_import_path (link_info.output_bfd,
1034 start, &imppath, &impfile))
1035- fatal (_("%P: could not parse import path: %E\n"));
1036+ fatal (_("%F%P: could not parse import path: %E\n"));
1037 while (ISSPACE (cs))
1038 {
1039 ++s;
1040@@ -1546,10 +1547,10 @@ gld${EMULATION_NAME}_find_relocs (lang_statement_union_type *s)
1041
1042 rs = &s->reloc_statement;
1043 if (rs->name == NULL)
1044- fatal (_("%P: only relocations against symbols are permitted\n"));
1045+ fatal (_("%F%P: only relocations against symbols are permitted\n"));
1046 if (!bfd_xcoff_link_count_reloc (link_info.output_bfd, &link_info,
1047 rs->name))
1048- fatal (_("%P: bfd_xcoff_link_count_reloc failed: %E\n"));
1049+ fatal (_("%F%P: bfd_xcoff_link_count_reloc failed: %E\n"));
1050 }
1051
1052 if (s->header.type == lang_assignment_statement_enum)
1053@@ -1578,7 +1579,7 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
1054 if (!bfd_xcoff_record_link_assignment (link_info.output_bfd,
1055 &link_info,
1056 exp->assign.dst))
1057- fatal (_("%P: failed to record assignment to %s: %E\n"),
1058+ fatal (_("%F%P: failed to record assignment to %s: %E\n"),
1059 exp->assign.dst);
1060 }
1061 gld${EMULATION_NAME}_find_exp_assignment (exp->assign.src);
1062@@ -1673,7 +1674,7 @@ gld${EMULATION_NAME}_create_output_section_statements (void)
1063 bfd_get_arch (link_info.output_bfd),
1064 bfd_get_mach (link_info.output_bfd)))
1065 {
1066- fatal (_("%P: can not create stub BFD: %E\n"));
1067+ fatal (_("%F%P: can not create stub BFD: %E\n"));
1068 return;
1069 }
1070
1071@@ -1683,7 +1684,7 @@ gld${EMULATION_NAME}_create_output_section_statements (void)
1072
1073 /* Pass linker params to the back-end. */
1074 if (!bfd_xcoff_link_init (&link_info, &params))
1075- fatal (_("%P: can not init BFD: %E\n"));
1076+ fatal (_("%F%P: can not init BFD: %E\n"));
1077
1078 /* __rtinit */
1079 if (link_info.init_function != NULL
1080@@ -1700,7 +1701,7 @@ gld${EMULATION_NAME}_create_output_section_statements (void)
1081 bfd_get_arch (link_info.output_bfd),
1082 bfd_get_mach (link_info.output_bfd)))
1083 {
1084- fatal (_("%P: can not create BFD: %E\n"));
1085+ fatal (_("%F%P: can not create BFD: %E\n"));
1086 return;
1087 }
1088
1089@@ -1710,7 +1711,7 @@ gld${EMULATION_NAME}_create_output_section_statements (void)
1090 link_info.fini_function,
1091 rtld))
1092 {
1093- fatal (_("%P: can not create BFD: %E\n"));
1094+ fatal (_("%F%P: can not create BFD: %E\n"));
1095 return;
1096 }
1097
1098diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
1099index 504fb0cd..4240f4e7 100644
1100--- a/ld/emultempl/armelf.em
1101+++ b/ld/emultempl/armelf.em
1102@@ -521,7 +521,7 @@ arm_elf_create_output_section_statements (void)
1103 These will only be created if the output format is an arm format,
1104 hence we do not support linking and changing output formats at the
1105 same time. Use a link followed by objcopy to change output formats. */
1106- fatal (_("%P: error: cannot change output format "
1107+ fatal (_("%F%P: error: cannot change output format "
1108 "whilst linking %s binaries\n"), "ARM");
1109 return;
1110 }
1111@@ -532,10 +532,10 @@ arm_elf_create_output_section_statements (void)
1112 bfd_get_target (link_info.output_bfd));
1113
1114 if (params.in_implib_bfd == NULL)
1115- fatal (_("%P: %s: can't open: %E\n"), in_implib_filename);
1116+ fatal (_("%F%P: %s: can't open: %E\n"), in_implib_filename);
1117
1118 if (!bfd_check_format (params.in_implib_bfd, bfd_object))
1119- fatal (_("%P: %s: not a relocatable file: %E\n"), in_implib_filename);
1120+ fatal (_("%F%P: %s: not a relocatable file: %E\n"), in_implib_filename);
1121 }
1122
1123 bfd_elf32_arm_set_target_params (link_info.output_bfd, &link_info, &params);
1124@@ -549,7 +549,7 @@ arm_elf_create_output_section_statements (void)
1125 bfd_get_arch (link_info.output_bfd),
1126 bfd_get_mach (link_info.output_bfd)))
1127 {
1128- fatal (_("%P: can not create BFD: %E\n"));
1129+ fatal (_("%F%P: can not create BFD: %E\n"));
1130 return;
1131 }
1132
1133@@ -734,7 +734,7 @@ PARSE_AND_LIST_ARGS_CASES='
1134
1135 group_size = bfd_scan_vma (optarg, &end, 0);
1136 if (*end)
1137- fatal (_("%P: invalid number `%s'\''\n"), optarg);
1138+ fatal (_("%F%P: invalid number `%s'\''\n"), optarg);
1139 }
1140 break;
1141
1142diff --git a/ld/emultempl/avrelf.em b/ld/emultempl/avrelf.em
1143index dd5b57d1..854c57bb 100644
1144--- a/ld/emultempl/avrelf.em
1145+++ b/ld/emultempl/avrelf.em
1146@@ -116,7 +116,7 @@ avr_elf_create_output_section_statements (void)
1147
1148 if (bfd_get_flavour (link_info.output_bfd) != bfd_target_elf_flavour)
1149 {
1150- fatal (_("%P: error: cannot change output format "
1151+ fatal (_("%F%P: error: cannot change output format "
1152 "whilst linking %s binaries\n"), "AVR");
1153 return;
1154 }
1155diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
1156index 81878b02..e936b4f5 100644
1157--- a/ld/emultempl/beos.em
1158+++ b/ld/emultempl/beos.em
1159@@ -227,7 +227,7 @@ set_pe_subsystem (void)
1160 return;
1161 }
1162 }
1163- fatal (_("%P: invalid subsystem type %s\n"), optarg);
1164+ fatal (_("%F%P: invalid subsystem type %s\n"), optarg);
1165 }
1166
1167
1168@@ -237,7 +237,7 @@ set_pe_value (char *name)
1169 char *end;
1170 set_pe_name (name, strtoul (optarg, &end, 0));
1171 if (end == optarg)
1172- fatal (_("%P: invalid hex number for PE parameter '%s'\n"), optarg);
1173+ fatal (_("%F%P: invalid hex number for PE parameter '%s'\n"), optarg);
1174
1175 optarg = end;
1176 }
1177@@ -252,7 +252,7 @@ set_pe_stack_heap (char *resname, char *comname)
1178 set_pe_value (comname);
1179 }
1180 else if (*optarg)
1181- fatal (_("%P: strange hex info for PE parameter '%s'\n"), optarg);
1182+ fatal (_("%F%P: strange hex info for PE parameter '%s'\n"), optarg);
1183 }
1184
1185
1186@@ -267,7 +267,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
1187 case OPTION_BASE_FILE:
1188 link_info.base_file = fopen (optarg, FOPEN_WB);
1189 if (link_info.base_file == NULL)
1190- fatal (_("%P: cannot open base file %s\n"), optarg);
1191+ fatal (_("%F%P: cannot open base file %s\n"), optarg);
1192 break;
1193
1194 /* PE options */
1195@@ -376,7 +376,7 @@ gld${EMULATION_NAME}_after_open (void)
1196 FIXME: This should be done via a function, rather than by
1197 including an internal BFD header. */
1198 if (!obj_pe (link_info.output_bfd))
1199- fatal (_("%P: PE operations on non PE file\n"));
1200+ fatal (_("%F%P: PE operations on non PE file\n"));
1201
1202 pe_data(link_info.output_bfd)->pe_opthdr = pe;
1203 pe_data(link_info.output_bfd)->dll = init[DLLOFF].value;
1204@@ -425,12 +425,12 @@ sort_by_file_name (const void *a, const void *b)
1205
1206 if (!bfd_get_section_contents (sa->owner, sa, &a_sec, (file_ptr) 0,
1207 (bfd_size_type) sizeof (a_sec)))
1208- fatal (_("%P: %pB: can't read contents of section .idata: %E\n"),
1209+ fatal (_("%F%P: %pB: can't read contents of section .idata: %E\n"),
1210 sa->owner);
1211
1212 if (!bfd_get_section_contents (sb->owner, sb, &b_sec, (file_ptr) 0,
1213 (bfd_size_type) sizeof (b_sec)))
1214- fatal (_("%P: %pB: can't read contents of section .idata: %E\n"),
1215+ fatal (_("%F%P: %pB: can't read contents of section .idata: %E\n"),
1216 sb->owner);
1217
1218 i = a_sec < b_sec ? -1 : 0;
1219@@ -662,7 +662,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
1220 /* Everything from the '\$' on gets deleted so don't allow '\$' as the
1221 first character. */
1222 if (*secname == '\$')
1223- fatal (_("%P: section %s has '\$' as first character\n"), secname);
1224+ fatal (_("%F%P: section %s has '\$' as first character\n"), secname);
1225 if (strchr (secname + 1, '\$') == NULL)
1226 return NULL;
1227
1228@@ -692,7 +692,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
1229 }
1230 ps[0] = 0;
1231 if (l == NULL)
1232- fatal (_("%P: *(%s\$) missing from linker script\n"), output_secname);
1233+ fatal (_("%F%P: *(%s\$) missing from linker script\n"), output_secname);
1234
1235 /* Link the input section in and we're done for now.
1236 The sections still have to be sorted, but that has to wait until
1237diff --git a/ld/emultempl/cr16elf.em b/ld/emultempl/cr16elf.em
1238index 5464edf1..cd24728c 100644
1239--- a/ld/emultempl/cr16elf.em
1240+++ b/ld/emultempl/cr16elf.em
1241@@ -58,7 +58,7 @@ cr16_elf_after_open (void)
1242 COFF and ELF. */
1243 if (bfd_get_flavour (abfd) != bfd_target_coff_flavour
1244 && bfd_get_flavour (abfd) != bfd_target_elf_flavour)
1245- fatal (_("%P: %pB: all input objects must be COFF or ELF "
1246+ fatal (_("%F%P: %pB: all input objects must be COFF or ELF "
1247 "for --embedded-relocs\n"));
1248
1249 datasec = bfd_get_section_by_name (abfd, ".data.rel");
1250@@ -82,7 +82,7 @@ cr16_elf_after_open (void)
1251 | SEC_IN_MEMORY))
1252 || !bfd_set_section_alignment (relsec, 2)
1253 || !bfd_set_section_size (relsec, datasec->reloc_count * 8))
1254- fatal (_("%P: %pB: can not create .emreloc section: %E\n"));
1255+ fatal (_("%F%P: %pB: can not create .emreloc section: %E\n"));
1256 }
1257
1258 /* Double check that all other data sections are empty, as is
1259diff --git a/ld/emultempl/cskyelf.em b/ld/emultempl/cskyelf.em
1260index 9c91d7ac..b4896c45 100644
1261--- a/ld/emultempl/cskyelf.em
1262+++ b/ld/emultempl/cskyelf.em
1263@@ -151,7 +151,7 @@ csky_elf_create_output_section_statements (void)
1264 bfd_get_arch (link_info.output_bfd),
1265 bfd_get_mach (link_info.output_bfd)))
1266 {
1267- fatal (_("%P: can not create BFD: %E\n"));
1268+ fatal (_("%F%P: can not create BFD: %E\n"));
1269 return;
1270 }
1271
1272@@ -324,7 +324,7 @@ PARSE_AND_LIST_ARGS_CASES='
1273
1274 group_size = bfd_scan_vma (optarg, &end, 0);
1275 if (*end)
1276- fatal (_("%P: invalid number `%s'\''\n"), optarg);
1277+ fatal (_("%F%P: invalid number `%s'\''\n"), optarg);
1278 }
1279 break;
1280 '
1281diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
1282index 5cc38194..fbbff87f 100644
1283--- a/ld/emultempl/elf.em
1284+++ b/ld/emultempl/elf.em
1285@@ -667,12 +667,12 @@ gld${EMULATION_NAME}_handle_option (int optc)
1286 {
1287 #ifndef HAVE_ZSTD
1288 if (config.compress_debug == COMPRESS_DEBUG_ZSTD)
1289- fatal (_("%P: --compress-debug-sections=zstd: ld is not built "
1290+ fatal (_("%F%P: --compress-debug-sections=zstd: ld is not built "
1291 "with zstd support\n"));
1292 #endif
1293 }
1294 if (config.compress_debug == COMPRESS_UNKNOWN)
1295- fatal (_("%P: invalid --compress-debug-sections option: \`%s'\n"),
1296+ fatal (_("%F%P: invalid --compress-debug-sections option: \`%s'\n"),
1297 optarg);
1298 break;
1299 EOF
1300@@ -727,7 +727,7 @@ fragment <<EOF
1301 link_info.emit_gnu_hash = true;
1302 }
1303 else
1304- fatal (_("%P: invalid hash style \`%s'\n"), optarg);
1305+ fatal (_("%F%P: invalid hash style \`%s'\n"), optarg);
1306 break;
1307
1308 EOF
1309@@ -747,7 +747,7 @@ fragment <<EOF
1310 link_info.maxpagesize = strtoul (optarg + 14, &end, 0);
1311 if (*end
1312 || (link_info.maxpagesize & (link_info.maxpagesize - 1)) != 0)
1313- fatal (_("%P: invalid maximum page size \`%s'\n"),
1314+ fatal (_("%F%P: invalid maximum page size \`%s'\n"),
1315 optarg + 14);
1316 link_info.maxpagesize_is_set = true;
1317 }
1318@@ -757,7 +757,7 @@ fragment <<EOF
1319 link_info.commonpagesize = strtoul (optarg + 17, &end, 0);
1320 if (*end
1321 || (link_info.commonpagesize & (link_info.commonpagesize - 1)) != 0)
1322- fatal (_("%P: invalid common page size \`%s'\n"),
1323+ fatal (_("%F%P: invalid common page size \`%s'\n"),
1324 optarg + 17);
1325 link_info.commonpagesize_is_set = true;
1326 }
1327@@ -766,7 +766,7 @@ fragment <<EOF
1328 char *end;
1329 link_info.stacksize = strtoul (optarg + 11, &end, 0);
1330 if (*end || link_info.stacksize < 0)
1331- fatal (_("%P: invalid stack size \`%s'\n"), optarg + 11);
1332+ fatal (_("%F%P: invalid stack size \`%s'\n"), optarg + 11);
1333 if (!link_info.stacksize)
1334 /* Use -1 for explicit no-stack, because zero means
1335 'default'. */
1336@@ -805,7 +805,7 @@ fragment <<EOF
1337 else if (strcmp (optarg, "start-stop-visibility=protected") == 0)
1338 link_info.start_stop_visibility = STV_PROTECTED;
1339 else
1340- fatal (_("%P: invalid visibility in \`-z %s'; "
1341+ fatal (_("%F%P: invalid visibility in \`-z %s'; "
1342 "must be default, internal, hidden, or protected"),
1343 optarg);
1344 }
1345diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em
1346index f0284ea3..e8e98a49 100644
1347--- a/ld/emultempl/hppaelf.em
1348+++ b/ld/emultempl/hppaelf.em
1349@@ -82,7 +82,7 @@ hppaelf_create_output_section_statements (void)
1350 bfd_get_arch (link_info.output_bfd),
1351 bfd_get_mach (link_info.output_bfd)))
1352 {
1353- fatal (_("%P: can not create BFD: %E\n"));
1354+ fatal (_("%F%P: can not create BFD: %E\n"));
1355 return;
1356 }
1357
1358@@ -351,7 +351,7 @@ PARSE_AND_LIST_ARGS_CASES='
1359 const char *end;
1360 group_size = bfd_scan_vma (optarg, &end, 0);
1361 if (*end)
1362- fatal (_("%P: invalid number `%s'\''\n"), optarg);
1363+ fatal (_("%F%P: invalid number `%s'\''\n"), optarg);
1364 }
1365 break;
1366 '
1367diff --git a/ld/emultempl/kvxelf.em b/ld/emultempl/kvxelf.em
1368index 1ffbd1db..81713678 100644
1369--- a/ld/emultempl/kvxelf.em
1370+++ b/ld/emultempl/kvxelf.em
1371@@ -36,7 +36,7 @@ EOF
1372 if test x"${EMULATION_NAME}" != x"elf64kvx_linux"; then
1373 fragment <<EOF
1374 if (bfd_link_pie (&link_info))
1375- fatal (_(":%P: -pie not supported\n"));
1376+ fatal (_("%F:%P: -pie not supported\n"));
1377 EOF
1378 fi
1379 fragment <<EOF
1380@@ -299,7 +299,7 @@ kvx_elf_create_output_section_statements (void)
1381 ldlang_add_file (stub_file);
1382
1383 if (!kvx_elf${ELFSIZE}_init_stub_bfd (&link_info, stub_file->the_bfd))
1384- einfo ("%P: can not init BFD: %E\n");
1385+ fatal ("%F%P: can not init BFD: %E\n");
1386 }
1387
1388
1389diff --git a/ld/emultempl/loongarchelf.em b/ld/emultempl/loongarchelf.em
1390index 5a3d7b79..153094b0 100644
1391--- a/ld/emultempl/loongarchelf.em
1392+++ b/ld/emultempl/loongarchelf.em
1393@@ -71,7 +71,7 @@ gld${EMULATION_NAME}_after_allocation (void)
1394 if (!_bfd_elf_map_sections_to_segments (link_info.output_bfd,
1395 &link_info,
1396 NULL))
1397- fatal (_("%P: map sections to segments failed: %E\n"));
1398+ fatal (_("%F%P: map sections to segments failed: %E\n"));
1399 }
1400
1401 /* Adjust program header size and .eh_frame_hdr size before
1402diff --git a/ld/emultempl/m68hc1xelf.em b/ld/emultempl/m68hc1xelf.em
1403index 36f5f068..fe6dd85b 100644
1404--- a/ld/emultempl/m68hc1xelf.em
1405+++ b/ld/emultempl/m68hc1xelf.em
1406@@ -159,7 +159,7 @@ m68hc11elf_create_output_section_statements (void)
1407 bfd_get_arch (link_info.output_bfd),
1408 bfd_get_mach (link_info.output_bfd)))
1409 {
1410- fatal (_("%P: can not create BFD: %E\n"));
1411+ fatal (_("%F%P: can not create BFD: %E\n"));
1412 return;
1413 }
1414
1415diff --git a/ld/emultempl/m68kelf.em b/ld/emultempl/m68kelf.em
1416index f9a5bec2..e6eed5cc 100644
1417--- a/ld/emultempl/m68kelf.em
1418+++ b/ld/emultempl/m68kelf.em
1419@@ -82,7 +82,7 @@ m68k_elf_after_open (void)
1420 asection *datasec;
1421
1422 if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
1423- fatal (_("%P: %pB: all input objects must be ELF "
1424+ fatal (_("%F%P: %pB: all input objects must be ELF "
1425 "for --embedded-relocs\n"));
1426
1427 datasec = bfd_get_section_by_name (abfd, ".data");
1428@@ -106,7 +106,7 @@ m68k_elf_after_open (void)
1429 if (relsec == NULL
1430 || !bfd_set_section_alignment (relsec, 2)
1431 || !bfd_set_section_size (relsec, datasec->reloc_count * 12))
1432- fatal (_("%P: %pB: can not create .emreloc section: %E\n"));
1433+ fatal (_("%F%P: %pB: can not create .emreloc section: %E\n"));
1434 }
1435
1436 /* Double check that all other data sections are empty, as is
1437diff --git a/ld/emultempl/metagelf.em b/ld/emultempl/metagelf.em
1438index 313d7ed5..95655ad0 100644
1439--- a/ld/emultempl/metagelf.em
1440+++ b/ld/emultempl/metagelf.em
1441@@ -59,7 +59,7 @@ metagelf_create_output_section_statements (void)
1442 bfd_get_arch (link_info.output_bfd),
1443 bfd_get_mach (link_info.output_bfd)))
1444 {
1445- fatal (_("%P: can not create BFD: %E\n"));
1446+ fatal (_("%F%P: can not create BFD: %E\n"));
1447 return;
1448 }
1449
1450@@ -309,7 +309,7 @@ PARSE_AND_LIST_ARGS_CASES='
1451 const char *end;
1452 group_size = bfd_scan_vma (optarg, &end, 0);
1453 if (*end)
1454- fatal (_("%P: invalid number `%s'\''\n"), optarg);
1455+ fatal (_("%F%P: invalid number `%s'\''\n"), optarg);
1456 }
1457 break;
1458 '
1459diff --git a/ld/emultempl/mipself.em b/ld/emultempl/mipself.em
1460index 2a22ba49..a4f158b7 100644
1461--- a/ld/emultempl/mipself.em
1462+++ b/ld/emultempl/mipself.em
1463@@ -152,7 +152,7 @@ mips_add_stub_section (const char *stub_sec_name, asection *input_section,
1464 bfd_get_arch (link_info.output_bfd),
1465 bfd_get_mach (link_info.output_bfd)))
1466 {
1467- fatal (_("%P: can not create BFD: %E\n"));
1468+ fatal (_("%F%P: can not create BFD: %E\n"));
1469 return NULL;
1470 }
1471 stub_bfd->flags |= BFD_LINKER_CREATED;
1472diff --git a/ld/emultempl/mmix-elfnmmo.em b/ld/emultempl/mmix-elfnmmo.em
1473index 03186363..c4288d82 100644
1474--- a/ld/emultempl/mmix-elfnmmo.em
1475+++ b/ld/emultempl/mmix-elfnmmo.em
1476@@ -113,7 +113,7 @@ mmix_after_allocation (void)
1477 bfd_set_section_vma (sec, 0);
1478
1479 if (!_bfd_mmix_after_linker_allocation (link_info.output_bfd, &link_info))
1480- fatal (_("%P: can't finalize linker-allocated global registers\n"));
1481+ fatal (_("%F%P: can't finalize linker-allocated global registers\n"));
1482 }
1483 EOF
1484
1485diff --git a/ld/emultempl/nds32elf.em b/ld/emultempl/nds32elf.em
1486index 36260573..8598d0a8 100644
1487--- a/ld/emultempl/nds32elf.em
1488+++ b/ld/emultempl/nds32elf.em
1489@@ -44,7 +44,7 @@ nds32_elf_create_output_section_statements (void)
1490 if (strstr (bfd_get_target (link_info.output_bfd), "nds32") == NULL)
1491 {
1492 /* Check the output target is nds32. */
1493- fatal (_("%P: error: cannot change output format whilst "
1494+ fatal (_("%F%P: error: cannot change output format whilst "
1495 "linking %s binaries\n"), "NDS32");
1496 return;
1497 }
1498@@ -96,7 +96,7 @@ nds32_elf_after_open (void)
1499 && abi_ver != (elf_elfheader (abfd)->e_flags & EF_NDS_ABI))
1500 {
1501 /* Incompatible objects. */
1502- fatal (_("%P: %pB: ABI version of object files mismatched\n"),
1503+ fatal (_("%F%P: %pB: ABI version of object files mismatched\n"),
1504 abfd);
1505 }
1506 }
1507@@ -195,7 +195,7 @@ PARSE_AND_LIST_ARGS_CASES='
1508 {
1509 sym_ld_script = fopen (optarg, FOPEN_WT);
1510 if(sym_ld_script == NULL)
1511- fatal (_("%P: cannot open map file %s: %E\n"), optarg);
1512+ fatal (_("%F%P: cannot open map file %s: %E\n"), optarg);
1513 }
1514 break;
1515 case OPTION_HYPER_RELAX:
1516diff --git a/ld/emultempl/nto.em b/ld/emultempl/nto.em
1517index 609d0217..bed2d374 100644
1518--- a/ld/emultempl/nto.em
1519+++ b/ld/emultempl/nto.em
1520@@ -51,7 +51,7 @@ nto_create_QNX_note_section(int type)
1521 is called before this function, stub_file should already be defined. */
1522 if (!stub_file)
1523 {
1524- fatal (_("%P: cannot create .note section in stub BFD.\n"));
1525+ fatal (_("%F%P: cannot create .note section in stub BFD.\n"));
1526 return NULL;
1527 }
1528
1529@@ -60,7 +60,7 @@ nto_create_QNX_note_section(int type)
1530 note_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd, ".note", flags);
1531 if (! note_sec)
1532 {
1533- fatal (_("%P: failed to create .note section\n"));
1534+ fatal (_("%F%P: failed to create .note section\n"));
1535 return NULL;
1536 }
1537
1538@@ -101,7 +101,7 @@ nto_lookup_QNX_note_section(int type)
1539 sec->contents = xmalloc(sec->size);
1540 if (!bfd_get_section_contents (sec->owner, sec, sec->contents, (file_ptr) 0,
1541 sec->size))
1542- fatal (_("%P: %pB: can't read contents of section .note: %E\n"),
1543+ fatal (_("%F%P: %pB: can't read contents of section .note: %E\n"),
1544 sec->owner);
1545
1546 e_note = (Elf_External_Note *) sec->contents;
1547@@ -144,7 +144,7 @@ nto_add_note_section (void) {
1548
1549 if (nto_lazy_stack && !link_info.stacksize)
1550 {
1551- fatal (_("%P: error: --lazy-stack must follow -zstack-size=<size>\n"));
1552+ fatal (_("%F%P: error: --lazy-stack must follow -zstack-size=<size>\n"));
1553 return;
1554 }
1555
1556@@ -216,7 +216,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1557 char *end;
1558 link_info.stacksize = strtoul (optarg, &end, 0);
1559 if (*end || link_info.stacksize < 0)
1560- fatal (_("%P: invalid stack size `%s'\''\n"), optarg + 11);
1561+ fatal (_("%F%P: invalid stack size `%s'\''\n"), optarg + 11);
1562 if (!link_info.stacksize)
1563 /* Use -1 for explicit no-stack, because zero means
1564 'default'. */
1565diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
1566index 4cb1488e..3eeaffec 100644
1567--- a/ld/emultempl/pe.em
1568+++ b/ld/emultempl/pe.em
1569@@ -726,7 +726,7 @@ set_pe_subsystem (void)
1570
1571 if (v[i].name == NULL)
1572 {
1573- fatal (_("%P: invalid subsystem type %s\n"), optarg);
1574+ fatal (_("%F%P: invalid subsystem type %s\n"), optarg);
1575 return;
1576 }
1577
1578@@ -747,7 +747,7 @@ set_pe_value (char *name)
1579 set_pe_name (name, strtoul (optarg, &end, 0));
1580
1581 if (end == optarg)
1582- fatal (_("%P: invalid hex number for PE parameter '%s'\n"), optarg);
1583+ fatal (_("%F%P: invalid hex number for PE parameter '%s'\n"), optarg);
1584
1585 optarg = end;
1586 }
1587@@ -764,7 +764,7 @@ set_pe_stack_heap (char *resname, char *comname)
1588 set_pe_value (comname);
1589 }
1590 else if (*optarg)
1591- fatal (_("%P: strange hex info for PE parameter '%s'\n"), optarg);
1592+ fatal (_("%F%P: strange hex info for PE parameter '%s'\n"), optarg);
1593 }
1594
1595 #define DEFAULT_BUILD_ID_STYLE "md5"
1596@@ -780,7 +780,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
1597 case OPTION_BASE_FILE:
1598 link_info.base_file = fopen (optarg, FOPEN_WB);
1599 if (link_info.base_file == NULL)
1600- fatal (_("%P: cannot open base file %s\n"), optarg);
1601+ fatal (_("%F%P: cannot open base file %s\n"), optarg);
1602 break;
1603
1604 /* PE options. */
1605@@ -1309,7 +1309,7 @@ make_runtime_ref (void)
1606 = bfd_wrapped_link_hash_lookup (link_info.output_bfd, &link_info,
1607 rr, true, false, true);
1608 if (!h)
1609- fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
1610+ fatal (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
1611 else
1612 {
1613 if (h->type == bfd_link_hash_new)
1614@@ -1607,7 +1607,7 @@ gld${EMULATION_NAME}_after_open (void)
1615 if (bfd_get_flavour (link_info.output_bfd) != bfd_target_coff_flavour
1616 || coff_data (link_info.output_bfd) == NULL
1617 || !obj_pe (link_info.output_bfd))
1618- fatal (_("%P: cannot perform PE operations on non PE output file '%pB'\n"),
1619+ fatal (_("%F%P: cannot perform PE operations on non PE output file '%pB'\n"),
1620 link_info.output_bfd);
1621
1622 pe_data (link_info.output_bfd)->pe_opthdr = pe;
1623@@ -1680,7 +1680,7 @@ gld${EMULATION_NAME}_after_open (void)
1624 These will only be created if the output format is an arm format,
1625 hence we do not support linking and changing output formats at the
1626 same time. Use a link followed by objcopy to change output formats. */
1627- fatal (_("%P: error: cannot change output format "
1628+ fatal (_("%F%P: error: cannot change output format "
1629 "whilst linking %s binaries\n"), "ARM");
1630 return;
1631 }
1632@@ -1740,7 +1740,7 @@ gld${EMULATION_NAME}_after_open (void)
1633
1634 if (!bfd_generic_link_read_symbols (is->the_bfd))
1635 {
1636- fatal (_("%P: %pB: could not read symbols: %E\n"),
1637+ fatal (_("%F%P: %pB: could not read symbols: %E\n"),
1638 is->the_bfd);
1639 return;
1640 }
1641@@ -1912,7 +1912,7 @@ gld${EMULATION_NAME}_after_open (void)
1642
1643 if (!bfd_generic_link_read_symbols (is->the_bfd))
1644 {
1645- fatal (_("%P: %pB: could not read symbols: %E\n"),
1646+ fatal (_("%F%P: %pB: could not read symbols: %E\n"),
1647 is->the_bfd);
1648 return;
1649 }
1650@@ -2023,7 +2023,7 @@ gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBU
1651
1652 h = bfd_link_hash_lookup (link_info.hash, buf, true, true, true);
1653 if (h == (struct bfd_link_hash_entry *) NULL)
1654- fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
1655+ fatal (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
1656 if (h->type == bfd_link_hash_new)
1657 {
1658 h->type = bfd_link_hash_undefined;
1659diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
1660index 2d033dd3..ac0e192f 100644
1661--- a/ld/emultempl/pep.em
1662+++ b/ld/emultempl/pep.em
1663@@ -698,7 +698,7 @@ set_pep_subsystem (void)
1664
1665 if (v[i].name == NULL)
1666 {
1667- fatal (_("%P: invalid subsystem type %s\n"), optarg);
1668+ fatal (_("%F%P: invalid subsystem type %s\n"), optarg);
1669 return;
1670 }
1671
1672@@ -719,7 +719,7 @@ set_pep_value (char *name)
1673 set_pep_name (name, (bfd_vma) strtoull (optarg, &end, 0));
1674
1675 if (end == optarg)
1676- fatal (_("%P: invalid hex number for PE parameter '%s'\n"), optarg);
1677+ fatal (_("%F%P: invalid hex number for PE parameter '%s'\n"), optarg);
1678
1679 optarg = end;
1680 }
1681@@ -736,7 +736,7 @@ set_pep_stack_heap (char *resname, char *comname)
1682 set_pep_value (comname);
1683 }
1684 else if (*optarg)
1685- fatal (_("%P: strange hex info for PE parameter '%s'\n"), optarg);
1686+ fatal (_("%F%P: strange hex info for PE parameter '%s'\n"), optarg);
1687 }
1688
1689 #define DEFAULT_BUILD_ID_STYLE "md5"
1690@@ -753,7 +753,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
1691 case OPTION_BASE_FILE:
1692 link_info.base_file = fopen (optarg, FOPEN_WB);
1693 if (link_info.base_file == NULL)
1694- fatal (_("%P: cannot open base file %s\n"), optarg);
1695+ fatal (_("%F%P: cannot open base file %s\n"), optarg);
1696 break;
1697
1698 /* PE options. */
1699@@ -1306,7 +1306,7 @@ make_runtime_ref (void)
1700 = bfd_wrapped_link_hash_lookup (link_info.output_bfd, &link_info,
1701 rr, true, false, true);
1702 if (!h)
1703- fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
1704+ fatal (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
1705 else
1706 {
1707 if (h->type == bfd_link_hash_new)
1708@@ -1606,7 +1606,7 @@ gld${EMULATION_NAME}_after_open (void)
1709 if (bfd_get_flavour (link_info.output_bfd) != bfd_target_coff_flavour
1710 || coff_data (link_info.output_bfd) == NULL
1711 || !obj_pe (link_info.output_bfd))
1712- fatal (_("%P: cannot perform PE operations on non PE output file '%pB'\n"),
1713+ fatal (_("%F%P: cannot perform PE operations on non PE output file '%pB'\n"),
1714 link_info.output_bfd);
1715
1716 pe_data (link_info.output_bfd)->pe_opthdr = pep;
1717@@ -1718,7 +1718,7 @@ gld${EMULATION_NAME}_after_open (void)
1718
1719 if (!bfd_generic_link_read_symbols (is->the_bfd))
1720 {
1721- fatal (_("%P: %pB: could not read symbols: %E\n"),
1722+ fatal (_("%F%P: %pB: could not read symbols: %E\n"),
1723 is->the_bfd);
1724 return;
1725 }
1726@@ -1907,7 +1907,7 @@ gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBU
1727
1728 h = bfd_link_hash_lookup (link_info.hash, buf, true, true, true);
1729 if (h == (struct bfd_link_hash_entry *) NULL)
1730- fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
1731+ fatal (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
1732 if (h->type == bfd_link_hash_new)
1733 {
1734 h->type = bfd_link_hash_undefined;
1735diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em
1736index ffacadc6..73bad022 100644
1737--- a/ld/emultempl/ppc32elf.em
1738+++ b/ld/emultempl/ppc32elf.em
1739@@ -386,7 +386,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1740 char *end;
1741 unsigned long val = strtoul (optarg, &end, 0);
1742 if (*end || val > 5)
1743- fatal (_("%P: invalid --plt-align `%s'\''\n"), optarg);
1744+ fatal (_("%F%P: invalid --plt-align `%s'\''\n"), optarg);
1745 params.plt_stub_align = val;
1746 }
1747 else
1748@@ -419,7 +419,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1749 if (*end
1750 || (params.pagesize < 4096 && params.pagesize != 0)
1751 || params.pagesize != (params.pagesize & -params.pagesize))
1752- fatal (_("%P: invalid pagesize `%s'\''\n"), optarg);
1753+ fatal (_("%F%P: invalid pagesize `%s'\''\n"), optarg);
1754 }
1755 break;
1756
1757diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
1758index 92bf4f58..a884f6b5 100644
1759--- a/ld/emultempl/ppc64elf.em
1760+++ b/ld/emultempl/ppc64elf.em
1761@@ -91,7 +91,7 @@ ppc_create_output_section_statements (void)
1762 bfd_get_arch (link_info.output_bfd),
1763 bfd_get_mach (link_info.output_bfd)))
1764 {
1765- fatal (_("%P: can not create BFD: %E\n"));
1766+ fatal (_("%F%P: can not create BFD: %E\n"));
1767 return;
1768 }
1769
1770@@ -101,7 +101,7 @@ ppc_create_output_section_statements (void)
1771 if (params.save_restore_funcs < 0)
1772 params.save_restore_funcs = !bfd_link_relocatable (&link_info);
1773 if (!ppc64_elf_init_stub_bfd (&link_info, &params))
1774- fatal (_("%P: can not init BFD: %E\n"));
1775+ fatal (_("%F%P: can not init BFD: %E\n"));
1776 }
1777
1778 /* Called after opening files but before mapping sections. */
1779@@ -860,7 +860,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1780 const char *end;
1781 params.group_size = bfd_scan_vma (optarg, &end, 0);
1782 if (*end)
1783- fatal (_("%P: invalid number `%s'\''\n"), optarg);
1784+ fatal (_("%F%P: invalid number `%s'\''\n"), optarg);
1785 }
1786 break;
1787
1788@@ -886,7 +886,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1789 char *end;
1790 long val = strtol (optarg, &end, 0);
1791 if (*end || (unsigned long) val + 8 > 16)
1792- fatal (_("%P: invalid --plt-align `%s'\''\n"), optarg);
1793+ fatal (_("%F%P: invalid --plt-align `%s'\''\n"), optarg);
1794 params.plt_stub_align = val;
1795 }
1796 else
1797@@ -915,7 +915,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}'
1798 else if (strcasecmp (optarg, "no") == 0)
1799 params.power10_stubs = 0;
1800 else
1801- fatal (_("%P: invalid --power10-stubs argument `%s'\''\n"),
1802+ fatal (_("%F%P: invalid --power10-stubs argument `%s'\''\n"),
1803 optarg);
1804 }
1805 else
1806diff --git a/ld/emultempl/riscvelf.em b/ld/emultempl/riscvelf.em
1807index 006e4edb..d5012b33 100644
1808--- a/ld/emultempl/riscvelf.em
1809+++ b/ld/emultempl/riscvelf.em
1810@@ -141,7 +141,7 @@ riscv_create_output_section_statements (void)
1811 These will only be created if the output format is a RISC-V format,
1812 hence we do not support linking and changing output formats at the
1813 same time. Use a link followed by objcopy to change output formats. */
1814- fatal (_("%P: error: cannot change output format"
1815+ fatal (_("%F%P: error: cannot change output format"
1816 " whilst linking %s binaries\n"), "RISC-V");
1817 return;
1818 }
1819diff --git a/ld/emultempl/s390.em b/ld/emultempl/s390.em
1820index 0a93d76b..bb589069 100644
1821--- a/ld/emultempl/s390.em
1822+++ b/ld/emultempl/s390.em
1823@@ -34,7 +34,7 @@ static void
1824 s390_elf_create_output_section_statements (void)
1825 {
1826 if (!bfd_elf_s390_set_options (&link_info, &params))
1827- fatal (_("%P: can not init BFD: %E\n"));
1828+ fatal (_("%F%P: can not init BFD: %E\n"));
1829 }
1830
1831 EOF
1832diff --git a/ld/emultempl/scoreelf.em b/ld/emultempl/scoreelf.em
1833index 6413f330..e420a7bd 100644
1834--- a/ld/emultempl/scoreelf.em
1835+++ b/ld/emultempl/scoreelf.em
1836@@ -62,7 +62,7 @@ score_elf_after_open (void)
1837 These will only be created if the output format is an score format,
1838 hence we do not support linking and changing output formats at the
1839 same time. Use a link followed by objcopy to change output formats. */
1840- fatal (_("%P: error: cannot change output format "
1841+ fatal (_("%F%P: error: cannot change output format "
1842 "whilst linking %s binaries\n"), "S+core");
1843 return;
1844 }
1845diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
1846index c694b828..800cca30 100644
1847--- a/ld/emultempl/spuelf.em
1848+++ b/ld/emultempl/spuelf.em
1849@@ -202,7 +202,7 @@ spu_elf_load_ovl_mgr (void)
1850 /* User supplied __ovly_load. */
1851 }
1852 else if (mgr_stream->start == mgr_stream->end)
1853- fatal (_("%P: no built-in overlay manager\n"));
1854+ fatal (_("%F%P: no built-in overlay manager\n"));
1855 else
1856 {
1857 lang_input_statement_type *ovl_is;
1858@@ -379,7 +379,7 @@ spu_elf_open_overlay_script (void)
1859 if (script == NULL)
1860 {
1861 file_err:
1862- fatal (_("%P: can not open script: %E\n"));
1863+ fatal (_("%F%P: can not open script: %E\n"));
1864 }
1865 return script;
1866 }
1867@@ -719,7 +719,7 @@ PARSE_AND_LIST_ARGS_CASES='
1868 if (*end == 0)
1869 break;
1870 }
1871- fatal (_("%P: invalid --local-store address range `%s'\''\n"), optarg);
1872+ fatal (_("%F%P: invalid --local-store address range `%s'\''\n"), optarg);
1873 }
1874 break;
1875
1876@@ -755,12 +755,12 @@ PARSE_AND_LIST_ARGS_CASES='
1877 if (!num_lines_set)
1878 params.num_lines = 32;
1879 else if ((params.num_lines & -params.num_lines) != params.num_lines)
1880- fatal (_("%P: invalid --num-lines/--num-regions `%u'\''\n"),
1881+ fatal (_("%F%P: invalid --num-lines/--num-regions `%u'\''\n"),
1882 params.num_lines);
1883 if (!line_size_set)
1884 params.line_size = 1024;
1885 else if ((params.line_size & -params.line_size) != params.line_size)
1886- fatal (_("%P: invalid --line-size/--region-size `%u'\''\n"),
1887+ fatal (_("%F%P: invalid --line-size/--region-size `%u'\''\n"),
1888 params.line_size);
1889 break;
1890
1891@@ -781,7 +781,7 @@ PARSE_AND_LIST_ARGS_CASES='
1892 && (params.ovly_flavour != ovly_soft_icache
1893 || (params.num_lines & -params.num_lines) == params.num_lines))
1894 break;
1895- fatal (_("%P: invalid --num-lines/--num-regions `%s'\''\n"), optarg);
1896+ fatal (_("%F%P: invalid --num-lines/--num-regions `%s'\''\n"), optarg);
1897 }
1898 break;
1899
1900@@ -794,7 +794,7 @@ PARSE_AND_LIST_ARGS_CASES='
1901 && (params.ovly_flavour != ovly_soft_icache
1902 || (params.line_size & -params.line_size) == params.line_size))
1903 break;
1904- fatal (_("%P: invalid --line-size/--region-size `%s'\''\n"), optarg);
1905+ fatal (_("%F%P: invalid --line-size/--region-size `%s'\''\n"), optarg);
1906 }
1907 break;
1908
1909@@ -803,7 +803,7 @@ PARSE_AND_LIST_ARGS_CASES='
1910 char *end;
1911 params.auto_overlay_fixed = strtoul (optarg, &end, 0);
1912 if (*end != 0)
1913- fatal (_("%P: invalid --fixed-space value `%s'\''\n"), optarg);
1914+ fatal (_("%F%P: invalid --fixed-space value `%s'\''\n"), optarg);
1915 }
1916 break;
1917
1918@@ -812,7 +812,7 @@ PARSE_AND_LIST_ARGS_CASES='
1919 char *end;
1920 params.auto_overlay_reserved = strtoul (optarg, &end, 0);
1921 if (*end != 0)
1922- fatal (_("%P: invalid --reserved-space value `%s'\''\n"), optarg);
1923+ fatal (_("%F%P: invalid --reserved-space value `%s'\''\n"), optarg);
1924 }
1925 break;
1926
1927@@ -821,7 +821,7 @@ PARSE_AND_LIST_ARGS_CASES='
1928 char *end;
1929 params.extra_stack_space = strtol (optarg, &end, 0);
1930 if (*end != 0)
1931- fatal (_("%P: invalid --extra-stack-space value `%s'\''\n"), optarg);
1932+ fatal (_("%F%P: invalid --extra-stack-space value `%s'\''\n"), optarg);
1933 }
1934 break;
1935
1936diff --git a/ld/emultempl/tic6xdsbt.em b/ld/emultempl/tic6xdsbt.em
1937index a830be7e..7d3b97cc 100644
1938--- a/ld/emultempl/tic6xdsbt.em
1939+++ b/ld/emultempl/tic6xdsbt.em
1940@@ -59,7 +59,7 @@ tic6x_after_open (void)
1941 if (is_tic6x_target ())
1942 {
1943 if (params.dsbt_index >= params.dsbt_size)
1944- fatal (_("%P: invalid --dsbt-index %d, outside DSBT size\n"),
1945+ fatal (_("%F%P: invalid --dsbt-index %d, outside DSBT size\n"),
1946 params.dsbt_index);
1947 elf32_tic6x_setup (&link_info, &params);
1948 }
1949@@ -190,7 +190,7 @@ PARSE_AND_LIST_ARGS_CASES='
1950 if (*end == 0
1951 && params.dsbt_index >= 0 && params.dsbt_index < 0x7fff)
1952 break;
1953- fatal (_("%P: invalid --dsbt-index %s\n"), optarg);
1954+ fatal (_("%F%P: invalid --dsbt-index %s\n"), optarg);
1955 }
1956 break;
1957 case OPTION_DSBT_SIZE:
1958@@ -200,7 +200,7 @@ PARSE_AND_LIST_ARGS_CASES='
1959 if (*end == 0
1960 && params.dsbt_size >= 0 && params.dsbt_size < 0x7fff)
1961 break;
1962- fatal (_("%P: invalid --dsbt-size %s\n"), optarg);
1963+ fatal (_("%F%P: invalid --dsbt-size %s\n"), optarg);
1964 }
1965 break;
1966 case OPTION_NO_MERGE_EXIDX_ENTRIES:
1967diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em
1968index bbf30f4a..5d0feede 100644
1969--- a/ld/emultempl/ticoff.em
1970+++ b/ld/emultempl/ticoff.em
1971@@ -88,7 +88,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
1972 lang_add_output_format (buf, NULL, NULL, 0);
1973 }
1974 else
1975- fatal (_("%P: invalid COFF format version %s\n"), optarg);
1976+ fatal (_("%F%P: invalid COFF format version %s\n"), optarg);
1977 break;
1978 }
1979 return false;
1980diff --git a/ld/emultempl/v850elf.em b/ld/emultempl/v850elf.em
1981index 49ad2cc8..925e3994 100644
1982--- a/ld/emultempl/v850elf.em
1983+++ b/ld/emultempl/v850elf.em
1984@@ -63,7 +63,7 @@ v850_create_output_section_statements (void)
1985 These will only be created if the output format is an arm format,
1986 hence we do not support linking and changing output formats at the
1987 same time. Use a link followed by objcopy to change output formats. */
1988- fatal (_("%P: error: cannot change output format"
1989+ fatal (_("%F%P: error: cannot change output format"
1990 " whilst linking %s binaries\n"), "V850");
1991 return;
1992 }
1993diff --git a/ld/emultempl/vms.em b/ld/emultempl/vms.em
1994index 4ca2c942..1c7b426c 100644
1995--- a/ld/emultempl/vms.em
1996+++ b/ld/emultempl/vms.em
1997@@ -201,7 +201,7 @@ gld${EMULATION_NAME}_before_allocation (void)
1998 && bed->elf_backend_size_dynamic_sections
1999 && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd,
2000 &link_info))
2001- fatal (_("%P: failed to set dynamic section sizes: %E\n"));
2002+ fatal (_("%F%P: failed to set dynamic section sizes: %E\n"));
2003
2004 before_allocation_default ();
2005 }
2006diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
2007index 208f730d..751e7762 100644
2008--- a/ld/emultempl/xtensaelf.em
2009+++ b/ld/emultempl/xtensaelf.em
2010@@ -388,7 +388,7 @@ check_xtensa_info (bfd *abfd, asection *info_sec)
2011
2012 data = xmalloc (info_sec->size);
2013 if (! bfd_get_section_contents (abfd, info_sec, data, 0, info_sec->size))
2014- fatal (_("%P: %pB: cannot read contents of section %pA\n"), abfd, info_sec);
2015+ fatal (_("%F%P: %pB: cannot read contents of section %pA\n"), abfd, info_sec);
2016
2017 if (info_sec->size > 24
2018 && info_sec->size >= 24 + bfd_get_32 (abfd, data + 4)
2019@@ -429,13 +429,13 @@ elf_xtensa_before_allocation (void)
2020 if (is_big_endian
2021 && link_info.output_bfd->xvec->byteorder == BFD_ENDIAN_LITTLE)
2022 {
2023- fatal (_("%P: little endian output does not match "
2024+ fatal (_("%F%P: little endian output does not match "
2025 "Xtensa configuration\n"));
2026 }
2027 if (!is_big_endian
2028 && link_info.output_bfd->xvec->byteorder == BFD_ENDIAN_BIG)
2029 {
2030- fatal (_("%P: big endian output does not match "
2031+ fatal (_("%F%P: big endian output does not match "
2032 "Xtensa configuration\n"));
2033 }
2034
2035@@ -454,7 +454,7 @@ elf_xtensa_before_allocation (void)
2036 cannot go any further if there are any mismatches. */
2037 if ((is_big_endian && f->the_bfd->xvec->byteorder == BFD_ENDIAN_LITTLE)
2038 || (!is_big_endian && f->the_bfd->xvec->byteorder == BFD_ENDIAN_BIG))
2039- fatal (_("%P: cross-endian linking for %pB not supported\n"),
2040+ fatal (_("%F%P: cross-endian linking for %pB not supported\n"),
2041 f->the_bfd);
2042
2043 if (! first_bfd)
2044@@ -485,7 +485,7 @@ elf_xtensa_before_allocation (void)
2045 info_sec = bfd_make_section_with_flags (first_bfd, ".xtensa.info",
2046 SEC_HAS_CONTENTS | SEC_READONLY);
2047 if (! info_sec)
2048- fatal (_("%P: failed to create .xtensa.info section\n"));
2049+ fatal (_("%F%P: failed to create .xtensa.info section\n"));
2050 }
2051 if (info_sec)
2052 {
2053@@ -1224,7 +1224,7 @@ ld_build_required_section_dependence (lang_statement_union_type *s)
2054 lang_statement_union_type *l = iter_stack_current (&stack);
2055
2056 if (l == NULL && link_info.non_contiguous_regions)
2057- fatal (_("%P: Relaxation not supported with "
2058+ fatal (_("%F%P: Relaxation not supported with "
2059 "--enable-non-contiguous-regions.\n"));
2060
2061 if (l->header.type == lang_input_section_enum)
2062diff --git a/ld/emultempl/z80.em b/ld/emultempl/z80.em
2063index 555f6024..06cfa72e 100644
2064--- a/ld/emultempl/z80.em
2065+++ b/ld/emultempl/z80.em
2066@@ -48,7 +48,7 @@ z80_after_open (void)
2067 const bfd_arch_info_type *info;
2068 info = bfd_arch_get_compatible (link_info.output_bfd, abfd, false);
2069 if (info == NULL)
2070- fatal (_("%P: %pB: Instruction sets of object files incompatible\n"),
2071+ fatal (_("%F%P: %pB: Instruction sets of object files incompatible\n"),
2072 abfd);
2073 else
2074 bfd_set_arch_info (link_info.output_bfd, info);
2075diff --git a/ld/ldcref.c b/ld/ldcref.c
2076index 572d4f4d..68dd2a5f 100644
2077--- a/ld/ldcref.c
2078+++ b/ld/ldcref.c
2079@@ -514,7 +514,7 @@ check_local_sym_xref (lang_input_statement_type *statement)
2080 return;
2081
2082 if (!bfd_generic_link_read_symbols (abfd))
2083- fatal (_("%P: %pB: could not read symbols: %E\n"), abfd);
2084+ fatal (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
2085
2086 for (syms = bfd_get_outsymbols (abfd); *syms; ++syms)
2087 {
2088@@ -625,7 +625,7 @@ check_refs (const char *name,
2089 BFD might contain a prohibited cross reference. */
2090
2091 if (!bfd_generic_link_read_symbols (abfd))
2092- fatal (_("%P: %pB: could not read symbols: %E\n"), abfd);
2093+ fatal (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
2094
2095 info.sym_name = name;
2096 info.global = global;
2097@@ -687,14 +687,14 @@ check_reloc_refs (bfd *abfd, asection *sec, void *iarg)
2098
2099 relsize = bfd_get_reloc_upper_bound (abfd, sec);
2100 if (relsize < 0)
2101- fatal (_("%P: %pB: could not read relocs: %E\n"), abfd);
2102+ fatal (_("%F%P: %pB: could not read relocs: %E\n"), abfd);
2103 if (relsize == 0)
2104 return;
2105
2106 relpp = (arelent **) xmalloc (relsize);
2107 relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols);
2108 if (relcount < 0)
2109- fatal (_("%P: %pB: could not read relocs: %E\n"), abfd);
2110+ fatal (_("%F%P: %pB: could not read relocs: %E\n"), abfd);
2111
2112 p = relpp;
2113 pend = p + relcount;
2114diff --git a/ld/ldelf.c b/ld/ldelf.c
2115index fb95b7a9..d8c0817b 100644
2116--- a/ld/ldelf.c
2117+++ b/ld/ldelf.c
2118@@ -94,7 +94,7 @@ ldelf_after_parse (void)
2119 else if (!link_info.maxpagesize_is_set)
2120 link_info.maxpagesize = link_info.commonpagesize;
2121 else
2122- fatal (_("%P: common page size (0x%v) > maximum page size (0x%v)\n"),
2123+ fatal (_("%F%P: common page size (0x%v) > maximum page size (0x%v)\n"),
2124 link_info.commonpagesize, link_info.maxpagesize);
2125 }
2126 }
2127@@ -120,7 +120,7 @@ ldelf_load_symbols (lang_input_statement_type *entry)
2128
2129 if (entry->flags.just_syms
2130 && (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) != 0)
2131- fatal (_("%P: %pB: --just-symbols may not be used on DSO\n"),
2132+ fatal (_("%F%P: %pB: --just-symbols may not be used on DSO\n"),
2133 entry->the_bfd);
2134
2135 if (link_class == 0
2136@@ -320,7 +320,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux)
2137 struct bfd_link_needed_list *needs;
2138
2139 if (! bfd_elf_get_bfd_needed_list (abfd, &needs))
2140- fatal (_("%P: %pB: bfd_elf_get_bfd_needed_list failed: %E\n"), abfd);
2141+ fatal (_("%F%P: %pB: bfd_elf_get_bfd_needed_list failed: %E\n"), abfd);
2142
2143 if (needs != NULL)
2144 {
2145@@ -368,7 +368,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux)
2146 can only check that using stat. */
2147
2148 if (bfd_stat (abfd, &global_stat) != 0)
2149- fatal (_("%P: %pB: bfd_stat failed: %E\n"), abfd);
2150+ fatal (_("%F%P: %pB: bfd_stat failed: %E\n"), abfd);
2151
2152 /* First strip off everything before the last '/'. */
2153 soname = lbasename (bfd_get_filename (abfd));
2154@@ -407,7 +407,7 @@ ldelf_try_needed (struct dt_needed *needed, int force, int is_linux)
2155
2156 /* Add this file into the symbol table. */
2157 if (! bfd_link_add_symbols (abfd, &link_info))
2158- fatal (_("%P: %pB: error adding symbols: %E\n"), abfd);
2159+ fatal (_("%F%P: %pB: error adding symbols: %E\n"), abfd);
2160
2161 return true;
2162 }
2163@@ -1205,7 +1205,7 @@ ldelf_handle_dt_needed (struct elf_link_hash_table *htab,
2164 && elf_dt_name (abfd) != NULL)
2165 {
2166 if (bfd_elf_add_dt_needed_tag (abfd, &link_info) < 0)
2167- fatal (_("%P: failed to add DT_NEEDED dynamic tag\n"));
2168+ fatal (_("%F%P: failed to add DT_NEEDED dynamic tag\n"));
2169 }
2170
2171 link_info.input_bfds_tail = save_input_bfd_tail;
2172@@ -1256,7 +1256,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
2173 bfd_get_target (link_info.output_bfd));
2174
2175 if (link_info.out_implib_bfd == NULL)
2176- fatal (_("%P: %s: can't open for writing: %E\n"),
2177+ fatal (_("%F%P: %s: can't open for writing: %E\n"),
2178 command_line.out_implib_filename);
2179 }
2180
2181@@ -1311,7 +1311,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
2182 && (elf_tdata (abfd)->elf_header->e_type == ET_EXEC
2183 || (elf_tdata (abfd)->elf_header->e_type == ET_DYN
2184 && elf_tdata (abfd)->is_pie)))
2185- fatal (_("%P: cannot use executable file '%pB' as input to a link\n"),
2186+ fatal (_("%F%P: cannot use executable file '%pB' as input to a link\n"),
2187 abfd);
2188 }
2189
2190@@ -1365,7 +1365,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
2191 }
2192 else if (seen_type != type)
2193 {
2194- fatal (_("%P: compact frame descriptions incompatible with"
2195+ fatal (_("%F%P: compact frame descriptions incompatible with"
2196 " DWARF2 .eh_frame from %pB\n"),
2197 type == DWARF2_EH_HDR ? abfd : elfbfd);
2198 break;
2199@@ -1407,7 +1407,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
2200
2201 if (link_info.eh_frame_hdr_type == COMPACT_EH_HDR)
2202 if (!bfd_elf_parse_eh_frame_entries (NULL, &link_info))
2203- fatal (_("%P: failed to parse EH frame entries\n"));
2204+ fatal (_("%F%P: failed to parse EH frame entries\n"));
2205
2206 ldelf_handle_dt_needed (htab, use_libpath, native, is_linux,
2207 is_freebsd, elfsize, prefix);
2208@@ -1664,7 +1664,7 @@ ldelf_find_exp_assignment (etree_type *exp)
2209 &link_info,
2210 exp->assign.dst, provide,
2211 exp->assign.hidden))
2212- fatal (_("%P: failed to record assignment to %s: %E\n"),
2213+ fatal (_("%F%P: failed to record assignment to %s: %E\n"),
2214 exp->assign.dst);
2215 }
2216 ldelf_find_exp_assignment (exp->assign.src);
2217@@ -1844,7 +1844,7 @@ ldelf_before_allocation (char *audit, char *depaudit,
2218 command_line.filter_shlib, audit, depaudit,
2219 (const char * const *) command_line.auxiliary_filters,
2220 &link_info, &sinterp)))
2221- fatal (_("%P: failed to set dynamic section sizes: %E\n"));
2222+ fatal (_("%F%P: failed to set dynamic section sizes: %E\n"));
2223
2224 if (sinterp != NULL)
2225 {
2226@@ -1881,8 +1881,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
2227 msg = (char *) xmalloc ((size_t) (sz + 1));
2228 if (! bfd_get_section_contents (is->the_bfd, s, msg,
2229 (file_ptr) 0, sz))
2230- fatal (_("%P: %pB: can't read contents of section %pA: %E\n"),
2231- is->the_bfd, s);
2232+ fatal (_("%F%P: %pB: can't read contents of section .gnu.warning: %E\n"),
2233+ is->the_bfd);
2234 msg[sz] = '\0';
2235 (*link_info.callbacks->warning) (&link_info, msg,
2236 (const char *) NULL, is->the_bfd,
2237@@ -1909,7 +1909,7 @@ ldelf_before_allocation (char *audit, char *depaudit,
2238 before_allocation_default ();
2239
2240 if (!bfd_elf_size_dynsym_hash_dynstr (link_info.output_bfd, &link_info))
2241- fatal (_("%P: failed to set dynamic section sizes: %E\n"));
2242+ fatal (_("%F%P: failed to set dynamic section sizes: %E\n"));
2243
2244 if (ehdr_start != NULL)
2245 {
2246diff --git a/ld/ldelfgen.c b/ld/ldelfgen.c
2247index 1b1e49ce..cceefc6d 100644
2248--- a/ld/ldelfgen.c
2249+++ b/ld/ldelfgen.c
2250@@ -282,7 +282,7 @@ ldelf_map_segments (bool need_layout)
2251 if (os_info->ordered != os_info->count
2252 && bfd_link_relocatable (&link_info))
2253 {
2254- fatal (_("%P: "
2255+ fatal (_("%F%P: "
2256 "%pA has both ordered and unordered sections\n"),
2257 os->bfd_section);
2258 return;
2259@@ -307,7 +307,7 @@ ldelf_map_segments (bool need_layout)
2260 if (!_bfd_elf_map_sections_to_segments (link_info.output_bfd,
2261 &link_info,
2262 &need_layout))
2263- fatal (_("%P: map sections to segments failed: %E\n"));
2264+ fatal (_("%F%P: map sections to segments failed: %E\n"));
2265
2266 if (phdr_size != elf_program_header_size (link_info.output_bfd))
2267 {
2268@@ -327,7 +327,7 @@ ldelf_map_segments (bool need_layout)
2269 while (need_layout && --tries);
2270
2271 if (tries == 0)
2272- fatal (_("%P: looping in map_segments\n"));
2273+ fatal (_("%F%P: looping in map_segments\n"));
2274
2275 if (bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
2276 && lang_phdr_list == NULL)
2277@@ -338,7 +338,7 @@ ldelf_map_segments (bool need_layout)
2278 = get_elf_backend_data (link_info.output_bfd);
2279 if (bed->elf_backend_strip_zero_sized_dynamic_sections
2280 && !bed->elf_backend_strip_zero_sized_dynamic_sections (&link_info))
2281- fatal (_("%P: failed to strip zero-sized dynamic sections\n"));
2282+ fatal (_("%F%P: failed to strip zero-sized dynamic sections\n"));
2283 }
2284 }
2285
2286@@ -416,7 +416,7 @@ ldelf_acquire_strings_for_ctf
2287 {
2288 if (ctf_link_add_strtab (ctf_output, ldelf_ctf_strtab_iter_cb,
2289 &args) < 0)
2290- fatal (_("%P: warning: CTF strtab association failed; strings will "
2291+ fatal (_("%F%P: warning: CTF strtab association failed; strings will "
2292 "not be shared: %s\n"),
2293 ctf_errmsg (ctf_errno (ctf_output)));
2294 }
2295@@ -443,7 +443,7 @@ ldelf_new_dynsym_for_ctf (struct ctf_dict *ctf_output, int symidx,
2296 lsym.st_value = sym->st_value;
2297 if (ctf_link_add_linker_symbol (ctf_output, &lsym) < 0)
2298 {
2299- fatal (_("%P: warning: CTF symbol addition failed; CTF will "
2300+ fatal (_("%F%P: warning: CTF symbol addition failed; CTF will "
2301 "not be tied to symbols: %s\n"),
2302 ctf_errmsg (ctf_errno (ctf_output)));
2303 }
2304@@ -453,7 +453,7 @@ ldelf_new_dynsym_for_ctf (struct ctf_dict *ctf_output, int symidx,
2305 /* Shuffle all the symbols. */
2306
2307 if (ctf_link_shuffle_syms (ctf_output) < 0)
2308- fatal (_("%P: warning: CTF symbol shuffling failed; CTF will "
2309+ fatal (_("%F%P: warning: CTF symbol shuffling failed; CTF will "
2310 "not be tied to symbols: %s\n"),
2311 ctf_errmsg (ctf_errno (ctf_output)));
2312 }
2313diff --git a/ld/ldexp.c b/ld/ldexp.c
2314index 45dffbc6..86f82a09 100644
2315--- a/ld/ldexp.c
2316+++ b/ld/ldexp.c
2317@@ -282,7 +282,7 @@ definedness_newfunc (struct bfd_hash_entry *entry,
2318 bfd_hash_allocate (table, sizeof (struct definedness_hash_entry));
2319
2320 if (ret == NULL)
2321- fatal (_("%P: bfd_hash_allocate failed creating symbol %s\n"), name);
2322+ fatal (_("%F%P: bfd_hash_allocate failed creating symbol %s\n"), name);
2323
2324 ret->by_object = 0;
2325 ret->iteration = 0;
2326@@ -313,7 +313,7 @@ update_definedness (const char *name, struct bfd_link_hash_entry *h)
2327 bfd_hash_lookup (&definedness_table, name, true, false);
2328
2329 if (defentry == NULL)
2330- fatal (_("%P: bfd_hash_lookup failed creating symbol %s\n"), name);
2331+ fatal (_("%F%P: bfd_hash_lookup failed creating symbol %s\n"), name);
2332
2333 /* If the symbol was already defined, and not by a script, then it
2334 must be defined by an object file or by the linker target code. */
2335@@ -638,7 +638,7 @@ fold_binary (etree_type *tree)
2336 expld.result.value = ((bfd_signed_vma) lhs.value
2337 % (bfd_signed_vma) expld.result.value);
2338 else if (expld.phase != lang_mark_phase_enum)
2339- fatal (_("%P:%pS %% by zero\n"), tree->binary.rhs);
2340+ fatal (_("%F%P:%pS %% by zero\n"), tree->binary.rhs);
2341 arith_result_section (&lhs);
2342 break;
2343
2344@@ -647,7 +647,7 @@ fold_binary (etree_type *tree)
2345 expld.result.value = ((bfd_signed_vma) lhs.value
2346 / (bfd_signed_vma) expld.result.value);
2347 else if (expld.phase != lang_mark_phase_enum)
2348- fatal (_("%P:%pS / by zero\n"), tree->binary.rhs);
2349+ fatal (_("%F%P:%pS / by zero\n"), tree->binary.rhs);
2350 arith_result_section (&lhs);
2351 break;
2352
2353@@ -761,7 +761,7 @@ fold_name (etree_type *tree)
2354 if (!h)
2355 {
2356 if (expld.phase != lang_first_phase_enum)
2357- fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
2358+ fatal (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
2359 }
2360 else if (h->type == bfd_link_hash_defined
2361 || h->type == bfd_link_hash_defweak)
2362@@ -789,7 +789,7 @@ fold_name (etree_type *tree)
2363 else if (expld.phase == lang_final_phase_enum
2364 || (expld.phase != lang_mark_phase_enum
2365 && expld.assigning_to_dot))
2366- fatal (_("%P:%pS: undefined symbol `%s'"
2367+ fatal (_("%F%P:%pS: undefined symbol `%s'"
2368 " referenced in expression\n"),
2369 tree, tree->name.name);
2370 else if (h->type == bfd_link_hash_new)
2371@@ -827,7 +827,7 @@ fold_name (etree_type *tree)
2372 if (os == NULL)
2373 {
2374 if (expld.phase == lang_final_phase_enum)
2375- fatal (_("%P:%pS: undefined section `%s'"
2376+ fatal (_("%F%P:%pS: undefined section `%s'"
2377 " referenced in expression\n"),
2378 tree, tree->name.name);
2379 }
2380@@ -845,7 +845,7 @@ fold_name (etree_type *tree)
2381 if (os == NULL)
2382 {
2383 if (expld.phase == lang_final_phase_enum)
2384- fatal (_("%P:%pS: undefined section `%s'"
2385+ fatal (_("%F%P:%pS: undefined section `%s'"
2386 " referenced in expression\n"),
2387 tree, tree->name.name);
2388 }
2389@@ -873,7 +873,7 @@ fold_name (etree_type *tree)
2390 if (os == NULL)
2391 {
2392 if (expld.phase == lang_final_phase_enum)
2393- fatal (_("%P:%pS: undefined section `%s'"
2394+ fatal (_("%F%P:%pS: undefined section `%s'"
2395 " referenced in expression\n"),
2396 tree, tree->name.name);
2397 new_number (0);
2398@@ -912,7 +912,7 @@ fold_name (etree_type *tree)
2399 if (mem != NULL)
2400 new_number (mem->length);
2401 else
2402- fatal (_("%P:%pS: undefined MEMORY region `%s'"
2403+ fatal (_("%F%P:%pS: undefined MEMORY region `%s'"
2404 " referenced in expression\n"),
2405 tree, tree->name.name);
2406 }
2407@@ -926,7 +926,7 @@ fold_name (etree_type *tree)
2408 if (mem != NULL)
2409 new_rel_from_abs (mem->origin);
2410 else
2411- fatal (_("%P:%pS: undefined MEMORY region `%s'"
2412+ fatal (_("%F%P:%pS: undefined MEMORY region `%s'"
2413 " referenced in expression\n"),
2414 tree, tree->name.name);
2415 }
2416@@ -938,7 +938,7 @@ fold_name (etree_type *tree)
2417 else if (strcmp (tree->name.name, "COMMONPAGESIZE") == 0)
2418 new_number (link_info.commonpagesize);
2419 else
2420- fatal (_("%P:%pS: unknown constant `%s' referenced in expression\n"),
2421+ fatal (_("%F%P:%pS: unknown constant `%s' referenced in expression\n"),
2422 tree, tree->name.name);
2423 break;
2424
2425@@ -1086,7 +1086,7 @@ exp_fold_tree_1 (etree_type *tree)
2426 if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0)
2427 {
2428 if (tree->type.node_class != etree_assign)
2429- fatal (_("%P:%pS can not PROVIDE assignment to"
2430+ fatal (_("%F%P:%pS can not PROVIDE assignment to"
2431 " location counter\n"), tree);
2432 if (expld.phase != lang_first_phase_enum)
2433 {
2434@@ -1119,11 +1119,11 @@ exp_fold_tree_1 (etree_type *tree)
2435 || expld.section == bfd_und_section_ptr)
2436 {
2437 if (expld.phase != lang_mark_phase_enum)
2438- fatal (_("%P:%pS invalid assignment to"
2439+ fatal (_("%F%P:%pS invalid assignment to"
2440 " location counter\n"), tree);
2441 }
2442 else if (expld.dotp == NULL)
2443- fatal (_("%P:%pS assignment to location counter"
2444+ fatal (_("%F%P:%pS assignment to location counter"
2445 " invalid outside of SECTIONS\n"), tree);
2446
2447 /* After allocation, assignment to dot should not be
2448@@ -1142,7 +1142,7 @@ exp_fold_tree_1 (etree_type *tree)
2449 nextdot += expld.section->vma;
2450 if (nextdot < expld.dot
2451 && expld.section != bfd_abs_section_ptr)
2452- fatal (_("%P:%pS cannot move location counter backwards"
2453+ fatal (_("%F%P:%pS cannot move location counter backwards"
2454 " (from %V to %V)\n"),
2455 tree, expld.dot, nextdot);
2456 else
2457@@ -1202,7 +1202,7 @@ exp_fold_tree_1 (etree_type *tree)
2458 h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst,
2459 true, false, true);
2460 if (h == NULL)
2461- fatal (_("%P:%s: hash creation failed\n"),
2462+ fatal (_("%F%P:%s: hash creation failed\n"),
2463 tree->assign.dst);
2464 }
2465
2466@@ -1578,7 +1578,7 @@ exp_get_vma (etree_type *tree, lang_output_section_statement_type *os,
2467 if (expld.result.valid_p)
2468 return expld.result.value;
2469 else if (name != NULL && expld.phase != lang_mark_phase_enum)
2470- fatal (_("%P:%pS: nonconstant expression for %s\n"),
2471+ fatal (_("%F%P:%pS: nonconstant expression for %s\n"),
2472 tree, name);
2473 }
2474 return def;
2475@@ -1621,7 +1621,7 @@ exp_get_fill (etree_type *tree, fill_type *def, char *name)
2476 if (!expld.result.valid_p)
2477 {
2478 if (name != NULL && expld.phase != lang_mark_phase_enum)
2479- fatal (_("%P:%pS: nonconstant expression for %s\n"),
2480+ fatal (_("%F%P:%pS: nonconstant expression for %s\n"),
2481 tree, name);
2482 return def;
2483 }
2484@@ -1681,7 +1681,7 @@ exp_get_abs_int (etree_type *tree, int def, char *name)
2485 }
2486 else if (name != NULL && expld.phase != lang_mark_phase_enum)
2487 {
2488- fatal (_("%P:%pS: nonconstant expression for %s\n"),
2489+ fatal (_("%F%P:%pS: nonconstant expression for %s\n"),
2490 tree, name);
2491 }
2492 }
2493@@ -1707,7 +1707,7 @@ ldexp_init (void)
2494 definedness_newfunc,
2495 sizeof (struct definedness_hash_entry),
2496 13))
2497- fatal (_("%P: can not create hash table: %E\n"));
2498+ fatal (_("%F%P: can not create hash table: %E\n"));
2499 }
2500
2501 /* Convert absolute symbols defined by a script from "dot" (also
2502diff --git a/ld/ldfile.c b/ld/ldfile.c
2503index ddab0d37..040a8886 100644
2504--- a/ld/ldfile.c
2505+++ b/ld/ldfile.c
2506@@ -183,7 +183,7 @@ ldfile_add_remap_file (const char * file)
2507
2508 if (*p == '\0')
2509 {
2510- fatal ("%P: malformed remap file entry: %s\n", line);
2511+ fatal ("%F%P: malformed remap file entry: %s\n", line);
2512 continue;
2513 }
2514
2515@@ -195,7 +195,7 @@ ldfile_add_remap_file (const char * file)
2516
2517 if (*p == '\0')
2518 {
2519- fatal ("%P: malformed remap file entry: %s\n", line);
2520+ fatal ("%F%P: malformed remap file entry: %s\n", line);
2521 continue;
2522 }
2523
2524@@ -365,7 +365,7 @@ ldfile_try_open_bfd (const char *attempt,
2525 if (entry->the_bfd == NULL)
2526 {
2527 if (bfd_get_error () == bfd_error_invalid_target)
2528- fatal (_("%P: invalid BFD target `%s'\n"), entry->target);
2529+ fatal (_("%F%P: invalid BFD target `%s'\n"), entry->target);
2530 return false;
2531 }
2532
2533@@ -508,7 +508,7 @@ ldfile_try_open_bfd (const char *attempt,
2534
2535 if (!entry->flags.dynamic && (entry->the_bfd->flags & DYNAMIC) != 0)
2536 {
2537- fatal (_("%P: attempted static link of dynamic object `%s'\n"),
2538+ fatal (_("%F%P: attempted static link of dynamic object `%s'\n"),
2539 attempt);
2540 bfd_close (entry->the_bfd);
2541 entry->the_bfd = NULL;
2542@@ -919,7 +919,7 @@ ldfile_open_command_file_1 (const char *name, enum script_open_style open_how)
2543 if ((open_how != script_nonT || script->open_how != script_nonT)
2544 && strcmp (name, script->name) == 0)
2545 {
2546- fatal (_("%P: error: linker script file '%s'"
2547+ fatal (_("%F%P: error: linker script file '%s'"
2548 " appears multiple times\n"), name);
2549 return;
2550 }
2551@@ -941,7 +941,7 @@ ldfile_open_command_file_1 (const char *name, enum script_open_style open_how)
2552 if (ldlex_input_stack == NULL)
2553 {
2554 bfd_set_error (bfd_error_system_call);
2555- fatal (_("%P: cannot open linker script file %s: %E\n"), name);
2556+ fatal (_("%F%P: cannot open linker script file %s: %E\n"), name);
2557 return;
2558 }
2559
2560@@ -1012,5 +1012,5 @@ ldfile_set_output_arch (const char *string, enum bfd_architecture defarch)
2561 else if (defarch != bfd_arch_unknown)
2562 ldfile_output_architecture = defarch;
2563 else
2564- fatal (_("%P: cannot represent machine `%s'\n"), string);
2565+ fatal (_("%F%P: cannot represent machine `%s'\n"), string);
2566 }
2567diff --git a/ld/ldgram.y b/ld/ldgram.y
2568index c2f1e298..81bb8fd8 100644
2569--- a/ld/ldgram.y
2570+++ b/ld/ldgram.y
2571@@ -209,7 +209,7 @@ mri_script_command:
2572 CHIP exp
2573 | CHIP exp ',' exp
2574 | NAME {
2575- fatal (_("%P: unrecognised keyword in MRI style script '%s'\n"), $1);
2576+ fatal(_("%F%P: unrecognised keyword in MRI style script '%s'\n"),$1);
2577 }
2578 | LIST {
2579 config.map_filename = "-";
2580@@ -1547,7 +1547,7 @@ yyerror (const char *arg)
2581 einfo (_("%P:%s: file format not recognized; treating as linker script\n"),
2582 ldlex_filename ());
2583 if (error_index > 0 && error_index < ERROR_NAME_MAX)
2584- fatal (_("%P:%pS: %s in %s\n"), NULL, arg, error_names[error_index - 1]);
2585+ fatal (_("%F%P:%pS: %s in %s\n"), NULL, arg, error_names[error_index - 1]);
2586 else
2587- fatal ("%P:%pS: %s\n", NULL, arg);
2588+ fatal ("%F%P:%pS: %s\n", NULL, arg);
2589 }
2590diff --git a/ld/ldlang.c b/ld/ldlang.c
2591index 9bf5fcbe..57d9a777 100644
2592--- a/ld/ldlang.c
2593+++ b/ld/ldlang.c
2594@@ -1325,7 +1325,7 @@ output_section_statement_table_init (void)
2595 output_section_statement_newfunc,
2596 sizeof (struct out_section_hash_entry),
2597 61))
2598- fatal (_("%P: can not create hash table: %E\n"));
2599+ fatal (_("%F%P: can not create hash table: %E\n"));
2600 }
2601
2602 static void
2603@@ -1453,7 +1453,7 @@ lang_memory_region_alias (const char *alias, const char *region_name)
2604 the default memory region. */
2605 if (strcmp (region_name, DEFAULT_MEMORY_REGION) == 0
2606 || strcmp (alias, DEFAULT_MEMORY_REGION) == 0)
2607- fatal (_("%P:%pS: error: alias for default memory region\n"), NULL);
2608+ fatal (_("%F%P:%pS: error: alias for default memory region\n"), NULL);
2609
2610 /* Look for the target region and check if the alias is not already
2611 in use. */
2612@@ -1464,14 +1464,14 @@ lang_memory_region_alias (const char *alias, const char *region_name)
2613 if (region == NULL && strcmp (n->name, region_name) == 0)
2614 region = r;
2615 if (strcmp (n->name, alias) == 0)
2616- fatal (_("%P:%pS: error: redefinition of memory region "
2617+ fatal (_("%F%P:%pS: error: redefinition of memory region "
2618 "alias `%s'\n"),
2619 NULL, alias);
2620 }
2621
2622 /* Check if the target region exists. */
2623 if (region == NULL)
2624- fatal (_("%P:%pS: error: memory region `%s' "
2625+ fatal (_("%F%P:%pS: error: memory region `%s' "
2626 "for alias `%s' does not exist\n"),
2627 NULL, region_name, alias);
2628
2629@@ -1532,7 +1532,7 @@ lang_output_section_statement_lookup (const char *name,
2630 if (entry == NULL)
2631 {
2632 if (create)
2633- fatal (_("%P: failed creating section `%s': %E\n"), name);
2634+ fatal (_("%F%P: failed creating section `%s': %E\n"), name);
2635 return NULL;
2636 }
2637
2638@@ -2426,7 +2426,7 @@ static void
2639 init_os (lang_output_section_statement_type *s, flagword flags)
2640 {
2641 if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
2642- fatal (_("%P: illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
2643+ fatal (_("%F%P: illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
2644
2645 if (!s->dup_output)
2646 s->bfd_section = bfd_get_section_by_name (link_info.output_bfd, s->name);
2647@@ -2435,7 +2435,7 @@ init_os (lang_output_section_statement_type *s, flagword flags)
2648 s->name, flags);
2649 if (s->bfd_section == NULL)
2650 {
2651- fatal (_("%P: output format %s cannot represent section"
2652+ fatal (_("%F%P: output format %s cannot represent section"
2653 " called %s: %E\n"),
2654 link_info.output_bfd->xvec->name, s->name);
2655 }
2656@@ -3027,7 +3027,7 @@ load_symbols (lang_input_statement_type *entry,
2657 }
2658 else if (err != bfd_error_file_not_recognized
2659 || place == NULL)
2660- fatal (_("%P: %pB: file not recognized: %E\n"), entry->the_bfd);
2661+ fatal (_("%F%P: %pB: file not recognized: %E\n"), entry->the_bfd);
2662
2663 bfd_close (entry->the_bfd);
2664 entry->the_bfd = NULL;
2665@@ -3100,7 +3100,7 @@ load_symbols (lang_input_statement_type *entry,
2666
2667 if (!bfd_check_format (member, bfd_object))
2668 {
2669- fatal (_("%P: %pB: member %pB in archive is not an object\n"),
2670+ fatal (_("%F%P: %pB: member %pB in archive is not an object\n"),
2671 entry->the_bfd, member);
2672 loaded = false;
2673 }
2674@@ -3115,7 +3115,7 @@ load_symbols (lang_input_statement_type *entry,
2675 substitute BFD for us. */
2676 if (!bfd_link_add_symbols (subsbfd, &link_info))
2677 {
2678- fatal (_("%P: %pB: error adding symbols: %E\n"), member);
2679+ fatal (_("%F%P: %pB: error adding symbols: %E\n"), member);
2680 loaded = false;
2681 }
2682 }
2683@@ -3129,7 +3129,7 @@ load_symbols (lang_input_statement_type *entry,
2684 if (bfd_link_add_symbols (entry->the_bfd, &link_info))
2685 entry->flags.loaded = true;
2686 else
2687- fatal (_("%P: %pB: error adding symbols: %E\n"), entry->the_bfd);
2688+ fatal (_("%F%P: %pB: error adding symbols: %E\n"), entry->the_bfd);
2689
2690 return entry->flags.loaded;
2691 }
2692@@ -3370,7 +3370,7 @@ open_output (const char *name)
2693 {
2694 char *in = lrealpath (f->local_sym_name);
2695 if (filename_cmp (in, out) == 0)
2696- fatal (_("%P: input file '%s' is the same as output file\n"),
2697+ fatal (_("%F%P: input file '%s' is the same as output file\n"),
2698 f->filename);
2699 free (in);
2700 }
2701@@ -3432,23 +3432,23 @@ open_output (const char *name)
2702 if (link_info.output_bfd == NULL)
2703 {
2704 if (bfd_get_error () == bfd_error_invalid_target)
2705- fatal (_("%P: target %s not found\n"), output_target);
2706+ fatal (_("%F%P: target %s not found\n"), output_target);
2707
2708- fatal (_("%P: cannot open output file %s: %E\n"), name);
2709+ fatal (_("%F%P: cannot open output file %s: %E\n"), name);
2710 }
2711
2712 delete_output_file_on_failure = true;
2713
2714 if (!bfd_set_format (link_info.output_bfd, bfd_object))
2715- fatal (_("%P: %s: can not make object file: %E\n"), name);
2716+ fatal (_("%F%P: %s: can not make object file: %E\n"), name);
2717 if (!bfd_set_arch_mach (link_info.output_bfd,
2718 ldfile_output_architecture,
2719 ldfile_output_machine))
2720- fatal (_("%P: %s: can not set architecture: %E\n"), name);
2721+ fatal (_("%F%P: %s: can not set architecture: %E\n"), name);
2722
2723 link_info.hash = bfd_link_hash_table_create (link_info.output_bfd);
2724 if (link_info.hash == NULL)
2725- fatal (_("%P: can not create hash table: %E\n"));
2726+ fatal (_("%F%P: can not create hash table: %E\n"));
2727
2728 bfd_set_gp_size (link_info.output_bfd, g_switch_value);
2729 }
2730@@ -3973,7 +3973,7 @@ insert_undefined (const char *name)
2731
2732 h = bfd_link_hash_lookup (link_info.hash, name, true, false, true);
2733 if (h == NULL)
2734- fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
2735+ fatal (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
2736 if (h->type == bfd_link_hash_new)
2737 {
2738 h->type = bfd_link_hash_undefined;
2739@@ -4259,7 +4259,7 @@ map_input_to_output_sections
2740 else if (strcmp (name, "SHT_PREINIT_ARRAY") == 0)
2741 type = SHT_PREINIT_ARRAY;
2742 else
2743- fatal (_ ("%P: invalid type for output section `%s'\n"),
2744+ fatal (_ ("%F%P: invalid type for output section `%s'\n"),
2745 os->name);
2746 }
2747 else
2748@@ -4268,7 +4268,7 @@ map_input_to_output_sections
2749 if (expld.result.valid_p)
2750 type = expld.result.value;
2751 else
2752- fatal (_ ("%P: invalid type for output section `%s'\n"),
2753+ fatal (_ ("%F%P: invalid type for output section `%s'\n"),
2754 os->name);
2755 }
2756 break;
2757@@ -4417,7 +4417,7 @@ process_insert_statements (lang_statement_union_type **start)
2758 }
2759 if (where == NULL)
2760 {
2761- fatal (_("%P: %s not found for insert\n"), i->where);
2762+ fatal (_("%F%P: %s not found for insert\n"), i->where);
2763 return;
2764 }
2765
2766@@ -5499,12 +5499,12 @@ size_input_section
2767 if (dot + TO_ADDR (i->size) > end)
2768 {
2769 if (i->flags & SEC_LINKER_CREATED)
2770- fatal (_("%P: Output section `%pA' not large enough for "
2771+ fatal (_("%F%P: Output section `%pA' not large enough for "
2772 "the linker-created stubs section `%pA'.\n"),
2773 i->output_section, i);
2774
2775 if (i->rawsize && i->rawsize != i->size)
2776- fatal (_("%P: Relaxation not supported with "
2777+ fatal (_("%F%P: Relaxation not supported with "
2778 "--enable-non-contiguous-regions (section `%pA' "
2779 "would overflow `%pA' after it changed size).\n"),
2780 i, i->output_section);
2781@@ -5860,7 +5860,7 @@ lang_size_sections_1
2782 dot += expld.result.section->vma;
2783 }
2784 else if (expld.phase != lang_mark_phase_enum)
2785- fatal (_("%P:%pS: non constant or forward reference"
2786+ fatal (_("%F%P:%pS: non constant or forward reference"
2787 " address expression for section %s\n"),
2788 os->addr_tree, os->name);
2789 }
2790@@ -5943,7 +5943,7 @@ lang_size_sections_1
2791 overridden by the using the --no-check-sections
2792 switch. */
2793 if (command_line.check_section_addresses)
2794- fatal (_("%P: error: no memory region specified"
2795+ fatal (_("%F%P: error: no memory region specified"
2796 " for loadable section `%s'\n"),
2797 bfd_section_name (os->bfd_section));
2798 else
2799@@ -6250,7 +6250,7 @@ lang_size_sections_1
2800 bool again;
2801
2802 if (!bfd_relax_section (i->owner, i, &link_info, &again))
2803- fatal (_("%P: can't relax section: %E\n"));
2804+ fatal (_("%F%P: can't relax section: %E\n"));
2805 if (again)
2806 *relax = true;
2807 }
2808@@ -6659,7 +6659,7 @@ lang_do_assignments_1 (lang_statement_union_type *s,
2809 s->data_statement.value += expld.result.section->vma;
2810 }
2811 else if (expld.phase == lang_final_phase_enum)
2812- fatal (_("%P: invalid data statement\n"));
2813+ fatal (_("%F%P: invalid data statement\n"));
2814 {
2815 unsigned int size;
2816 switch (s->data_statement.type)
2817@@ -6692,7 +6692,7 @@ lang_do_assignments_1 (lang_statement_union_type *s,
2818 if (expld.result.valid_p)
2819 s->reloc_statement.addend_value = expld.result.value;
2820 else if (expld.phase == lang_final_phase_enum)
2821- fatal (_("%P: invalid reloc statement\n"));
2822+ fatal (_("%F%P: invalid reloc statement\n"));
2823 dot += TO_ADDR (bfd_get_reloc_size (s->reloc_statement.howto));
2824 break;
2825
2826@@ -7110,7 +7110,7 @@ lang_end (void)
2827 break;
2828 }
2829 if (!sym)
2830- fatal (_("%P: --gc-sections requires a defined symbol root "
2831+ fatal (_("%F%P: --gc-sections requires a defined symbol root "
2832 "specified by -e or -u\n"));
2833 }
2834
2835@@ -7135,7 +7135,7 @@ lang_end (void)
2836 + bfd_section_vma (h->u.def.section->output_section)
2837 + h->u.def.section->output_offset);
2838 if (!bfd_set_start_address (link_info.output_bfd, val))
2839- fatal (_("%P: %s: can't set start address\n"), entry_symbol.name);
2840+ fatal (_("%F%P: %s: can't set start address\n"), entry_symbol.name);
2841 }
2842 else
2843 {
2844@@ -7148,7 +7148,7 @@ lang_end (void)
2845 if (*send == '\0')
2846 {
2847 if (!bfd_set_start_address (link_info.output_bfd, val))
2848- fatal (_("%P: can't set start address\n"));
2849+ fatal (_("%F%P: can't set start address\n"));
2850 }
2851 /* BZ 2004952: Only use the start of the entry section for executables. */
2852 else if bfd_link_executable (&link_info)
2853@@ -7167,7 +7167,7 @@ lang_end (void)
2854 bfd_section_vma (ts));
2855 if (!bfd_set_start_address (link_info.output_bfd,
2856 bfd_section_vma (ts)))
2857- fatal (_("%P: can't set start address\n"));
2858+ fatal (_("%F%P: can't set start address\n"));
2859 }
2860 else
2861 {
2862@@ -7236,7 +7236,7 @@ lang_check (void)
2863 != bfd_get_flavour (link_info.output_bfd)))
2864 && (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0)
2865 {
2866- fatal (_("%P: relocatable linking with relocations from"
2867+ fatal (_("%F%P: relocatable linking with relocations from"
2868 " format %s (%pB) to format %s (%pB) is not supported\n"),
2869 bfd_get_target (input_bfd), input_bfd,
2870 bfd_get_target (link_info.output_bfd), link_info.output_bfd);
2871@@ -7340,7 +7340,7 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info)
2872
2873 section = h->u.c.p->section;
2874 if (!bfd_define_common_symbol (link_info.output_bfd, &link_info, h))
2875- fatal (_("%P: could not define common symbol `%pT': %E\n"),
2876+ fatal (_("%F%P: could not define common symbol `%pT': %E\n"),
2877 h->root.string);
2878
2879 if (config.map_file != NULL)
2880@@ -7518,7 +7518,7 @@ lang_set_flags (lang_memory_region_type *ptr, const char *flags, int invert)
2881 break;
2882
2883 default:
2884- fatal (_("%P: invalid character %c (%d) in flags\n"),
2885+ fatal (_("%F%P: invalid character %c (%d) in flags\n"),
2886 *flags, *flags);
2887 break;
2888 }
2889@@ -7630,7 +7630,7 @@ lang_enter_output_section_statement (const char *output_section_statement_name,
2890
2891 os->align_lma_with_input = align_with_input == ALIGN_WITH_INPUT;
2892 if (os->align_lma_with_input && align != NULL)
2893- fatal (_("%P:%pS: error: align with input and explicit align specified\n"),
2894+ fatal (_("%F%P:%pS: error: align with input and explicit align specified\n"),
2895 NULL);
2896
2897 os->subsection_alignment = subalign;
2898@@ -8142,7 +8142,7 @@ lang_process (void)
2899 lang_place_undefineds ();
2900
2901 if (!bfd_section_already_linked_table_init ())
2902- fatal (_("%P: can not create hash table: %E\n"));
2903+ fatal (_("%F%P: can not create hash table: %E\n"));
2904
2905 /* A first pass through the memory regions ensures that if any region
2906 references a symbol for its origin or length then this symbol will be
2907@@ -8180,7 +8180,7 @@ lang_process (void)
2908 files = file_chain;
2909 inputfiles = input_file_chain;
2910 if (plugin_call_all_symbols_read ())
2911- fatal (_("%P: %s: plugin reported error after all symbols read\n"),
2912+ fatal (_("%F%P: %s: plugin reported error after all symbols read\n"),
2913 plugin_error_plugin ());
2914 link_info.lto_all_symbols_read = true;
2915 /* Open any newly added files, updating the file chains. */
2916@@ -8757,7 +8757,7 @@ void
2917 lang_startup (const char *name)
2918 {
2919 if (first_file->filename != NULL)
2920- fatal (_("%P: multiple STARTUP files\n"));
2921+ fatal (_("%F%P: multiple STARTUP files\n"));
2922 first_file->filename = name;
2923 first_file->local_sym_name = name;
2924 first_file->flags.real = true;
2925@@ -8981,7 +8981,7 @@ lang_record_phdrs (void)
2926 break;
2927 }
2928 if (last == NULL)
2929- fatal (_("%P: no sections assigned to phdrs\n"));
2930+ fatal (_("%F%P: no sections assigned to phdrs\n"));
2931 }
2932 pl = last;
2933 }
2934@@ -9019,7 +9019,7 @@ lang_record_phdrs (void)
2935 if (!bfd_record_phdr (link_info.output_bfd, l->type,
2936 l->flags != NULL, flags, l->at != NULL,
2937 at, l->filehdr, l->phdrs, c, secs))
2938- fatal (_("%P: bfd_record_phdr failed: %E\n"));
2939+ fatal (_("%F%P: bfd_record_phdr failed: %E\n"));
2940 }
2941
2942 free (secs);
2943diff --git a/ld/ldlex.l b/ld/ldlex.l
2944index 7cbade08..0a7d63e6 100644
2945--- a/ld/ldlex.l
2946+++ b/ld/ldlex.l
2947@@ -504,7 +504,7 @@ void
2948 lex_push_file (FILE *file, const char *name, unsigned int sysrooted)
2949 {
2950 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
2951- fatal (_("%P: includes nested too deeply\n"));
2952+ fatal (_("%F:includes nested too deeply\n"));
2953 file_name_stack[include_stack_ptr] = name;
2954 lineno_stack[include_stack_ptr] = lineno;
2955 sysrooted_stack[include_stack_ptr] = input_flags.sysrooted;
2956@@ -566,7 +566,7 @@ lex_redirect (const char *string, const char *fake_filename, unsigned int count)
2957
2958 yy_init = 0;
2959 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
2960- fatal (_("%P: macros nested too deeply\n"));
2961+ fatal (_("%F: macros nested too deeply\n"));
2962 file_name_stack[include_stack_ptr] = fake_filename;
2963 lineno_stack[include_stack_ptr] = lineno;
2964 include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
2965@@ -670,7 +670,7 @@ yy_input (char *buf, int max_size)
2966 {
2967 result = fread (buf, 1, max_size, yyin);
2968 if (result < max_size && ferror (yyin))
2969- fatal (_("%P: read in flex scanner failed\n"));
2970+ fatal (_("%F%P: read in flex scanner failed\n"));
2971 }
2972 }
2973 return result;
2974@@ -707,7 +707,7 @@ comment (void)
2975
2976 if (c == 0)
2977 {
2978- fatal (_("%P: EOF in comment\n"));
2979+ fatal (_("%F%P: EOF in comment\n"));
2980 break;
2981 }
2982 }
2983@@ -728,7 +728,7 @@ lex_warn_invalid (char *where, char *what)
2984 if (ldfile_assumed_script)
2985 {
2986 bfd_set_error (bfd_error_file_not_recognized);
2987- fatal (_("%s: file not recognized: %E\n"), ldlex_filename ());
2988+ fatal (_("%F%s: file not recognized: %E\n"), ldlex_filename ());
2989 }
2990
2991 if (! ISPRINT (*what))
2992diff --git a/ld/ldmain.c b/ld/ldmain.c
2993index a61086c3..8250ae08 100644
2994--- a/ld/ldmain.c
2995+++ b/ld/ldmain.c
2996@@ -193,7 +193,7 @@ write_dependency_file (void)
2997 out = fopen (config.dependency_file, FOPEN_WT);
2998 if (out == NULL)
2999 {
3000- fatal (_("%P: cannot open dependency file %s: %E\n"),
3001+ fatal (_("%F%P: cannot open dependency file %s: %E\n"),
3002 config.dependency_file);
3003 }
3004
3005@@ -266,7 +266,7 @@ main (int argc, char **argv)
3006 expandargv (&argc, &argv);
3007
3008 if (bfd_init () != BFD_INIT_MAGIC)
3009- fatal (_("%P: fatal error: libbfd ABI mismatch\n"));
3010+ fatal (_("%F%P: fatal error: libbfd ABI mismatch\n"));
3011
3012 bfd_set_error_program_name (program_name);
3013
3014@@ -468,13 +468,13 @@ main (int argc, char **argv)
3015 xexit (0);
3016
3017 if (link_info.inhibit_common_definition && !bfd_link_dll (&link_info))
3018- fatal (_("%P: --no-define-common may not be used without -shared\n"));
3019+ fatal (_("%F%P: --no-define-common may not be used without -shared\n"));
3020
3021 if (!lang_has_input_file)
3022 {
3023 if (version_printed || command_line.print_output_format)
3024 xexit (0);
3025- fatal (_("%P: no input files\n"));
3026+ fatal (_("%F%P: no input files\n"));
3027 }
3028
3029 if (verbose)
3030@@ -494,7 +494,7 @@ main (int argc, char **argv)
3031 if (config.map_file == (FILE *) NULL)
3032 {
3033 bfd_set_error (bfd_error_system_call);
3034- einfo (_("%P: cannot open map file %s: %E\n"),
3035+ fatal (_("%F%P: cannot open map file %s: %E\n"),
3036 config.map_filename);
3037 }
3038 }
3039@@ -569,7 +569,7 @@ main (int argc, char **argv)
3040 bfd *obfd = link_info.output_bfd;
3041 link_info.output_bfd = NULL;
3042 if (!bfd_close (obfd))
3043- fatal (_("%P: %s: final close failed: %E\n"), output_filename);
3044+ fatal (_("%F%P: %s: final close failed: %E\n"), output_filename);
3045
3046 /* If the --force-exe-suffix is enabled, and we're making an
3047 executable file and it doesn't end in .exe, copy it to one
3048@@ -596,10 +596,10 @@ main (int argc, char **argv)
3049 dst = fopen (dst_name, FOPEN_WB);
3050
3051 if (!src)
3052- fatal (_("%P: unable to open for source of copy `%s'\n"),
3053+ fatal (_("%F%P: unable to open for source of copy `%s'\n"),
3054 output_filename);
3055 if (!dst)
3056- fatal (_("%P: unable to open for destination of copy `%s'\n"),
3057+ fatal (_("%F%P: unable to open for destination of copy `%s'\n"),
3058 dst_name);
3059 while ((l = fread (buf, 1, bsize, src)) > 0)
3060 {
3061@@ -710,7 +710,7 @@ get_emulation (int argc, char **argv)
3062 i++;
3063 }
3064 else
3065- fatal (_("%P: missing argument to -m\n"));
3066+ fatal (_("%F%P: missing argument to -m\n"));
3067 }
3068 else if (strcmp (argv[i], "-mips1") == 0
3069 || strcmp (argv[i], "-mips2") == 0
3070@@ -764,11 +764,11 @@ add_ysym (const char *name)
3071 bfd_hash_newfunc,
3072 sizeof (struct bfd_hash_entry),
3073 61))
3074- fatal (_("%P: bfd_hash_table_init failed: %E\n"));
3075+ fatal (_("%F%P: bfd_hash_table_init failed: %E\n"));
3076 }
3077
3078 if (bfd_hash_lookup (link_info.notice_hash, name, true, true) == NULL)
3079- fatal (_("%P: bfd_hash_lookup failed: %E\n"));
3080+ fatal (_("%F%P: bfd_hash_lookup failed: %E\n"));
3081 }
3082
3083 void
3084@@ -781,11 +781,11 @@ add_ignoresym (struct bfd_link_info *info, const char *name)
3085 bfd_hash_newfunc,
3086 sizeof (struct bfd_hash_entry),
3087 61))
3088- fatal (_("%P: bfd_hash_table_init failed: %E\n"));
3089+ fatal (_("%F%P: bfd_hash_table_init failed: %E\n"));
3090 }
3091
3092 if (bfd_hash_lookup (info->ignore_hash, name, true, true) == NULL)
3093- fatal (_("%P: bfd_hash_lookup failed: %E\n"));
3094+ fatal (_("%F%P: bfd_hash_lookup failed: %E\n"));
3095 }
3096
3097 /* Record a symbol to be wrapped, from the --wrap option. */
3098@@ -801,11 +801,11 @@ add_wrap (const char *name)
3099 bfd_hash_newfunc,
3100 sizeof (struct bfd_hash_entry),
3101 61))
3102- fatal (_("%P: bfd_hash_table_init failed: %E\n"));
3103+ fatal (_("%F%P: bfd_hash_table_init failed: %E\n"));
3104 }
3105
3106 if (bfd_hash_lookup (link_info.wrap_hash, name, true, true) == NULL)
3107- fatal (_("%P: bfd_hash_lookup failed: %E\n"));
3108+ fatal (_("%F%P: bfd_hash_lookup failed: %E\n"));
3109 }
3110
3111 /* Handle the -retain-symbols-file option. */
3112@@ -833,7 +833,7 @@ add_keepsyms_file (const char *filename)
3113 xmalloc (sizeof (struct bfd_hash_table));
3114 if (!bfd_hash_table_init (link_info.keep_hash, bfd_hash_newfunc,
3115 sizeof (struct bfd_hash_entry)))
3116- fatal (_("%P: bfd_hash_table_init failed: %E\n"));
3117+ fatal (_("%F%P: bfd_hash_table_init failed: %E\n"));
3118
3119 bufsize = 100;
3120 buf = (char *) xmalloc (bufsize);
3121@@ -863,7 +863,7 @@ add_keepsyms_file (const char *filename)
3122 buf[len] = '\0';
3123
3124 if (bfd_hash_lookup (link_info.keep_hash, buf, true, true) == NULL)
3125- fatal (_("%P: bfd_hash_lookup for insertion failed: %E\n"));
3126+ fatal (_("%F%P: bfd_hash_lookup for insertion failed: %E\n"));
3127 }
3128 }
3129
3130@@ -1270,7 +1270,7 @@ constructor_callback (struct bfd_link_info *info,
3131 if (bfd_reloc_type_lookup (info->output_bfd, BFD_RELOC_CTOR) == NULL
3132 && (bfd_link_relocatable (info)
3133 || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL))
3134- fatal (_("%P: BFD backend error: BFD_RELOC_CTOR unsupported\n"));
3135+ fatal (_("%F%P: BFD backend error: BFD_RELOC_CTOR unsupported\n"));
3136
3137 s = set_name;
3138 if (bfd_get_symbol_leading_char (abfd) != '\0')
3139@@ -1282,7 +1282,7 @@ constructor_callback (struct bfd_link_info *info,
3140
3141 h = bfd_link_hash_lookup (info->hash, set_name, true, true, true);
3142 if (h == (struct bfd_link_hash_entry *) NULL)
3143- fatal (_("%P: bfd_link_hash_lookup failed: %E\n"));
3144+ fatal (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
3145 if (h->type == bfd_link_hash_new)
3146 {
3147 h->type = bfd_link_hash_undefined;
3148@@ -1315,7 +1315,7 @@ symbol_warning (const char *warning, const char *symbol, bfd *abfd)
3149 struct warning_callback_info cinfo;
3150
3151 if (!bfd_generic_link_read_symbols (abfd))
3152- fatal (_("%P: %pB: could not read symbols: %E\n"), abfd);
3153+ fatal (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
3154
3155 cinfo.found = false;
3156 cinfo.warning = warning;
3157@@ -1377,14 +1377,14 @@ warning_find_reloc (bfd *abfd, asection *sec, void *iarg)
3158
3159 relsize = bfd_get_reloc_upper_bound (abfd, sec);
3160 if (relsize < 0)
3161- fatal (_("%P: %pB: could not read relocs: %E\n"), abfd);
3162+ fatal (_("%F%P: %pB: could not read relocs: %E\n"), abfd);
3163 if (relsize == 0)
3164 return;
3165
3166 relpp = (arelent **) xmalloc (relsize);
3167 relcount = bfd_canonicalize_reloc (abfd, sec, relpp, info->asymbols);
3168 if (relcount < 0)
3169- fatal (_("%P: %pB: could not read relocs: %E\n"), abfd);
3170+ fatal (_("%F%P: %pB: could not read relocs: %E\n"), abfd);
3171
3172 p = relpp;
3173 pend = p + relcount;
3174diff --git a/ld/ldmisc.c b/ld/ldmisc.c
3175index d1257214..1d9d0cf2 100644
3176--- a/ld/ldmisc.c
3177+++ b/ld/ldmisc.c
3178@@ -324,7 +324,7 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning)
3179 if (abfd != NULL)
3180 {
3181 if (!bfd_generic_link_read_symbols (abfd))
3182- fatal (_("%P: %pB: could not read symbols: %E\n"), abfd);
3183+ fatal (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
3184
3185 asymbols = bfd_get_outsymbols (abfd);
3186 }
3187@@ -638,7 +638,7 @@ fatal (const char *fmt, ...)
3188 void
3189 info_assert (const char *file, unsigned int line)
3190 {
3191- fatal (_("%P: internal error %s %d\n"), file, line);
3192+ fatal (_("%F%P: internal error %s %d\n"), file, line);
3193 }
3194
3195 /* ('m' for map) Format info message and print on map. */
3196@@ -707,5 +707,5 @@ ld_abort (const char *file, int line, const char *fn)
3197 else
3198 einfo (_("%P: internal error: aborting at %s:%d\n"),
3199 file, line);
3200- fatal (_("%P: please report this bug\n"));
3201+ fatal (_("%F%P: please report this bug\n"));
3202 }
3203diff --git a/ld/ldwrite.c b/ld/ldwrite.c
3204index ace5e564..216d3583 100644
3205--- a/ld/ldwrite.c
3206+++ b/ld/ldwrite.c
3207@@ -57,14 +57,14 @@ build_link_order (lang_statement_union_type *statement)
3208
3209 link_order = bfd_new_link_order (link_info.output_bfd, output_section);
3210 if (link_order == NULL)
3211- fatal (_("%P: bfd_new_link_order failed: %E\n"));
3212+ fatal (_("%F%P: bfd_new_link_order failed: %E\n"));
3213
3214 link_order->type = bfd_data_link_order;
3215 link_order->offset = statement->data_statement.output_offset;
3216 link_order->u.data.contents = bfd_alloc (link_info.output_bfd,
3217 QUAD_SIZE);
3218 if (link_order->u.data.contents == NULL)
3219- fatal (_("%P: bfd_new_link_order failed: %E\n"));
3220+ fatal (_("%F%P: bfd_new_link_order failed: %E\n"));
3221
3222 value = statement->data_statement.value;
3223
3224@@ -170,7 +170,7 @@ build_link_order (lang_statement_union_type *statement)
3225
3226 link_order = bfd_new_link_order (link_info.output_bfd, output_section);
3227 if (link_order == NULL)
3228- fatal (_("%P: bfd_new_link_order failed: %E\n"));
3229+ fatal (_("%F%P: bfd_new_link_order failed: %E\n"));
3230
3231 link_order->offset = rs->output_offset;
3232 link_order->size = bfd_get_reloc_size (rs->howto);
3233@@ -178,7 +178,7 @@ build_link_order (lang_statement_union_type *statement)
3234 link_order->u.reloc.p = (struct bfd_link_order_reloc *)
3235 bfd_alloc (link_info.output_bfd, sizeof (struct bfd_link_order_reloc));
3236 if (link_order->u.reloc.p == NULL)
3237- fatal (_("%P: bfd_new_link_order failed: %E\n"));
3238+ fatal (_("%F%P: bfd_new_link_order failed: %E\n"));
3239
3240 link_order->u.reloc.p->reloc = rs->reloc;
3241 link_order->u.reloc.p->addend = rs->addend_value;
3242@@ -224,7 +224,7 @@ build_link_order (lang_statement_union_type *statement)
3243 link_order = bfd_new_link_order (link_info.output_bfd,
3244 output_section);
3245 if (link_order == NULL)
3246- fatal (_("%P: bfd_new_link_order failed: %E\n"));
3247+ fatal (_("%F%P: bfd_new_link_order failed: %E\n"));
3248
3249 if ((i->flags & SEC_NEVER_LOAD) != 0
3250 && (i->flags & SEC_DEBUGGING) == 0)
3251@@ -265,7 +265,7 @@ build_link_order (lang_statement_union_type *statement)
3252 link_order = bfd_new_link_order (link_info.output_bfd,
3253 output_section);
3254 if (link_order == NULL)
3255- fatal (_("%P: bfd_new_link_order failed: %E\n"));
3256+ fatal (_("%F%P: bfd_new_link_order failed: %E\n"));
3257 link_order->type = bfd_data_link_order;
3258 link_order->size = statement->padding_statement.size;
3259 link_order->offset = statement->padding_statement.output_offset;
3260@@ -334,7 +334,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
3261 if (startswith (name, ".stab")
3262 || strcmp (name, "$GDB_SYMBOLS$") == 0)
3263 {
3264- fatal (_ ("%P: cannot create split section name for %s\n"), name);
3265+ fatal (_ ("%F%P: cannot create split section name for %s\n"), name);
3266 return NULL;
3267 }
3268 tname[5] = 0;
3269@@ -345,7 +345,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
3270 || (h = bfd_link_hash_lookup (link_info.hash,
3271 sname, true, true, false)) == NULL)
3272 {
3273- fatal (_("%P: clone section failed: %E\n"));
3274+ fatal (_("%F%P: clone section failed: %E\n"));
3275 return NULL;
3276 }
3277 free (tname);
3278@@ -552,7 +552,7 @@ ldwrite (void)
3279 out. */
3280
3281 if (bfd_get_error () != bfd_error_no_error)
3282- fatal (_("%P: final link failed: %E\n"));
3283+ fatal (_("%F%P: final link failed: %E\n"));
3284 else
3285 xexit (1);
3286 }
3287diff --git a/ld/lexsup.c b/ld/lexsup.c
3288index 00346348..2b17499c 100644
3289--- a/ld/lexsup.c
3290+++ b/ld/lexsup.c
3291@@ -810,7 +810,7 @@ parse_args (unsigned argc, char **argv)
3292 && optc != argv[last_optind][1])
3293 {
3294 if (optarg)
3295- fatal (_("%P: Error: unable to disambiguate: "
3296+ fatal (_("%F%P: Error: unable to disambiguate: "
3297 "%s (did you mean -%s ?)\n"),
3298 argv[last_optind], argv[last_optind]);
3299 else
3300@@ -851,7 +851,7 @@ parse_args (unsigned argc, char **argv)
3301 /* Fall through. */
3302
3303 default:
3304- fatal (_("%P: use the --help option for usage information\n"));
3305+ fatal (_("%F%P: use the --help option for usage information\n"));
3306 break;
3307
3308 case 1: /* File name. */
3309@@ -870,7 +870,7 @@ parse_args (unsigned argc, char **argv)
3310 || strcmp (optarg, "default") == 0)
3311 input_flags.dynamic = true;
3312 else
3313- fatal (_("%P: unrecognized -a option `%s'\n"), optarg);
3314+ fatal (_("%F%P: unrecognized -a option `%s'\n"), optarg);
3315 break;
3316 case OPTION_ASSERT:
3317 /* FIXME: We just ignore these, but we should handle them. */
3318@@ -883,7 +883,7 @@ parse_args (unsigned argc, char **argv)
3319 else if (strcmp (optarg, "pure-text") == 0)
3320 ;
3321 else
3322- fatal (_("%P: unrecognized -assert option `%s'\n"), optarg);
3323+ fatal (_("%F%P: unrecognized -assert option `%s'\n"), optarg);
3324 break;
3325 case 'A':
3326 ldfile_add_arch (optarg);
3327@@ -927,7 +927,7 @@ parse_args (unsigned argc, char **argv)
3328
3329 style = cplus_demangle_name_to_style (optarg);
3330 if (style == unknown_demangling)
3331- fatal (_("%P: unknown demangling style `%s'\n"), optarg);
3332+ fatal (_("%F%P: unknown demangling style `%s'\n"), optarg);
3333
3334 cplus_demangle_set_style (style);
3335 }
3336@@ -1034,7 +1034,7 @@ parse_args (unsigned argc, char **argv)
3337 char *end;
3338 g_switch_value = strtoul (optarg, &end, 0);
3339 if (*end)
3340- fatal (_("%P: invalid number `%s'\n"), optarg);
3341+ fatal (_("%F%P: invalid number `%s'\n"), optarg);
3342 }
3343 break;
3344 case 'g':
3345@@ -1130,7 +1130,7 @@ parse_args (unsigned argc, char **argv)
3346 link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
3347 }
3348 else
3349- fatal (_("%P: bad --unresolved-symbols option: %s\n"), optarg);
3350+ fatal (_("%F%P: bad --unresolved-symbols option: %s\n"), optarg);
3351 break;
3352 case OPTION_WARN_UNRESOLVED_SYMBOLS:
3353 link_info.warn_unresolved_syms = true;
3354@@ -1217,7 +1217,7 @@ parse_args (unsigned argc, char **argv)
3355 break;
3356 case OPTION_PLUGIN_OPT:
3357 if (plugin_opt_plugin_arg (optarg))
3358- fatal (_("%P: bad -plugin-opt option\n"));
3359+ fatal (_("%F%P: bad -plugin-opt option\n"));
3360 break;
3361 #endif /* BFD_SUPPORTS_PLUGINS */
3362 case 'q':
3363@@ -1234,10 +1234,10 @@ parse_args (unsigned argc, char **argv)
3364 an error message here. We cannot just make this a warning,
3365 increment optind, and continue because getopt is too confused
3366 and will seg-fault the next time around. */
3367- fatal(_("%P: unrecognised option: %s\n"), argv[optind]);
3368+ fatal(_("%F%P: unrecognised option: %s\n"), argv[optind]);
3369
3370 if (bfd_link_pic (&link_info))
3371- fatal (_("%P: -r and %s may not be used together\n"),
3372+ fatal (_("%F%P: -r and %s may not be used together\n"),
3373 bfd_link_dll (&link_info) ? "-shared" : "-pie");
3374
3375 link_info.type = type_relocatable;
3376@@ -1347,7 +1347,7 @@ parse_args (unsigned argc, char **argv)
3377 if (config.has_shared)
3378 {
3379 if (bfd_link_relocatable (&link_info))
3380- fatal (_("%P: -r and %s may not be used together\n"),
3381+ fatal (_("%F%P: -r and %s may not be used together\n"),
3382 "-shared");
3383
3384 link_info.type = type_dll;
3385@@ -1359,7 +1359,7 @@ parse_args (unsigned argc, char **argv)
3386 link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
3387 }
3388 else
3389- fatal (_("%P: -shared not supported\n"));
3390+ fatal (_("%F%P: -shared not supported\n"));
3391 break;
3392 case OPTION_NO_PIE:
3393 link_info.type = type_pde;
3394@@ -1368,12 +1368,12 @@ parse_args (unsigned argc, char **argv)
3395 if (config.has_shared)
3396 {
3397 if (bfd_link_relocatable (&link_info))
3398- fatal (_("%P: -r and %s may not be used together\n"), "-pie");
3399+ fatal (_("%F%P: -r and %s may not be used together\n"), "-pie");
3400
3401 link_info.type = type_pie;
3402 }
3403 else
3404- fatal (_("%P: -pie not supported\n"));
3405+ fatal (_("%F%P: -pie not supported\n"));
3406 break;
3407 case 'h': /* Used on Solaris. */
3408 case OPTION_SONAME:
3409@@ -1390,7 +1390,7 @@ parse_args (unsigned argc, char **argv)
3410 else if (strcmp (optarg, N_("ascending")) == 0)
3411 config.sort_common = sort_ascending;
3412 else
3413- fatal (_("%P: invalid common section sorting option: %s\n"),
3414+ fatal (_("%F%P: invalid common section sorting option: %s\n"),
3415 optarg);
3416 break;
3417 case OPTION_SORT_SECTION:
3418@@ -1399,7 +1399,7 @@ parse_args (unsigned argc, char **argv)
3419 else if (strcmp (optarg, N_("alignment")) == 0)
3420 sort_section = by_alignment;
3421 else
3422- fatal (_("%P: invalid section sorting option: %s\n"), optarg);
3423+ fatal (_("%F%P: invalid section sorting option: %s\n"), optarg);
3424 break;
3425 case OPTION_STATS:
3426 config.stats = true;
3427@@ -1435,14 +1435,14 @@ parse_args (unsigned argc, char **argv)
3428 /* Check for <something>=<somthing>... */
3429 optarg2 = strchr (optarg, '=');
3430 if (optarg2 == NULL)
3431- fatal (_("%P: invalid argument to option"
3432+ fatal (_("%F%P: invalid argument to option"
3433 " \"--section-start\"\n"));
3434
3435 optarg2++;
3436
3437 /* So far so good. Are all the args present? */
3438 if ((*optarg == '\0') || (*optarg2 == '\0'))
3439- fatal (_("%P: missing argument(s) to option"
3440+ fatal (_("%F%P: missing argument(s) to option"
3441 " \"--section-start\"\n"));
3442
3443 /* We must copy the section name as set_section_start
3444@@ -1486,7 +1486,7 @@ parse_args (unsigned argc, char **argv)
3445 /* Fall through. */
3446 case OPTION_UR:
3447 if (bfd_link_pic (&link_info))
3448- fatal (_("%P: -r and %s may not be used together\n"),
3449+ fatal (_("%F%P: -r and %s may not be used together\n"),
3450 bfd_link_dll (&link_info) ? "-shared" : "-pie");
3451
3452 link_info.type = type_relocatable;
3453@@ -1517,7 +1517,7 @@ parse_args (unsigned argc, char **argv)
3454 char *end;
3455 int level ATTRIBUTE_UNUSED = strtoul (optarg, &end, 0);
3456 if (*end)
3457- fatal (_("%P: invalid number `%s'\n"), optarg);
3458+ fatal (_("%F%P: invalid number `%s'\n"), optarg);
3459 #if BFD_SUPPORTS_PLUGINS
3460 report_plugin_symbols = level > 1;
3461 #endif /* BFD_SUPPORTS_PLUGINS */
3462@@ -1712,7 +1712,7 @@ parse_args (unsigned argc, char **argv)
3463 break;
3464 case ')':
3465 if (! ingroup)
3466- fatal (_("%P: group ended before it began (--help for usage)\n"));
3467+ fatal (_("%F%P: group ended before it began (--help for usage)\n"));
3468
3469 lang_leave_group ();
3470 ingroup--;
3471@@ -1728,7 +1728,7 @@ parse_args (unsigned argc, char **argv)
3472
3473 case OPTION_REMAP_INPUTS_FILE:
3474 if (! ldfile_add_remap_file (optarg))
3475- fatal (_("%P: failed to add remap file %s\n"), optarg);
3476+ fatal (_("%F%P: failed to add remap file %s\n"), optarg);
3477 break;
3478
3479 case OPTION_REMAP_INPUTS:
3480@@ -1737,7 +1737,7 @@ parse_args (unsigned argc, char **argv)
3481 if (optarg2 == NULL)
3482 /* FIXME: Should we allow --remap-inputs=@myfile as a synonym
3483 for --remap-inputs-file=myfile ? */
3484- fatal (_("%P: invalid argument to option --remap-inputs\n"));
3485+ fatal (_("%F%P: invalid argument to option --remap-inputs\n"));
3486 size_t len = optarg2 - optarg;
3487 char * pattern = xmalloc (len + 1);
3488 memcpy (pattern, optarg, len);
3489@@ -1758,7 +1758,7 @@ parse_args (unsigned argc, char **argv)
3490 char *end;
3491 bfd_size_type cache_size = strtoul (optarg, &end, 0);
3492 if (*end != '\0')
3493- fatal (_("%P: invalid cache memory size: %s\n"), optarg);
3494+ fatal (_("%F%P: invalid cache memory size: %s\n"), optarg);
3495 link_info.max_cache_size = cache_size;
3496 }
3497 break;
3498@@ -1783,7 +1783,7 @@ parse_args (unsigned argc, char **argv)
3499
3500 case OPTION_POP_STATE:
3501 if (input_flags.pushed == NULL)
3502- fatal (_("%P: no state pushed before popping\n"));
3503+ fatal (_("%F%P: no state pushed before popping\n"));
3504 else
3505 {
3506 struct lang_input_statement_flags *oldp = input_flags.pushed;
3507@@ -1806,7 +1806,7 @@ parse_args (unsigned argc, char **argv)
3508 else if (strcasecmp (optarg, "discard") == 0)
3509 config.orphan_handling = orphan_handling_discard;
3510 else
3511- fatal (_("%P: invalid argument to option"
3512+ fatal (_("%F%P: invalid argument to option"
3513 " \"--orphan-handling\"\n"));
3514 break;
3515
3516@@ -1851,7 +1851,7 @@ parse_args (unsigned argc, char **argv)
3517 else if (strcmp (optarg, "share-duplicated") == 0)
3518 config.ctf_share_duplicated = true;
3519 else
3520- fatal (_("%P: bad --ctf-share-types option: %s\n"), optarg);
3521+ fatal (_("%F%P: bad --ctf-share-types option: %s\n"), optarg);
3522 break;
3523 }
3524 }
3525@@ -2046,7 +2046,7 @@ parse_args (unsigned argc, char **argv)
3526 if (config.no_section_header)
3527 {
3528 if (bfd_link_relocatable (&link_info))
3529- fatal (_("%P: -r and -z nosectionheader may not be used together\n"));
3530+ fatal (_("%F%P: -r and -z nosectionheader may not be used together\n"));
3531
3532 link_info.strip = strip_all;
3533 }
3534@@ -2054,9 +2054,9 @@ parse_args (unsigned argc, char **argv)
3535 if (!bfd_link_dll (&link_info))
3536 {
3537 if (command_line.filter_shlib)
3538- fatal (_("%P: -F may not be used without -shared\n"));
3539+ fatal (_("%F%P: -F may not be used without -shared\n"));
3540 if (command_line.auxiliary_filters)
3541- fatal (_("%P: -f may not be used without -shared\n"));
3542+ fatal (_("%F%P: -f may not be used without -shared\n"));
3543 }
3544
3545 /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I
3546@@ -2097,7 +2097,7 @@ set_section_start (char *sect, char *valstr)
3547 const char *end;
3548 bfd_vma val = bfd_scan_vma (valstr, &end, 16);
3549 if (*end)
3550- fatal (_("%P: invalid hex number `%s'\n"), valstr);
3551+ fatal (_("%F%P: invalid hex number `%s'\n"), valstr);
3552 lang_section_start (sect, exp_intop (val), NULL);
3553 }
3554
3555@@ -2110,7 +2110,7 @@ set_segment_start (const char *section, char *valstr)
3556
3557 bfd_vma val = bfd_scan_vma (valstr, &end, 16);
3558 if (*end)
3559- fatal (_("%P: invalid hex number `%s'\n"), valstr);
3560+ fatal (_("%F%P: invalid hex number `%s'\n"), valstr);
3561 /* If we already have an entry for this segment, update the existing
3562 value. */
3563 name = section + 1;
3564diff --git a/ld/mri.c b/ld/mri.c
3565index 7c8e59fa..aea2bd44 100644
3566--- a/ld/mri.c
3567+++ b/ld/mri.c
3568@@ -288,7 +288,7 @@ mri_format (const char *name)
3569 lang_add_output_format ("srec", NULL, NULL, 1);
3570
3571 else
3572- fatal (_("%P: unknown format type %s\n"), name);
3573+ fatal (_("%F%P: unknown format type %s\n"), name);
3574 }
3575
3576 void
3577diff --git a/ld/pe-dll.c b/ld/pe-dll.c
3578index 800d00c8..ae294986 100644
3579--- a/ld/pe-dll.c
3580+++ b/ld/pe-dll.c
3581@@ -756,7 +756,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *
3582
3583 if (!bfd_generic_link_read_symbols (b))
3584 {
3585- fatal (_("%P: %pB: could not read symbols: %E\n"), b);
3586+ fatal (_("%F%P: %pB: could not read symbols: %E\n"), b);
3587 return;
3588 }
3589
3590@@ -1048,7 +1048,7 @@ build_filler_bfd (bool include_edata)
3591 bfd_get_arch (link_info.output_bfd),
3592 bfd_get_mach (link_info.output_bfd)))
3593 {
3594- fatal (_("%P: can not create BFD: %E\n"));
3595+ fatal (_("%F%P: can not create BFD: %E\n"));
3596 return;
3597 }
3598
3599@@ -1326,7 +1326,7 @@ pe_walk_relocs (struct bfd_link_info *info,
3600
3601 if (!bfd_generic_link_read_symbols (b))
3602 {
3603- fatal (_("%P: %pB: could not read symbols: %E\n"), b);
3604+ fatal (_("%F%P: %pB: could not read symbols: %E\n"), b);
3605 return;
3606 }
3607
3608@@ -1407,7 +1407,7 @@ pe_find_data_imports (const char *symhead,
3609 if (!bfd_hash_table_init (import_hash,
3610 bfd_hash_newfunc,
3611 sizeof (struct bfd_hash_entry)))
3612- fatal (_("%P: bfd_hash_table_init failed: %E\n"));
3613+ fatal (_("%F%P: bfd_hash_table_init failed: %E\n"));
3614 }
3615 else
3616 import_hash = NULL;
3617@@ -1447,7 +1447,7 @@ pe_find_data_imports (const char *symhead,
3618
3619 if (!bfd_generic_link_read_symbols (b))
3620 {
3621- fatal (_("%P: %pB: could not read symbols: %E\n"), b);
3622+ fatal (_("%F%P: %pB: could not read symbols: %E\n"), b);
3623 return;
3624 }
3625
3626@@ -1549,7 +1549,7 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
3627
3628 if (!bfd_generic_link_read_symbols (b))
3629 {
3630- fatal (_("%P: %pB: could not read symbols: %E\n"), b);
3631+ fatal (_("%F%P: %pB: could not read symbols: %E\n"), b);
3632 return;
3633 }
3634
3635diff --git a/ld/plugin.c b/ld/plugin.c
3636index 0a99d406..27f69b97 100644
3637--- a/ld/plugin.c
3638+++ b/ld/plugin.c
3639@@ -252,7 +252,7 @@ plugin_opt_plugin (const char *plugin)
3640 newplug->name = plugin;
3641 newplug->dlhandle = dlopen (plugin, RTLD_NOW);
3642 if (!newplug->dlhandle)
3643- fatal (_("%P: %s: error loading plugin: %s\n"), plugin, dlerror ());
3644+ fatal (_("%F%P: %s: error loading plugin: %s\n"), plugin, dlerror ());
3645
3646 /* Check if plugin has been loaded already. */
3647 while (curplug)
3648@@ -345,7 +345,7 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate)
3649 }
3650 }
3651 report_error:
3652- fatal (_("%P: could not create dummy IR bfd: %E\n"));
3653+ fatal (_("%F%P: could not create dummy IR bfd: %E\n"));
3654 return NULL;
3655 }
3656
3657@@ -426,7 +426,7 @@ asymbol_from_plugin_symbol (bfd *abfd, asymbol *asym,
3658 unsigned char visibility;
3659
3660 if (!elfsym)
3661- fatal (_("%P: %s: non-ELF symbol in ELF BFD!\n"), asym->name);
3662+ fatal (_("%F%P: %s: non-ELF symbol in ELF BFD!\n"), asym->name);
3663
3664 if (ldsym->def == LDPK_COMMON)
3665 {
3666@@ -437,7 +437,7 @@ asymbol_from_plugin_symbol (bfd *abfd, asymbol *asym,
3667 switch (ldsym->visibility)
3668 {
3669 default:
3670- fatal (_("%P: unknown ELF symbol visibility: %d!\n"),
3671+ fatal (_("%F%P: unknown ELF symbol visibility: %d!\n"),
3672 ldsym->visibility);
3673 return LDPS_ERR;
3674
3675@@ -555,7 +555,7 @@ get_view (const void *handle, const void **viewp)
3676
3677 /* FIXME: einfo should support %lld. */
3678 if ((off_t) size != input->filesize)
3679- fatal (_("%P: unsupported input file size: %s (%ld bytes)\n"),
3680+ fatal (_("%F%P: unsupported input file size: %s (%ld bytes)\n"),
3681 input->name, (long) input->filesize);
3682
3683 /* Check the cached view buffer. */
3684@@ -826,7 +826,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms,
3685 && blhe->type != bfd_link_hash_common)
3686 {
3687 /* We should not have a new, indirect or warning symbol here. */
3688- fatal (_("%P: %s: plugin symbol table corrupt (sym type %d)\n"),
3689+ fatal (_("%F%P: %s: plugin symbol table corrupt (sym type %d)\n"),
3690 called_plugin->name, blhe->type);
3691 }
3692
3693@@ -978,14 +978,13 @@ message (int level, const char *format, ...)
3694 case LDPL_ERROR:
3695 default:
3696 {
3697- char *newfmt = concat (_("%X%P: error: "), format, "\n",
3698+ char *newfmt = concat (level == LDPL_FATAL ? "%F" : "%X",
3699+ _("%P: error: "), format, "\n",
3700 (const char *) NULL);
3701 fflush (stdout);
3702 vfinfo (stderr, newfmt, args, true);
3703 fflush (stderr);
3704 free (newfmt);
3705- if (level == LDPL_FATAL)
3706- fatal ("");
3707 }
3708 break;
3709 }
3710@@ -1128,14 +1127,14 @@ plugin_load_plugins (void)
3711 if (!onloadfn)
3712 onloadfn = (ld_plugin_onload) dlsym (curplug->dlhandle, "_onload");
3713 if (!onloadfn)
3714- fatal (_("%P: %s: error loading plugin: %s\n"),
3715+ fatal (_("%F%P: %s: error loading plugin: %s\n"),
3716 curplug->name, dlerror ());
3717 set_tv_plugin_args (curplug, &my_tv[tv_header_size]);
3718 called_plugin = curplug;
3719 rv = (*onloadfn) (my_tv);
3720 called_plugin = NULL;
3721 if (rv != LDPS_OK)
3722- fatal (_("%P: %s: plugin error: %d\n"), curplug->name, rv);
3723+ fatal (_("%F%P: %s: plugin error: %d\n"), curplug->name, rv);
3724 curplug = curplug->next;
3725 }
3726
3727@@ -1194,7 +1193,7 @@ plugin_strdup (bfd *abfd, const char *str)
3728 strlength = strlen (str) + 1;
3729 copy = bfd_alloc (abfd, strlength);
3730 if (copy == NULL)
3731- fatal (_("%P: plugin_strdup failed to allocate memory: %s\n"),
3732+ fatal (_("%F%P: plugin_strdup failed to allocate memory: %s\n"),
3733 bfd_get_error ());
3734 memcpy (copy, str, strlength);
3735 return copy;
3736@@ -1231,7 +1230,7 @@ plugin_object_p (bfd *ibfd, bool known_used)
3737
3738 input = bfd_alloc (abfd, sizeof (*input));
3739 if (input == NULL)
3740- fatal (_("%P: plugin failed to allocate memory for input: %s\n"),
3741+ fatal (_("%F%P: plugin failed to allocate memory for input: %s\n"),
3742 bfd_get_error ());
3743
3744 if (!bfd_plugin_open_input (ibfd, &file))
3745@@ -1259,7 +1258,7 @@ plugin_object_p (bfd *ibfd, bool known_used)
3746 claimed = 0;
3747
3748 if (plugin_call_claim_file (&file, &claimed, known_used))
3749- fatal (_("%P: %s: plugin reported error claiming file\n"),
3750+ fatal (_("%F%P: %s: plugin reported error claiming file\n"),
3751 plugin_error_plugin ());
3752
3753 if (input->fd != -1
3754--
37552.43.0
3756