--- elf32-ppc.c.old	2009-12-07 10:11:12.000000000 +0100
+++ elf32-ppc.c	2009-12-07 10:15:00.000000000 +0100
@@ -4449,7 +4449,7 @@
 	      if (r_type == R_PPC_PLTREL24 && info->shared)
 		addend = rel->r_addend;
 	      ent = find_plt_ent (ifunc, got2, addend);
-	      if (ent->plt.refcount > 0)
+	      if (ent && ent->plt.refcount > 0)
 		ent->plt.refcount -= 1;
 	      continue;
 	    }
@@ -4486,7 +4486,7 @@
 		  struct plt_entry *ent;
 
 		  ent = find_plt_ent (&h->plt.plist, NULL, 0);
-		  if (ent->plt.refcount > 0)
+		  if (ent && ent->plt.refcount > 0)
 		    ent->plt.refcount -= 1;
 		}
 	    }
@@ -4534,7 +4534,7 @@
 	      if (r_type == R_PPC_PLTREL24 && info->shared)
 		addend = rel->r_addend;
 	      ent = find_plt_ent (&h->plt.plist, got2, addend);
-	      if (ent->plt.refcount > 0)
+	      if (ent && ent->plt.refcount > 0)
 		ent->plt.refcount -= 1;
 	    }
 	  break;
