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


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

commit 007873f54e41eaef2f7a89b8adbb63a563d98b65
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Oct 5 06:01:18 2017 -0700

    tile: 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-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
    	in read-only section with minfo.
    	(tilepro_elf_size_dynamic_sections): Likewise.
    	* elfxx-tilegx.c (readonly_dynrelocs): Likewise.
    	(tilegx_elf_size_dynamic_sections): Likewise.

Diff:
---
 bfd/ChangeLog       |  8 ++++++++
 bfd/elf32-tilepro.c | 10 +++++++++-
 bfd/elfxx-tilegx.c  | 10 +++++++++-
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4e52880..84fad70 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2017-10-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
+	in read-only section with minfo.
+	(tilepro_elf_size_dynamic_sections): Likewise.
+	* elfxx-tilegx.c (readonly_dynrelocs): Likewise.
+	(tilegx_elf_size_dynamic_sections): Likewise.
+
 2017-10-05  Pedro Alves  <palves@redhat.com>
 
 	PR 22245
diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c
index 13b9bb1..75a7de5 100644
--- a/bfd/elf32-tilepro.c
+++ b/bfd/elf32-tilepro.c
@@ -2407,6 +2407,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;
 	}
@@ -2496,7 +2499,12 @@ tilepro_elf_size_dynamic_sections (bfd *output_bfd,
 		  srel = elf_section_data (p->sec)->sreloc;
 		  srel->size += p->count * TILEPRO_ELF_RELA_BYTES;
 		  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);
+		    }
 		}
 	    }
 	}
diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c
index 390d089..a413fb6 100644
--- a/bfd/elfxx-tilegx.c
+++ b/bfd/elfxx-tilegx.c
@@ -2674,6 +2674,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;
 	}
@@ -2757,7 +2760,12 @@ tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
 		  srel = elf_section_data (p->sec)->sreloc;
 		  srel->size += p->count * TILEGX_ELF_RELA_BYTES (htab);
 		  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);
+		    }
 		}
 	    }
 	}


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