From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31515 invoked by alias); 18 Apr 2002 19:46:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31502 invoked from network); 18 Apr 2002 19:46:57 -0000 Received: from unknown (HELO potter.sfbay.redhat.com) (205.180.83.107) by sources.redhat.com with SMTP; 18 Apr 2002 19:46:57 -0000 Received: from free.redhat.lsd.ic.unicamp.br (vpn3-3.sfbay.redhat.com [172.16.25.3] (may be forged)) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g3IJkav29387 for ; Thu, 18 Apr 2002 12:46:36 -0700 Received: (from aoliva@localhost) by free.redhat.lsd.ic.unicamp.br (8.11.6/8.11.6) id g3IJcWq14902; Thu, 18 Apr 2002 16:38:32 -0300 To: gdb-patches@sources.redhat.com Subject: MIPS simulator initializes LSI pmon vector table with code From: Alexandre Oliva Organization: GCC Team, Red Hat Date: Thu, 18 Apr 2002 12:46:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2002-04/txt/msg00604.txt.bz2 --=-=-= Content-length: 518 There's a chunk of memory in LSI pmon that is supposed to contain pointers to `system call' handlers. However, sim_open() will clobber the valid addresses it stores in this table with code bare code (as opposed to pointers to code) that was meant to catch invalid accesses. This is obviously wrong. I'm checking this in, since Frank Ch. Eigler and Eric Christopher agreed it was a reasonable thing to do. I'll leave the complete fix for someone who has a real understanding of what was supposed to be done there. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=sim-mips-no-code-in-vtable.patch Content-length: 1083 Index: sim/mips/ChangeLog from Alexandre Oliva * interp.c (sim_open): Disable chunk of code that wrote code in vector table entries. Index: sim/mips/interp.c =================================================================== RCS file: /cvs/src/src/sim/mips/interp.c,v retrieving revision 1.9 diff -u -p -r1.9 interp.c --- sim/mips/interp.c 20 Mar 2002 01:35:13 -0000 1.9 +++ sim/mips/interp.c 18 Apr 2002 19:41:48 -0000 @@ -698,10 +698,14 @@ sim_open (kind, cb, abfd, argv) sim_write (sd, 0x80000000, (char *) halt, sizeof (halt)); sim_write (sd, 0x80000180, (char *) halt, sizeof (halt)); sim_write (sd, 0x80000200, (char *) halt, sizeof (halt)); +#if 0 + /* This is wrong. We're not supposed to write code to the + vector tables, but rather pointers to code. */ /* XXX: Write here unconditionally? */ sim_write (sd, 0xBFC00200, (char *) halt, sizeof (halt)); sim_write (sd, 0xBFC00380, (char *) halt, sizeof (halt)); sim_write (sd, 0xBFC00400, (char *) halt, sizeof (halt)); +#endif } } --=-=-= Content-length: 289 -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist Professional serial bug killer --=-=-=--