Skip to content
Browse files

Use correct size for MIPS .rld_map section

On MIPS .dynamic is read-only and so a special section .rld_map is used
to store the pointer to the rtld information for debuggers.  This
section had a hard coded size of 4 bytes which is not correct for
mips64.  (Note that FreeBSD's rtld does not yet populate .rld_map.)

Sponsored by:   DARPA, AFRL
Approved by:	re (delphij)
  • Loading branch information...
1 parent b9aa744 commit 7d2bbf6ce3e622de950a7a311d409183a426b893 @emaste emaste committed Oct 2, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 contrib/binutils/bfd/elfxx-mips.c
View
6 contrib/binutils/bfd/elfxx-mips.c
@@ -557,6 +557,10 @@ static bfd *reldyn_sorting_bfd;
#define MIPS_ELF_DYN_SIZE(abfd) \
(get_elf_backend_data (abfd)->s->sizeof_dyn)
+/* The size of the rld_map pointer. */
+#define MIPS_ELF_RLD_MAP_SIZE(abfd) \
+ (get_elf_backend_data (abfd)->s->arch_size / 8)
+
/* The size of a GOT entry. */
#define MIPS_ELF_GOT_SIZE(abfd) \
(get_elf_backend_data (abfd)->s->arch_size / 8)
@@ -7492,7 +7496,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
{
/* We add a room for __rld_map. It will be filled in by the
rtld to contain a pointer to the _r_debug structure. */
- s->size += 4;
+ s->size += MIPS_ELF_RLD_MAP_SIZE (output_bfd);
}
else if (SGI_COMPAT (output_bfd)
&& CONST_STRNEQ (name, ".compact_rel"))

0 comments on commit 7d2bbf6

Please sign in to comment.
Something went wrong with that request. Please try again.