This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] sparc: Dump dynamic relocation info to the map file
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 7 Oct 2017 16:16:27 -0700
- Subject: [PATCH] sparc: Dump dynamic relocation info to the map file
- Authentication-results: sourceware.org; auth=none
Dump dynamic relocation info to the map file when generating dynamic
relocation in read-only section relocations if -Map is used.
I will check it in shortly.
H.J.
--
* elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
in read-only section with minfo.
(_bfd_sparc_elf_size_dynamic_sections): Likewise.
---
bfd/elfxx-sparc.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index ef6e50c63f..0f2b7ad53e 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. */
}
}
}
--
2.13.6