summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2006-10-20 07:59:44 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2006-10-20 07:59:44 +0000
commitfc5066f82d285aa5db04e4d17b731679f3459ad6 (patch)
tree21016ec0f303f9d0e5bfa22a09268359c7680f84
parent1bb025e512f3590789a6d685c375dd3c4f732440 (diff)
downloadbinutils-redhat-fc5066f82d285aa5db04e4d17b731679f3459ad6.tar.gz
bfd/
* elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't extend PT_DYNAMIC on GNU/Linux targets.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-mips.c14
2 files changed, 17 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 304783a34f..d00759366b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2006-10-20 Richard Sandiford <richard@codesourcery.com>
+ * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't extend
+ PT_DYNAMIC on GNU/Linux targets.
+
+2006-10-20 Richard Sandiford <richard@codesourcery.com>
+
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make the
size of .rel.dyn reflect the value of DT_RELSZ.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 34a06c8df4..5483cf2b02 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -9329,8 +9329,18 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd,
m->p_flags_valid = 1;
}
}
- if (m != NULL
- && m->count == 1 && strcmp (m->sections[0]->name, ".dynamic") == 0)
+ /* GNU/Linux binaries do not need the extended PT_DYNAMIC section.
+ glibc's dynamic linker has traditionally derived the number of
+ tags from the p_filesz field, and sometimes allocates stack
+ arrays of that size. An overly-big PT_DYNAMIC segment can
+ be actively harmful in such cases. Making PT_DYNAMIC contain
+ other sections can also make life hard for the prelinker,
+ which might move one of the other sections to a different
+ PT_LOAD segment. */
+ if (SGI_COMPAT (abfd)
+ && m != NULL
+ && m->count == 1
+ && strcmp (m->sections[0]->name, ".dynamic") == 0)
{
static const char *sec_names[] =
{