+2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
+ Dump dynamic relocation in read-only section with minfo if
+ needed.
+ (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
+ (maybe_set_textrel): Likewise.
+ (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
+ read-only section with minfo.
+
2017-10-05 John Baldwin <jhb@FreeBSD.org>
* elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
/* Return true if we have dynamic relocs that apply to read-only sections. */
static bfd_boolean
-readonly_dynrelocs (struct elf_link_hash_entry *h)
+readonly_dynrelocs (struct elf_link_hash_entry *h,
+ struct bfd_link_info *info)
{
struct elf_dyn_relocs *p;
if (s != NULL
&& ((s->flags & (SEC_READONLY | SEC_ALLOC))
== (SEC_READONLY | SEC_ALLOC)))
- return TRUE;
+ {
+ if (info)
+ info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"),
+ p->sec->owner, p->sec);
+
+ return TRUE;
+ }
}
return FALSE;
}
|| (!h->ref_regular_nonweak && h->non_got_ref))
&& !htab->is_vxworks
&& !ppc_elf_hash_entry (h)->has_sda_refs
- && !readonly_dynrelocs (h))
+ && !readonly_dynrelocs (h, NULL))
{
h->pointer_equality_needed = 0;
/* After adjust_dynamic_symbol, non_got_ref set in the
&& !ppc_elf_hash_entry (h)->has_sda_refs
&& !htab->is_vxworks
&& !h->def_regular
- && !readonly_dynrelocs (h))
+ && !readonly_dynrelocs (h, NULL))
{
h->non_got_ref = 0;
return TRUE;
read-only sections. */
static bfd_boolean
-maybe_set_textrel (struct elf_link_hash_entry *h, void *info)
+maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
{
+ struct bfd_link_info *info;
+
if (h->root.type == bfd_link_hash_indirect)
return TRUE;
- if (readonly_dynrelocs (h))
+ info = (struct bfd_link_info *) info_p;
+ if (readonly_dynrelocs (h, info))
{
- ((struct bfd_link_info *) info)->flags |= DF_TEXTREL;
+ info->flags |= DF_TEXTREL;
/* Not an error, just cut short the traversal. */
return FALSE;
if ((p->sec->output_section->flags
& (SEC_READONLY | SEC_ALLOC))
== (SEC_READONLY | SEC_ALLOC))
- info->flags |= DF_TEXTREL;
+ {
+ info->flags |= DF_TEXTREL;
+ info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"),
+ p->sec->owner, p->sec);
+ }
}
}
}