summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2001-03-21 08:09:51 +0000
committerAlan Modra <amodra@bigpond.net.au>2001-03-21 08:09:51 +0000
commit6d18ef37f9ba52b47c1ab28fef6b5bb8b06b7820 (patch)
tree80361ebf53ecd9bc13fdc6f0059a40cd055b50ac
parent57090b5ddf6847b5fdaa8ff41f9f5a29ac530666 (diff)
downloadgdb-6d18ef37f9ba52b47c1ab28fef6b5bb8b06b7820.tar.gz
Prevent NULL pointer dereference.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-hppa.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f6e47b862e2..9dbe1ec8950 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2001-03-21 Alan Modra <alan@linuxcare.com.au>
+
+ * elf32-hppa.c (elf32_hppa_set_gp): Check sec->output_section
+ non-NULL before attempting to dereference.
+
2001-03-20 Andreas Schwab <schwab@suse.de>
* elf32-m68k.c (elf_m68k_relocate_section): Don't need the
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index c7f60a7dd7e..06b60200dcd 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -3089,7 +3089,7 @@ elf32_hppa_set_gp (abfd, info)
}
}
- if (sec != NULL)
+ if (sec != NULL && sec->output_section != NULL)
gp_val += sec->output_section->vma + sec->output_offset;
elf_gp (abfd) = gp_val;