diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2006-10-20 07:59:44 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2006-10-20 07:59:44 +0000 |
commit | f6f62d6fe657686bf5e793c45bb1b325898a95df (patch) | |
tree | 6f29ff059e71eab7f9bafa468b2eea7c40cc3bfc /bfd/elfxx-mips.c | |
parent | bcfdf036c8f094a9e43e2de47dd5e6ea00e1f816 (diff) | |
download | gdb-f6f62d6fe657686bf5e793c45bb1b325898a95df.zip gdb-f6f62d6fe657686bf5e793c45bb1b325898a95df.tar.gz gdb-f6f62d6fe657686bf5e793c45bb1b325898a95df.tar.bz2 |
bfd/
* elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't extend
PT_DYNAMIC on GNU/Linux targets.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 34a06c8..5483cf2 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[] = { |