Modernize the error printing for text relocations by syncing it to the

"more maintained" platforms.
This commit is contained in:
christos 2019-05-12 22:42:33 +00:00
parent 3544b82379
commit 18d966ff32
2 changed files with 21 additions and 6 deletions

View File

@ -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;

View File

@ -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;