This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] sh: Dump dynamic relocation info to the map file


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a72f95f7760bf85693af393c5e01dd3aedbe5bde

commit a72f95f7760bf85693af393c5e01dd3aedbe5bde
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Oct 8 17:17:29 2017 -0700

    sh: Dump dynamic relocation info to the map file
    
    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.

Diff:
---
 bfd/ChangeLog  | 6 ++++++
 bfd/elf32-sh.c | 9 ++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 01fb9f4..4cb0715 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
 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
 	a strayed comment.
 
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 8f91579..9967587 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -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))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]