Date: Mon, 12 May 2003 21:15:39 -0700 (PDT) From: Juli Mallett <jmallett@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 31047 for review Message-ID: <200305130415.h4D4FdPk065409@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=31047 Change 31047 by jmallett@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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305130415.h4D4FdPk065409>