sh: Dump dynamic relocation info to the map file
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 9 Oct 2017 00:17:29 +0000 (17:17 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 9 Oct 2017 00:17:29 +0000 (17:17 -0700)
Dump dynamic relocation info to the map file when generating dynamic
relocation in read-only section relocations if -Map is used.

* elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
in read-only section with minfo.
(sh_elf_size_dynamic_sections): Likewise.

bfd/ChangeLog
bfd/elf32-sh.c

index 01fb9f43ee3f30c5ab8ba87941c407d0571a5e4c..4cb07152937f7557c3cd4d322c147848d9c7b8c8 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
+       in read-only section with minfo.
+       (sh_elf_size_dynamic_sections): Likewise.
+
 2017-10-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
index 8f9157998548ae2690f2bdae4d86f7aa09ca8350..9967587f14bd90512e717b949fb886d92463dbdc 100644 (file)
@@ -3300,6 +3300,9 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf)
 
          info->flags |= DF_TEXTREL;
 
+         info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"),
+                                 p->sec->owner, p->sec);
+
          /* Not an error, just cut short the traversal.  */
          return FALSE;
        }
@@ -3399,7 +3402,11 @@ sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
                  srel = elf_section_data (p->sec)->sreloc;
                  srel->size += p->count * sizeof (Elf32_External_Rela);
                  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
-                   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);
+                   }
 
                  /* If we need relocations, we do not need fixups.  */
                  if (htab->fdpic_p && !bfd_link_pic (info))