aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2007-10-25 11:38:30 +0000
committerJoseph Myers <joseph@codesourcery.com>2007-10-25 11:38:30 +0000
commit7c8b76cc17aabbc966b92b12852f7f8b7f69dda7 (patch)
tree779f90a838ef356460af4c34298cf44ce89bf76a
parentad842144541f614986b8ac5b4db4bfba733f0290 (diff)
downloadgdb-7c8b76cc17aabbc966b92b12852f7f8b7f69dda7.zip
gdb-7c8b76cc17aabbc966b92b12852f7f8b7f69dda7.tar.gz
gdb-7c8b76cc17aabbc966b92b12852f7f8b7f69dda7.tar.bz2
* elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Do not add
PT_NULL header when not linking.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-mips.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 76b118f..27f12d9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-25 Joseph Myers <joseph@codesourcery.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Do not add
+ PT_NULL header when not linking.
+
2007-10-25 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
* elf.c (elfcore_grok_ppc_vmx): New function.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 18be1fa..b0e8a62 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -9330,7 +9330,7 @@ _bfd_mips_elf_additional_program_headers (bfd *abfd,
bfd_boolean
_bfd_mips_elf_modify_segment_map (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
+ struct bfd_link_info *info)
{
asection *s;
struct elf_segment_map *m, **pm;
@@ -9555,8 +9555,12 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd,
header instead, and avoid the need to move any sections.
There is a long tradition of allocating spare dynamic tags,
so allocating a spare program header seems like a natural
- extension. */
- if (!SGI_COMPAT (abfd)
+ extension.
+
+ If INFO is NULL, we may be copying an already prelinked binary
+ with objcopy or strip, so do not add this header. */
+ if (info != NULL
+ && !SGI_COMPAT (abfd)
&& bfd_get_section_by_name (abfd, ".dynamic"))
{
for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next)