From owner-p4-projects@FreeBSD.ORG Tue Apr 8 23:51:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 94DE437B404; Tue, 8 Apr 2003 23:51:49 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3463F37B401 for ; Tue, 8 Apr 2003 23:51:49 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D13D043FBF for ; Tue, 8 Apr 2003 23:51:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h396pm0U051483 for ; Tue, 8 Apr 2003 23:51:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h396pmFV051480 for perforce@freebsd.org; Tue, 8 Apr 2003 23:51:48 -0700 (PDT) Date: Tue, 8 Apr 2003 23:51:48 -0700 (PDT) Message-Id: <200304090651.h396pmFV051480@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28622 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 06:51:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=28622 Change 28622 by peter@peter_daintree on 2003/04/08 23:51:44 Fix the 'symbol table is corrupt' stuff. Use Elf_Size instead of 'long', since it just happens to be right for all the cases I can think of, and is what we're actually uploading anyway - sh_size is an Elf_Size.. Affected files ... .. //depot/projects/hammer/sys/boot/common/load_elf.c#9 edit Differences ... ==== //depot/projects/hammer/sys/boot/common/load_elf.c#9 (text+ko) ==== @@ -250,7 +250,7 @@ int ndp; int symstrindex; int symtabindex; - long size; + Elf_Size size; u_int fpcopy; dp = NULL; @@ -421,7 +421,7 @@ size = shdr[i].sh_size; archsw.arch_copyin(&size, lastaddr, sizeof(size)); - lastaddr += sizeof(long); + lastaddr += sizeof(size); #ifdef ELF_VERBOSE printf("\n%s: 0x%lx@0x%lx -> 0x%lx-0x%lx", secname, @@ -430,7 +430,7 @@ #else if (i == symstrindex) printf("+"); - printf("0x%lx+0x%lx", (long)sizeof(size), size); + printf("0x%lx+0x%lx", (long)sizeof(size), (long)size); #endif if (lseek(ef->fd, (off_t)shdr[i].sh_offset, SEEK_SET) == -1) { @@ -448,7 +448,7 @@ } /* Reset offsets relative to ssym */ lastaddr += shdr[i].sh_size; - lastaddr = roundup(lastaddr, sizeof(long)); + lastaddr = roundup(lastaddr, sizeof(size)); if (i == symtabindex) symtabindex = -1; else if (i == symstrindex)