aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-12-01 12:28:18 +0000
committerNick Clifton <nickc@redhat.com>2006-12-01 12:28:18 +0000
commit55d55ac712a8d2763cce40bafdb31ca3c2f04beb (patch)
tree926efe88078d1a7a7a72c8ef782a9437162ca47f /bfd/elf.c
parent4155b94b2ced1e636363169f2989d646183a7438 (diff)
downloadgdb-55d55ac712a8d2763cce40bafdb31ca3c2f04beb.zip
gdb-55d55ac712a8d2763cce40bafdb31ca3c2f04beb.tar.gz
gdb-55d55ac712a8d2763cce40bafdb31ca3c2f04beb.tar.bz2
PR 3609
* elf.c (rewrite_elf_program_header): Do not use the first_section pointer if it is null.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index e4f4a95..3126fe6 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5427,10 +5427,11 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
map->p_type = segment->p_type;
map->p_flags = segment->p_flags;
map->p_flags_valid = 1;
+
/* If the first section in the input segment is removed, there is
no need to preserve segment physical address in the corresponding
output segment. */
- if (first_section->output_section != NULL)
+ if (first_section != NULL && first_section->output_section != NULL)
{
map->p_paddr = segment->p_paddr;
map->p_paddr_valid = 1;