aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-03-21 08:09:25 +0000
committerAlan Modra <amodra@gmail.com>2001-03-21 08:09:25 +0000
commitb32b5d6e64f30a99f1ac6ecb7186572f239b49b4 (patch)
tree2ee237760571097bed0924bd14b66b92f01c079d /bfd
parente40eccb4fbef4e068585ef96a7b761d83aa11fef (diff)
downloadgdb-b32b5d6e64f30a99f1ac6ecb7186572f239b49b4.zip
gdb-b32b5d6e64f30a99f1ac6ecb7186572f239b49b4.tar.gz
gdb-b32b5d6e64f30a99f1ac6ecb7186572f239b49b4.tar.bz2
Prevent NULL pointer dereference.
Diffstat (limited to 'bfd')
-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 4a306d1..5e14bf7 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 H.J. Lu <hjl@gnu.org>
* configure.in: Remove the redundent AC_ARG_PROGRAM.
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index c7f60a7..06b6020 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;