Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Apr 2003 23:51:48 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28622 for review
Message-ID:  <200304090651.h396pmFV051480@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304090651.h396pmFV051480>