From 18d966ff32b97a715d1666cb43e4046e989e62a0 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 12 May 2019 22:42:33 +0000 Subject: [PATCH] Modernize the error printing for text relocations by syncing it to the "more maintained" platforms. --- external/gpl3/binutils/dist/bfd/elf32-ppc.c | 13 ++++++++++--- external/gpl3/binutils/dist/bfd/elf64-ppc.c | 14 +++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/external/gpl3/binutils/dist/bfd/elf32-ppc.c b/external/gpl3/binutils/dist/bfd/elf32-ppc.c index 107d18c57e32..4e46c9f068e2 100644 --- a/external/gpl3/binutils/dist/bfd/elf32-ppc.c +++ b/external/gpl3/binutils/dist/bfd/elf32-ppc.c @@ -6616,9 +6616,16 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) struct bfd_link_info *info = (struct bfd_link_info *) info_p; info->flags |= DF_TEXTREL; - info->callbacks->minfo - (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), - sec->owner, h->root.root.string, sec); + /* xgettext:c-format */ + info->callbacks->minfo (_("%pB: dynamic relocation against `%pT' " + "in read-only section `%pA'\n"), + sec->owner, h->root.root.string, sec); + if ((info->warn_shared_textrel && bfd_link_pic (info)) + || info->error_textrel) + /* xgettext:c-format */ + info->callbacks->einfo (_("%P: %pB: warning: relocation against `%s' " + "in read-only section `%pA'\n"), + sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ return FALSE; diff --git a/external/gpl3/binutils/dist/bfd/elf64-ppc.c b/external/gpl3/binutils/dist/bfd/elf64-ppc.c index e38a8f53bafa..9b599d08eb0d 100644 --- a/external/gpl3/binutils/dist/bfd/elf64-ppc.c +++ b/external/gpl3/binutils/dist/bfd/elf64-ppc.c @@ -10260,9 +10260,17 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *inf) struct bfd_link_info *info = (struct bfd_link_info *) inf; info->flags |= DF_TEXTREL; - info->callbacks->minfo - (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), - sec->owner, h->root.root.string, sec); + /* xgettext:c-format */ + info->callbacks->minfo (_("%pB: dynamic relocation against `%pT' " + "in read-only section `%pA'\n"), + sec->owner, h->root.root.string, sec); + + if ((info->warn_shared_textrel && bfd_link_pic (info)) + || info->error_textrel) + /* xgettext:c-format */ + info->callbacks->einfo (_("%P: %pB: warning: relocation against `%s' " + "in read-only section `%pA'\n"), + sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ return FALSE;