This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

elf32-hppa NULL pointer deref


Fixes a possible hole if default linker scripts aren't used.  Applying
trunk and branch.

bfd/ChangeLog
	* elf32-hppa.c (elf32_hppa_set_gp): Check sec->output_section
	non-NULL before attempting to dereference.

Alan Modra
-- 
Linuxcare

Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.29
diff -u -p -r1.29 elf32-hppa.c
--- elf32-hppa.c	2001/03/15 13:47:56	1.29
+++ elf32-hppa.c	2001/03/21 08:01:59
@@ -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;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]