Correctly record the end of the a.out symbol table. In practice, a

bootinfo structure where bi_esymtab < bi_symtab was being passed
to the kernel.  In the case of older 2.x kernels, this was causing
garbage to be printed to the video console, followed by an exception.

This should resolve a problem reported on -current by Peter Jeremy
<peter.jeremy@auss2.alcatel.com.au>.
This commit is contained in:
rnordier 1999-01-25 10:34:35 +00:00
parent 0c34d1b7cc
commit a732e65749

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: load_aout.c,v 1.12 1999/01/22 21:33:52 rnordier Exp $ * $Id: load_aout.c,v 1.13 1999/01/22 23:50:14 msmith Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -221,7 +221,7 @@ aout_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, struct ex
addr += ehdr->a_bss; addr += ehdr->a_bss;
/* symbol table size */ /* symbol table size */
ssym = addr; ssym = esym = addr;
if(ehdr->a_syms!=NULL) { if(ehdr->a_syms!=NULL) {
archsw.arch_copyin(&ehdr->a_syms, addr, sizeof(ehdr->a_syms)); archsw.arch_copyin(&ehdr->a_syms, addr, sizeof(ehdr->a_syms));
addr += sizeof(ehdr->a_syms); addr += sizeof(ehdr->a_syms);
@ -241,6 +241,7 @@ aout_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, struct ex
if (archsw.arch_readin(fd, addr, ss) != ss) if (archsw.arch_readin(fd, addr, ss) != ss)
return(0); return(0);
addr += ss; addr += ss;
esym = addr;
mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym); mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym);
mod_addmetadata(mp, MODINFOMD_ESYM, sizeof(esym), &esym); mod_addmetadata(mp, MODINFOMD_ESYM, sizeof(esym), &esym);
@ -248,7 +249,6 @@ aout_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, struct ex
printf("symbols=[none]"); printf("symbols=[none]");
} }
printf("\n"); printf("\n");
esym = addr;
return(addr - loadaddr); return(addr - loadaddr);
} }