PERFORCE change 31047 for review

Juli Mallett jmallett at FreeBSD.org
Mon May 12 21:15:41 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=31047

Change 31047 by jmallett at jmallett_dalek on 2003/05/12 21:15:33

	Fix things without loader, if nbuckets is 0, don't look
	in the hash, that's a divide by zero.

Affected files ...

.. //depot/projects/mips/sys/kern/link_elf.c#8 edit

Differences ...

==== //depot/projects/mips/sys/kern/link_elf.c#8 (text+ko) ====

@@ -1003,9 +1003,12 @@
     unsigned long hash;
     int i;
 
-    /* First, search hashed global symbols */
-    hash = elf_hash(name);
-    symnum = ef->buckets[hash % ef->nbuckets];
+    /* First, search hashed global symbols, if we have any */
+    if (ef->nbuckets != 0) {
+	hash = elf_hash(name);
+    	symnum = ef->buckets[hash % ef->nbuckets];
+    } else
+	symnum = STN_UNDEF;
 
     while (symnum != STN_UNDEF) {
 	if (symnum >= ef->nchains) {


More information about the p4-projects mailing list