From: Alan Modra Date: Wed, 21 Mar 2001 08:09:51 +0000 (+0000) Subject: Prevent NULL pointer dereference. X-Git-Tag: binutils-2_11~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e74747975e16bf963198284654e868b86148779e;p=thirdparty%2Fbinutils-gdb.git Prevent NULL pointer dereference. --- 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 + + * elf32-hppa.c (elf32_hppa_set_gp): Check sec->output_section + non-NULL before attempting to dereference. + 2001-03-20 Andreas Schwab * 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;