]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Prevent NULL pointer dereference.
authorAlan Modra <amodra@gmail.com>
Wed, 21 Mar 2001 08:09:51 +0000 (08:09 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 21 Mar 2001 08:09:51 +0000 (08:09 +0000)
bfd/ChangeLog
bfd/elf32-hppa.c

index f6e47b862e24eb585611ff2fcbc93b7f263b9247..9dbe1ec89507348be6040a79a528e74e750b0051 100644 (file)
@@ -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
index c7f60a7dd7ee2d9e5ce0e877f2295b9c82b20128..06b60200dcd674f60549601407880013bb0cee7f 100644 (file)
@@ -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;