- 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_section_name (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);