]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR 32603, more ld -w misbehaviour
authorAlan Modra <amodra@gmail.com>
Sun, 16 Feb 2025 13:04:55 +0000 (23:34 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 17 Feb 2025 22:46:57 +0000 (09:16 +1030)
Commit 8d97c1a53f3d claimed to replace all einfo calls using %F with
a call to fatal.  It did so only for the ld/ directory.  This patch
adds a "fatal" to linker callbacks, and replaces those calls in bfd/
too.

34 files changed:
bfd/archive.c
bfd/coff-aarch64.c
bfd/coffgen.c
bfd/elf-ifunc.c
bfd/elf-m10300.c
bfd/elf-properties.c
bfd/elf.c
bfd/elf32-arm.c
bfd/elf32-avr.c
bfd/elf32-csky.c
bfd/elf32-frv.c
bfd/elf32-hppa.c
bfd/elf32-i386.c
bfd/elf32-m68hc11.c
bfd/elf32-m68hc12.c
bfd/elf32-metag.c
bfd/elf32-spu.c
bfd/elf64-ia64-vms.c
bfd/elf64-ppc.c
bfd/elf64-x86-64.c
bfd/elflink.c
bfd/elfnn-aarch64.c
bfd/elfnn-ia64.c
bfd/elfnn-kvx.c
bfd/elfnn-loongarch.c
bfd/elfxx-aarch64.c
bfd/elfxx-sparc.c
bfd/elfxx-x86.c
bfd/linker.c
bfd/reloc.c
bfd/reloc16.c
bfd/xcofflink.c
include/bfdlink.h
ld/ldmain.c

index ef0109599e15d5eaaae0d0ab81ad2f124b21f6e7..6cda73ce90313d27e44112a199403041dc737c62 100644 (file)
@@ -744,8 +744,8 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos,
            case bfd_error_system_call:
              if (info != NULL)
                {
-                 info->callbacks->einfo
-                   (_("%F%P: %pB(%s): error opening thin archive member: %E\n"),
+                 info->callbacks->fatal
+                   (_("%P: %pB(%s): error opening thin archive member: %E\n"),
                     archive, filename);
                  break;
                }
index 60cd6f8847341f1867fbef5f8e6c6535b0c27639..af4a44dede0b9c734e7075944477f2680e1cf00a 100644 (file)
@@ -907,10 +907,8 @@ coff_pe_aarch64_relocate_section (bfd *output_bfd,
          }
 
        default:
-         info->callbacks->einfo (_("%F%P: Unhandled relocation type %u\n"),
+         info->callbacks->fatal (_("%P: Unhandled relocation type %u\n"),
                                  rel->r_type);
-         BFD_FAIL ();
-         return false;
        }
     }
 
index c734f058892c0b065f71404b1c963aeacb568f38..5dbd6666b2b781f1bd1c2c1e8bf97d43da6836ac 100644 (file)
@@ -2794,7 +2794,7 @@ _bfd_coff_section_already_linked (bfd *abfd,
 
   /* This is the first section with this name.  Record it.  */
   if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
-    info->callbacks->einfo (_("%F%P: already_linked_table: %E\n"));
+    info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
   return false;
 }
 
index f9569b85e652558c944d98d27a114cfa86f79ac0..96b828812e986cc51bb9242b978c311636d7455a 100644 (file)
@@ -139,9 +139,9 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
          || info->export_dynamic)
       && h->pointer_equality_needed)
     {
-      info->callbacks->einfo
+      info->callbacks->fatal
        /* xgettext:c-format */
-       (_("%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
+       (_("%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
           "equality in `%pB' can not be used when making an "
           "executable; recompile with -fPIE and relink with -pie\n"),
         h->root.root.string,
index ed399da904c71c75387ee158540983cedabf414d..3aeaa06e2cc3c282d21ea3b535d9639fc1d407fd 100644 (file)
@@ -2646,8 +2646,8 @@ mn10300_elf_relax_section (bfd *abfd,
   bfd_vma align_gap_adjustment;
 
   if (bfd_link_relocatable (link_info))
-    (*link_info->callbacks->einfo)
-      (_("%P%F: --relax and -r may not be used together\n"));
+    link_info->callbacks->fatal
+      (_("%P: --relax and -r may not be used together\n"));
 
   /* Assume nothing changes.  */
   *again = false;
index f150ab4899f3e086448243ede228ac1d363ff15c..39e0d4ec456662b307e194c9a8f424708130457d 100644 (file)
@@ -637,11 +637,11 @@ _bfd_elf_link_create_gnu_property_sec (struct bfd_link_info *info, bfd *elf_bfd,
                                      | SEC_HAS_CONTENTS
                                      | SEC_DATA));
   if (sec == NULL)
-    info->callbacks->einfo (_("%F%P: failed to create GNU property section\n"));
+    info->callbacks->fatal (_("%P: failed to create GNU property section\n"));
 
   if (!bfd_set_section_alignment (sec,
                                  elfclass == ELFCLASS64 ? 3 : 2))
-    info->callbacks->einfo (_("%F%pA: failed to align section\n"),
+    info->callbacks->fatal (_("%pA: failed to align section\n"),
                            sec);
 
   elf_section_type (sec) = SHT_NOTE;
index 129cac583823cbcfb6eb9dc01c3be1b9b25f5531..3f8bc838bfb34b367c500b916046a090b4015143 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5009,8 +5009,8 @@ _bfd_elf_map_sections_to_segments (bfd *abfd,
          && need_layout != NULL
          && bed->size_relative_relocs
          && !bed->size_relative_relocs (info, need_layout))
-       info->callbacks->einfo
-         (_("%F%P: failed to size relative relocations\n"));
+       info->callbacks->fatal
+         (_("%P: failed to size relative relocations\n"));
     }
 
   if (no_user_phdrs && bfd_count_sections (abfd) != 0)
index 10c93e229b6fbb2f7aa69711932a79b440913f69..5a87462cb2662412b7cfd35c55b7dea8342160b3 100644 (file)
@@ -5074,7 +5074,7 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
      section.  The user should fix his linker script.  */
   if (stub_entry->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without --enable-non-contiguous-regions.\n"),
                            stub_entry->target_section);
 
index 0c1c07426c6f0a20fbdff9520d15dba388bbad19..a98f18132ed7a2eaff8b7282f60d4a66bd5efb44 100644 (file)
@@ -2479,8 +2479,8 @@ elf32_avr_relax_section (bfd *abfd,
     shrinkable = false;
 
   if (bfd_link_relocatable (link_info))
-    (*link_info->callbacks->einfo)
-      (_("%P%F: --relax and -r may not be used together\n"));
+    link_info->callbacks->fatal
+      (_("%P: --relax and -r may not be used together\n"));
 
   htab = avr_link_hash_table (link_info);
   if (htab == NULL)
index dbb603b88bcfed31218690216b8b09b736b03db8..47a63895b55ea9d7fb58db3784a31637dd8854dc 100644 (file)
@@ -3726,7 +3726,7 @@ csky_build_one_stub (struct bfd_hash_entry *gen_entry,
      section.  The user should fix his linker script.  */
   if (stub_entry->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without --enable-non-contiguous-regions.\n"),
                            stub_entry->target_section);
 
index a7e8215ff5ee9a4a02328e9157d2cafb5b341b64..b12908643667d96fcd103a6ef70d5140c08a5656 100644 (file)
@@ -5623,8 +5623,8 @@ elf32_frvfdpic_relax_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
   struct _frvfdpic_dynamic_got_plt_info gpinfo;
 
   if (bfd_link_relocatable (info))
-    (*info->callbacks->einfo)
-      (_("%P%F: --relax and -r may not be used together\n"));
+    info->callbacks->fatal
+      (_("%P: --relax and -r may not be used together\n"));
 
   /* If we return early, we didn't change anything.  */
   *again = false;
index ba20bc63e5a575678a0f6ceb240cb3dfa3750af4..01c0fc4658eb1fd711cd93bddc8667515b05631a 100644 (file)
@@ -728,7 +728,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
         section.  The user should fix his linker script.  */
       if (hsh->target_section->output_section == NULL
          && info->non_contiguous_regions)
-       info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output "
+       info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
                                  "section. Retry without "
                                  "--enable-non-contiguous-regions.\n"),
                                hsh->target_section);
@@ -757,7 +757,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
         section.  The user should fix his linker script.  */
       if (hsh->target_section->output_section == NULL
          && info->non_contiguous_regions)
-       info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output "
+       info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
                                  "section. Retry without "
                                  "--enable-non-contiguous-regions.\n"),
                                hsh->target_section);
@@ -838,7 +838,7 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg)
         section.  The user should fix his linker script.  */
       if (hsh->target_section->output_section == NULL
          && info->non_contiguous_regions)
-       info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output "
+       info->callbacks->fatal (_("%P: Could not assign `%pA' to an output "
                                  "section. Retry without "
                                  "--enable-non-contiguous-regions.\n"),
                                hsh->target_section);
index 701cb6d5473431307b0f8b536165f524b780fb32..78ca74e247265fd12802d397fcd9f584805debcd 100644 (file)
@@ -4111,8 +4111,8 @@ elf_i386_finish_dynamic_sections (bfd *output_bfd,
     {
       if (bfd_is_abs_section (htab->elf.splt->output_section))
        {
-         info->callbacks->einfo
-           (_("%F%P: discarded output section: `%pA'\n"),
+         info->callbacks->fatal
+           (_("%P: discarded output section: `%pA'\n"),
             htab->elf.splt);
          return false;
        }
index 3b564c99afff655149d13c6ab90cee76db905eba..f70716d66a2bf8b8722c2825806b7db96f9cffd7 100644 (file)
@@ -419,7 +419,7 @@ m68hc11_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
      section.  The user should fix his linker script.  */
   if (stub_entry->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without --enable-non-contiguous-regions.\n"),
                            stub_entry->target_section);
 
index 43e550c8956bb00288dd696c2239e874edaf68dc..f8619896978754c3abee33eebc92b083cf000fee 100644 (file)
@@ -539,7 +539,7 @@ m68hc12_elf_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
      section.  The user should fix his linker script.  */
   if (stub_entry->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without --enable-non-contiguous-regions.\n"),
                            stub_entry->target_section);
 
index 479b9f4405dd8ff32004078ad430851c34dd7f39..9959a1f5dd04cc37a4637ae16da3c057d9e9248a 100644 (file)
@@ -3343,7 +3343,7 @@ metag_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
      section.  The user should fix his linker script.  */
   if (hsh->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without --enable-non-contiguous-regions.\n"),
                            hsh->target_section);
 
index a6b486736aeaac622325fecad25b9c972aa70e67..919b839671dd57a19b2cf578211a62173f6f7ba0 100644 (file)
@@ -4689,8 +4689,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info)
  file_err:
   bfd_set_error (bfd_error_system_call);
  err_exit:
-  info->callbacks->einfo (_("%F%P: auto overlay error: %E\n"));
-  xexit (1);
+  info->callbacks->fatal (_("%P: auto overlay error: %E\n"));
 }
 
 /* Provide an estimate of total stack required.  */
@@ -4743,7 +4742,7 @@ spu_elf_final_link (bfd *output_bfd, struct bfd_link_info *info)
     info->callbacks->einfo (_("%X%P: stack/lrlive analysis error: %E\n"));
 
   if (!spu_elf_build_stubs (info))
-    info->callbacks->einfo (_("%F%P: can not build overlay stubs: %E\n"));
+    info->callbacks->fatal (_("%P: can not build overlay stubs: %E\n"));
 
   return bfd_elf_final_link (output_bfd, info);
 }
index 26710bac97edf81e4934900d991674888e564f26..87cc16d71485fb1ccd3a69e11c6b509c47de9d17 100644 (file)
@@ -361,8 +361,8 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec,
   *again = false;
 
   if (bfd_link_relocatable (link_info))
-    (*link_info->callbacks->einfo)
-      (_("%P%F: --relax and -r may not be used together\n"));
+    link_info->callbacks->fatal
+      (_("%P: --relax and -r may not be used together\n"));
 
   /* Don't even try to relax for non-ELF outputs.  */
   if (!is_elf_hash_table (link_info->hash))
index 65415bd39c7efb3087eab185da6279a55915f48e..c3f22f6ba9892acc87cefde2a08f2a7cfcda9e29 100644 (file)
@@ -12294,7 +12294,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
   if (stub_entry->target_section != NULL
       && stub_entry->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without --enable-non-contiguous-regions.\n"),
                            stub_entry->target_section);
 
@@ -12302,7 +12302,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
   if (stub_entry->group->stub_sec != NULL
       && stub_entry->group->stub_sec->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without --enable-non-contiguous-regions.\n"),
                            stub_entry->group->stub_sec);
 
index 9244f86405b2445bfcfb20fe13ccd0fd098f1a2e..0e360771d1291094dd4e0f42a918b221dac3541a 100644 (file)
@@ -4093,8 +4093,8 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                              || (roff - 3 + 22) > input_section->size)
                            {
                            corrupt_input:
-                             info->callbacks->einfo
-                               (_("%F%P: corrupt input: %pB\n"),
+                             info->callbacks->fatal
+                               (_("%P: corrupt input: %pB\n"),
                                 input_bfd);
                              return false;
                            }
@@ -5122,7 +5122,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
       /* Check PC-relative offset overflow in PLT entry.  */
       if ((plt_got_pcrel_offset + 0x80000000) > 0xffffffff)
        /* xgettext:c-format */
-       info->callbacks->einfo (_("%F%pB: PC-relative offset overflow in PLT entry for `%s'\n"),
+       info->callbacks->fatal (_("%pB: PC-relative offset overflow in PLT entry for `%s'\n"),
                                output_bfd, h->root.root.string);
 
       bfd_put_32 (output_bfd, plt_got_pcrel_offset,
@@ -5195,7 +5195,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
                 will overflow first.  */
              if (plt0_offset > 0x80000000)
                /* xgettext:c-format */
-               info->callbacks->einfo (_("%F%pB: branch displacement overflow in PLT entry for `%s'\n"),
+               info->callbacks->fatal (_("%pB: branch displacement overflow in PLT entry for `%s'\n"),
                                        output_bfd, h->root.root.string);
              bfd_put_32 (output_bfd, - plt0_offset,
                          (plt->contents + h->plt.offset
@@ -5248,7 +5248,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
       if ((got_after_plt && got_pcrel_offset < 0)
          || (!got_after_plt && got_pcrel_offset > 0))
        /* xgettext:c-format */
-       info->callbacks->einfo (_("%F%pB: PC-relative offset overflow in GOT PLT entry for `%s'\n"),
+       info->callbacks->fatal (_("%pB: PC-relative offset overflow in GOT PLT entry for `%s'\n"),
                                output_bfd, h->root.root.string);
 
       bfd_put_32 (output_bfd, got_pcrel_offset,
@@ -5396,8 +5396,8 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
             generate an error instead of a reloc.  cf PR 32638.  */
          if (relgot == NULL || relgot->size == 0)
            {
-             info->callbacks->einfo (_("%F%pB: Unable to generate dynamic relocs because a suitable section does not exist\n"),
-                                       output_bfd);
+             info->callbacks->fatal (_("%pB: Unable to generate dynamic relocs because a suitable section does not exist\n"),
+                                     output_bfd);
              return false;
            }
          
@@ -5535,8 +5535,8 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
     {
       if (bfd_is_abs_section (htab->elf.splt->output_section))
        {
-         info->callbacks->einfo
-           (_("%F%P: discarded output section: `%pA'\n"),
+         info->callbacks->fatal
+           (_("%P: discarded output section: `%pA'\n"),
             htab->elf.splt);
          return false;
        }
index f65b6bf0f9524e030054e830ffbbd196f49d875c..70460573522e05af766738270a158e93052e6a60 100644 (file)
@@ -4359,8 +4359,8 @@ elf_link_add_to_first_hash (bfd *abfd, struct bfd_link_info *info,
     = ((struct elf_link_first_hash_entry *)
        bfd_hash_lookup (htab->first_hash, name, true, copy));
   if (e == NULL)
-    info->callbacks->einfo
-      (_("%F%P: %pB: failed to add %s to first hash\n"), abfd, name);
+    info->callbacks->fatal
+      (_("%P: %pB: failed to add %s to first hash\n"), abfd, name);
 
   if (e->abfd == NULL)
     /* Store ABFD in abfd.  */
@@ -4427,8 +4427,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
              || !bfd_hash_table_init
                   (htab->first_hash, elf_link_first_hash_newfunc,
                    sizeof (struct elf_link_first_hash_entry)))
-           info->callbacks->einfo
-             (_("%F%P: first_hash failed to create: %E\n"));
+           info->callbacks->fatal
+             (_("%P: first_hash failed to create: %E\n"));
        }
     }
   else
@@ -13119,8 +13119,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
   if (info->enable_dt_relr
       && bed->finish_relative_relocs
       && !bed->finish_relative_relocs (info))
-    info->callbacks->einfo
-      (_("%F%P: %pB: failed to finish relative relocations\n"), abfd);
+    info->callbacks->fatal
+      (_("%P: %pB: failed to finish relative relocations\n"), abfd);
 
   /* Since ELF permits relocations to be against local symbols, we
      must have the local symbols available when we do the relocations.
@@ -14289,7 +14289,7 @@ _bfd_elf_gc_mark_extra_sections (struct bfd_link_info *info,
          else if (strcmp (bfd_section_name (isec),
                           "__patchable_function_entries") == 0
                   && elf_linked_to_section (isec) == NULL)
-             info->callbacks->einfo (_("%F%P: %pB(%pA): error: "
+             info->callbacks->fatal (_("%P: %pB(%pA): error: "
                                        "need linked-to section "
                                        "for --gc-sections\n"),
                                      isec->owner, isec);
@@ -15466,7 +15466,7 @@ _bfd_elf_section_already_linked (bfd *abfd,
 
   /* This is the first section with this name.  Record it.  */
   if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
-    info->callbacks->einfo (_("%F%P: already_linked_table: %E\n"));
+    info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
   return sec->output_section == bfd_abs_section_ptr;
 }
 
index 9b8b86fd5d596f9d7bb66f7b431f97a0f12dccc2..968e3ee047ce5a178bca01f9948a6758a4c76fad 100644 (file)
@@ -3263,7 +3263,7 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry,
      section.  The user should fix his linker script.  */
   if (stub_entry->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without "
                              "--enable-non-contiguous-regions.\n"),
                            stub_entry->target_section);
@@ -8927,9 +8927,9 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
        asection *s = p->sec->output_section;
        if (s != NULL && (s->flags & SEC_READONLY) != 0)
          {
-           info->callbacks->einfo
+           info->callbacks->fatal
                /* xgettext:c-format */
-               (_ ("%F%P: %pB: copy relocation against non-copyable "
+               (_ ("%P: %pB: copy relocation against non-copyable "
                    "protected symbol `%s'\n"),
                 p->sec->owner, h->root.root.string);
            return false;
index 36ccfef02914edefaabb7d44bf08187b8a421488..075b3447815a5272b79a2598711f5a4891908804 100644 (file)
@@ -361,8 +361,8 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec,
   *again = false;
 
   if (bfd_link_relocatable (link_info))
-    (*link_info->callbacks->einfo)
-      (_("%P%F: --relax and -r may not be used together\n"));
+    link_info->callbacks->fatal
+      (_("%P: --relax and -r may not be used together\n"));
 
   /* Don't even try to relax for non-ELF outputs.  */
   if (!is_elf_hash_table (link_info->hash))
index 3720c5122c4e8a7cb6a97fdd98e6a7ee4ac69e0a..31dd7a5eed5b3261384072dafddf99f8ea25a689 100644 (file)
@@ -926,7 +926,7 @@ kvx_build_one_stub (struct bfd_hash_entry *gen_entry,
      section.  The user should fix his linker script.  */
   if (stub_entry->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign '%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign '%pA' to an output section. "
                              "Retry without "
                              "--enable-non-contiguous-regions.\n"),
                            stub_entry->target_section);
index 0e3bfac67f60d8a7d7896bf25240b0b949e9c22e..faad512f3396b09fdd8106daca0cd455b5a5cff2 100644 (file)
@@ -1699,9 +1699,9 @@ local_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
          || info->export_dynamic)
       && h->pointer_equality_needed)
     {
-      info->callbacks->einfo
+      info->callbacks->fatal
        /* xgettext:c-format.  */
-       (_("%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
+       (_("%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer "
           "equality in `%pB' can not be used when making an "
           "executable; recompile with -fPIE and relink with -pie\n"),
         h->root.root.string,
index e3795be2c2ccfdfbb3dd16488af5995fa5668d90..04c65a01788807c4c4eae119cf8d095f121f5fdf 100644 (file)
@@ -744,13 +744,11 @@ _bfd_aarch64_elf_create_gnu_property_section (struct bfd_link_info *info,
                                      | SEC_HAS_CONTENTS
                                      | SEC_DATA));
   if (sec == NULL)
-    info->callbacks->einfo (
-      _("%F%P: failed to create GNU property section\n"));
+    info->callbacks->fatal (_("%P: failed to create GNU property section\n"));
 
   unsigned align = (bfd_get_mach (ebfd) & bfd_mach_aarch64_ilp32) ? 2 : 3;
   if (!bfd_set_section_alignment (sec, align))
-    info->callbacks->einfo (_("%F%pA: failed to align section\n"),
-                           sec);
+    info->callbacks->fatal (_("%pA: failed to align section\n"), sec);
 
   elf_section_type (sec) = SHT_NOTE;
 }
index 1cf280f050f645694b3a257d38a7f705f5bc2a90..3d89a5f1497b678306b44548cccc255df2414fe5 100644 (file)
@@ -2687,8 +2687,8 @@ _bfd_sparc_elf_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
                              bool *again)
 {
   if (bfd_link_relocatable (link_info))
-    (*link_info->callbacks->einfo)
-      (_("%P%F: --relax and -r may not be used together\n"));
+    link_info->callbacks->fatal
+      (_("%P: --relax and -r may not be used together\n"));
 
   *again = false;
   sec_do_relax (section) = 1;
index f4bf58ec088368785e218fbe2ccf99bbbea6e46b..56514000dc4de7b7ef2f8ecb8b1b57e6df3c58ca 100644 (file)
@@ -529,9 +529,9 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
          asection *s = p->sec->output_section;
          if (s != NULL && (s->flags & SEC_READONLY) != 0)
            {
-             info->callbacks->einfo
+             info->callbacks->fatal
                /* xgettext:c-format */
-               (_("%F%P: %pB: copy relocation against non-copyable "
+               (_("%P: %pB: copy relocation against non-copyable "
                   "protected symbol `%s' in %pB\n"),
                 p->sec->owner, h->root.root.string,
                 h->root.u.def.section->owner);
@@ -1036,9 +1036,9 @@ elf_x86_relative_reloc_record_add
 
   if (relative_reloc->data == NULL)
     {
-      info->callbacks->einfo
+      info->callbacks->fatal
        /* xgettext:c-format */
-       (_("%F%P: %pB: failed to allocate relative reloc record\n"),
+       (_("%P: %pB: failed to allocate relative reloc record\n"),
         info->output_bfd);
       return false;
     }
@@ -1397,9 +1397,9 @@ elf64_dt_relr_bitmap_add
 
   if (bitmap->u.elf64 == NULL)
     {
-      info->callbacks->einfo
+      info->callbacks->fatal
        /* xgettext:c-format */
-       (_("%F%P: %pB: failed to allocate 64-bit DT_RELR bitmap\n"),
+       (_("%P: %pB: failed to allocate 64-bit DT_RELR bitmap\n"),
         info->output_bfd);
     }
 
@@ -1433,9 +1433,9 @@ elf32_dt_relr_bitmap_add
 
   if (bitmap->u.elf32 == NULL)
     {
-      info->callbacks->einfo
+      info->callbacks->fatal
        /* xgettext:c-format */
-       (_("%F%P: %pB: failed to allocate 32-bit DT_RELR bitmap\n"),
+       (_("%P: %pB: failed to allocate 32-bit DT_RELR bitmap\n"),
         info->output_bfd);
     }
 
@@ -1572,9 +1572,9 @@ elf_x86_size_or_finish_relative_reloc
                          if (!_bfd_elf_mmap_section_contents (sec->owner,
                                                               sec,
                                                               &contents))
-                           info->callbacks->einfo
+                           info->callbacks->fatal
                              /* xgettext:c-format */
-                             (_("%F%P: %pB: failed to allocate memory for section `%pA'\n"),
+                             (_("%P: %pB: failed to allocate memory for section `%pA'\n"),
                               info->output_bfd, sec);
 
                          /* Cache the section contents for
@@ -1759,9 +1759,9 @@ elf_x86_compute_dl_relr_bitmap
          *need_layout = true;
        }
       else
-       info->callbacks->einfo
+       info->callbacks->fatal
          /* xgettext:c-format */
-         (_("%F%P: %pB: size of compact relative reloc section is "
+         (_("%P: %pB: size of compact relative reloc section is "
             "changed: new (%lu) != old (%lu)\n"),
           info->output_bfd, htab->dt_relr_bitmap.count,
           dt_relr_bitmap_count);
@@ -1781,9 +1781,9 @@ elf_x86_write_dl_relr_bitmap (struct bfd_link_info *info,
 
   contents = (unsigned char *) bfd_alloc (sec->owner, size);
   if (contents == NULL)
-    info->callbacks->einfo
+    info->callbacks->fatal
       /* xgettext:c-format */
-      (_("%F%P: %pB: failed to allocate compact relative reloc section\n"),
+      (_("%P: %pB: failed to allocate compact relative reloc section\n"),
        info->output_bfd);
 
   /* Cache the section contents for elf_link_input_bfd.  */
@@ -2252,9 +2252,9 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
          else
            name = bfd_elf_sym_name (input_section->owner, symtab_hdr,
                                     sym, NULL);
-         info->callbacks->einfo
+         info->callbacks->fatal
            /* xgettext:c-format */
-           (_("%F%P: %pB: relocation %s against absolute symbol "
+           (_("%P: %pB: relocation %s against absolute symbol "
               "`%s' in section `%pA' is disallowed\n"),
             input_section->owner, internal_reloc.howto->name, name,
             input_section);
@@ -3594,9 +3594,9 @@ _bfd_x86_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
            s = p->sec->output_section;
            if (s != NULL && (s->flags & SEC_READONLY) != 0)
              {
-               info->callbacks->einfo
+               info->callbacks->fatal
                  /* xgettext:c-format */
-                 (_("%F%P: %pB: copy relocation against non-copyable "
+                 (_("%P: %pB: copy relocation against non-copyable "
                     "protected symbol `%s' in %pB\n"),
                   p->sec->owner, h->root.root.string,
                   h->root.u.def.section->owner);
@@ -4347,12 +4347,12 @@ _bfd_x86_elf_link_setup_gnu_properties
                                              | SEC_HAS_CONTENTS
                                              | SEC_DATA));
          if (sec == NULL)
-           info->callbacks->einfo (_("%F%P: failed to create GNU property section\n"));
+           info->callbacks->fatal (_("%P: failed to create GNU property section\n"));
 
          if (!bfd_set_section_alignment (sec, class_align))
            {
            error_alignment:
-             info->callbacks->einfo (_("%F%pA: failed to align section\n"),
+             info->callbacks->fatal (_("%pA: failed to align section\n"),
                                      sec);
            }
 
@@ -4666,7 +4666,7 @@ _bfd_x86_elf_link_setup_gnu_properties
       && !elf_vxworks_create_dynamic_sections (dynobj, info,
                                               &htab->srelplt2))
     {
-      info->callbacks->einfo (_("%F%P: failed to create VxWorks dynamic sections\n"));
+      info->callbacks->fatal (_("%P: failed to create VxWorks dynamic sections\n"));
       return pbfd;
     }
 
@@ -4675,7 +4675,7 @@ _bfd_x86_elf_link_setup_gnu_properties
      don't need to do it in check_relocs.  */
   if (htab->elf.sgot == NULL
       && !_bfd_elf_create_got_section (dynobj, info))
-    info->callbacks->einfo (_("%F%P: failed to create GOT sections\n"));
+    info->callbacks->fatal (_("%P: failed to create GOT sections\n"));
 
   got_align = (bed->target_id == X86_64_ELF_DATA) ? 3 : 2;
 
@@ -4693,7 +4693,7 @@ _bfd_x86_elf_link_setup_gnu_properties
   /* Create the ifunc sections here so that check_relocs can be
      simplified.  */
   if (!_bfd_elf_create_ifunc_sections (dynobj, info))
-    info->callbacks->einfo (_("%F%P: failed to create ifunc sections\n"));
+    info->callbacks->fatal (_("%P: failed to create ifunc sections\n"));
 
   plt_alignment = bfd_log2 (htab->plt.plt_entry_size);
 
@@ -4731,7 +4731,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                                    ".plt.got",
                                                    pltflags);
          if (sec == NULL)
-           info->callbacks->einfo (_("%F%P: failed to create GOT PLT section\n"));
+           info->callbacks->fatal (_("%P: failed to create GOT PLT section\n"));
 
          if (!bfd_set_section_alignment (sec, non_lazy_plt_alignment))
            goto error_alignment;
@@ -4750,7 +4750,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                                            ".plt.sec",
                                                            pltflags);
                  if (sec == NULL)
-                   info->callbacks->einfo (_("%F%P: failed to create IBT-enabled PLT section\n"));
+                   info->callbacks->fatal (_("%P: failed to create IBT-enabled PLT section\n"));
 
                  if (!bfd_set_section_alignment (sec, plt_alignment))
                    goto error_alignment;
@@ -4770,7 +4770,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                                    ".eh_frame",
                                                    flags);
          if (sec == NULL)
-           info->callbacks->einfo (_("%F%P: failed to create PLT .eh_frame section\n"));
+           info->callbacks->fatal (_("%P: failed to create PLT .eh_frame section\n"));
 
          if (!bfd_set_section_alignment (sec, class_align))
            goto error_alignment;
@@ -4783,7 +4783,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                                        ".eh_frame",
                                                        flags);
              if (sec == NULL)
-               info->callbacks->einfo (_("%F%P: failed to create GOT PLT .eh_frame section\n"));
+               info->callbacks->fatal (_("%P: failed to create GOT PLT .eh_frame section\n"));
 
              if (!bfd_set_section_alignment (sec, class_align))
                goto error_alignment;
@@ -4797,7 +4797,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                                        ".eh_frame",
                                                        flags);
              if (sec == NULL)
-               info->callbacks->einfo (_("%F%P: failed to create the second PLT .eh_frame section\n"));
+               info->callbacks->fatal (_("%P: failed to create the second PLT .eh_frame section\n"));
 
              if (!bfd_set_section_alignment (sec, class_align))
                goto error_alignment;
@@ -4817,7 +4817,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                                    ".sframe",
                                                    flags);
          if (sec == NULL)
-           info->callbacks->einfo (_("%F%P: failed to create PLT .sframe section\n"));
+           info->callbacks->fatal (_("%P: failed to create PLT .sframe section\n"));
 
          // FIXME check this
          // if (!bfd_set_section_alignment (sec, class_align))
@@ -4832,7 +4832,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                                        ".sframe",
                                                        flags);
              if (sec == NULL)
-               info->callbacks->einfo (_("%F%P: failed to create second PLT .sframe section\n"));
+               info->callbacks->fatal (_("%P: failed to create second PLT .sframe section\n"));
 
              htab->plt_second_sframe = sec;
            }
@@ -4844,7 +4844,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                                        ".sframe",
                                                        flags);
              if (sec == NULL)
-               info->callbacks->einfo (_("%F%P: failed to create PLT GOT .sframe section\n"));
+               info->callbacks->fatal (_("%P: failed to create PLT GOT .sframe section\n"));
 
              htab->plt_got_sframe = sec;
            }
index e7f0c1ad40475498f7844056e9f30341ad48eff9..3466391e19d5f38d9907ade3c47d57003a365fec 100644 (file)
@@ -3036,7 +3036,7 @@ _bfd_generic_section_already_linked (bfd *abfd ATTRIBUTE_UNUSED,
 
   /* This is the first section with this name.  Record it.  */
   if (!bfd_section_already_linked_table_insert (already_linked_list, sec))
-    info->callbacks->einfo (_("%F%P: already_linked_table: %E\n"));
+    info->callbacks->fatal (_("%P: already_linked_table: %E\n"));
   return false;
 }
 
index cbb56dd767951de4f99528693ffe291ce8c0db5f..d3ddafb7305794d5a1d595363bd6cbe4eeb0673a 100644 (file)
@@ -8366,8 +8366,8 @@ bfd_generic_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
                           bool *again)
 {
   if (bfd_link_relocatable (link_info))
-    (*link_info->callbacks->einfo)
-      (_("%P%F: --relax and -r may not be used together\n"));
+    link_info->callbacks->fatal
+      (_("%P: --relax and -r may not be used together\n"));
 
   *again = false;
   return true;
index e77a2374f9bc18034d21ed5535ac5e3bcfba68e8..2a90a1d65777d7af3f930971975302d694b94dfe 100644 (file)
@@ -151,8 +151,8 @@ bfd_coff_reloc16_relax_section (bfd *abfd,
   long reloc_count;
 
   if (bfd_link_relocatable (link_info))
-    (*link_info->callbacks->einfo)
-      (_("%P%F: --relax and -r may not be used together\n"));
+    link_info->callbacks->fatal
+      (_("%P: --relax and -r may not be used together\n"));
 
   /* We only do global relaxation once.  It is not safe to do it multiple
      times (see discussion of the "shrinks" array below).  */
index 14eb008f967d797d7e21a15f28721128ba51f353..446fa5a85f401688e8f72f348dec3879c97bb811 100644 (file)
@@ -4677,7 +4677,7 @@ xcoff_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
   if (hstub->target_section != NULL
       && hstub->target_section->output_section == NULL
       && info->non_contiguous_regions)
-    info->callbacks->einfo (_("%F%P: Could not assign `%pA' to an output section. "
+    info->callbacks->fatal (_("%P: Could not assign `%pA' to an output section. "
                              "Retry without --enable-non-contiguous-regions.\n"),
                            hstub->target_section);
 
index ae451075996498eb2c20ea28180dd67489724583..3d4d71b3347474f39394cff81b6b9860060859c4 100644 (file)
@@ -877,6 +877,9 @@ struct bfd_link_callbacks
     (struct bfd_link_info *, struct bfd_link_hash_entry *h,
      struct bfd_link_hash_entry *inh,
      bfd *abfd, asection *section, bfd_vma address, flagword flags);
+  /* Fatal error.  */
+  void (*fatal)
+    (const char *fmt, ...) ATTRIBUTE_NORETURN;
   /* Error or warning link info message.  */
   void (*einfo)
     (const char *fmt, ...);
index cb5e58d8f36b83a71702f01501d63159e628d7b3..54a834e42a61ff03cbcf8cba3c435b238c91549b 100644 (file)
@@ -148,6 +148,7 @@ static struct bfd_link_callbacks link_callbacks =
   reloc_dangerous,
   unattached_reloc,
   notice,
+  fatal,
   einfo,
   info_msg,
   minfo,