PR23430, Indices misspelled
[deliverable/binutils-gdb.git] / ld / ldctor.c
index 2075ad34f2f998d192b93132040d79bc9e4b9278..5fd6502167187e97bc8d2714dd2ffb2bfc7e2921 100644 (file)
@@ -1,5 +1,5 @@
 /* ldctor.c -- constructor support routines
-   Copyright (C) 1991-2016 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
    By Steve Chamberlain <sac@cygnus.com>
 
    This file is part of the GNU Binutils.
@@ -80,7 +80,7 @@ ldctor_add_set_entry (struct bfd_link_hash_entry *h,
     {
       if (p->reloc != reloc)
        {
-         einfo (_("%P%X: Different relocs used in set %s\n"),
+         einfo (_("%X%P: different relocs used in set %s\n"),
                 h->root.string);
          return;
        }
@@ -98,7 +98,7 @@ ldctor_add_set_entry (struct bfd_link_hash_entry *h,
          && strcmp (bfd_get_target (section->owner),
                     bfd_get_target (p->elements->section->owner)) != 0)
        {
-         einfo (_("%P%X: Different object file formats composing set %s\n"),
+         einfo (_("%X%P: different object file formats composing set %s\n"),
                 h->root.string);
          return;
        }
@@ -276,7 +276,7 @@ ldctor_build_sets (void)
        {
          if (bfd_link_relocatable (&link_info))
            {
-             einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
+             einfo (_("%X%P: %s does not support reloc %s for set %s\n"),
                     bfd_get_target (link_info.output_bfd),
                     bfd_get_reloc_code_name (p->reloc),
                     p->h->root.string);
@@ -290,10 +290,17 @@ ldctor_build_sets (void)
                                           p->reloc);
          if (howto == NULL)
            {
-             einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
-                    bfd_get_target (p->elements->section->owner),
-                    bfd_get_reloc_code_name (p->reloc),
-                    p->h->root.string);
+             /* See PR 20911 for a reproducer.  */
+             if (p->elements->section->owner == NULL)
+               einfo (_("%X%P: special section %s does not support reloc %s for set %s\n"),
+                      bfd_get_section_name (link_info.output_bfd, p->elements->section),
+                      bfd_get_reloc_code_name (p->reloc),
+                      p->h->root.string);
+             else
+               einfo (_("%X%P: %s does not support reloc %s for set %s\n"),
+                      bfd_get_target (p->elements->section->owner),
+                      bfd_get_reloc_code_name (p->reloc),
+                      p->h->root.string);
              continue;
            }
        }
@@ -311,7 +318,7 @@ ldctor_build_sets (void)
            size = QUAD;
          break;
        default:
-         einfo (_("%P%X: Unsupported size %d for set %s\n"),
+         einfo (_("%X%P: unsupported size %d for set %s\n"),
                 bfd_get_reloc_size (howto), p->h->root.string);
          size = LONG;
          break;
@@ -353,7 +360,7 @@ ldctor_build_sets (void)
                }
 
              if (e->name != NULL)
-               minfo ("%T\n", e->name);
+               minfo ("%pT\n", e->name);
              else
                minfo ("%G\n", e->section->owner, e->section, e->value);
            }
This page took 0.030346 seconds and 4 git commands to generate.