From e3cbd0c0a226f7b2e567b85a09b273b5bf6fe945 Mon Sep 17 00:00:00 2001 From: rnordier Date: Mon, 25 Jan 1999 10:34:35 +0000 Subject: [PATCH] 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 . --- sys/boot/common/load_aout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/boot/common/load_aout.c b/sys/boot/common/load_aout.c index 44f4276e2847..3e6aeced5d7f 100644 --- a/sys/boot/common/load_aout.c +++ b/sys/boot/common/load_aout.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * 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 @@ -221,7 +221,7 @@ aout_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, struct ex addr += ehdr->a_bss; /* symbol table size */ - ssym = addr; + ssym = esym = addr; if(ehdr->a_syms!=NULL) { archsw.arch_copyin(&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) return(0); addr += ss; + esym = addr; mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym); 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("\n"); - esym = addr; return(addr - loadaddr); }