This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] sparc: Dump dynamic relocation info to the map file
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 8 Oct 2017 00:31:22 -0000
- Subject: [binutils-gdb] sparc: Dump dynamic relocation info to the map file
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f0f07ad1825e9b7f539e410562993b25f76e5627
commit f0f07ad1825e9b7f539e410562993b25f76e5627
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Oct 7 17:30:12 2017 -0700
sparc: 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.
* elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
in read-only section with minfo.
(_bfd_sparc_elf_size_dynamic_sections): Likewise.
Diff:
---
bfd/ChangeLog | 6 ++++++
bfd/elfxx-sparc.c | 11 ++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 79d980d..b68f350 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
+ in read-only section with minfo.
+ (_bfd_sparc_elf_size_dynamic_sections): Likewise.
+
2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index ef6e50c..0f2b7ad 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -2632,6 +2632,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;
}
@@ -2727,7 +2730,13 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
srel = htab->elf.irelplt;
srel->size += p->count * SPARC_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);
+ }
+
+ /* Not an error, just cut short the traversal. */
}
}
}