Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!noao!dat From: dat@noao.edu (D'Anne Thompson) Newsgroups: comp.realtime Subject: Re: cc68k gnu crosscompiler SPARC/68k20 exits w signal 11 Message-ID: <1991Jun21.175116.3973@noao.edu> Date: 21 Jun 91 17:51:16 GMT References: <20818@sdcc6.ucsd.edu> Distribution: comp Organization: National Optical Astronomy Observatories, Tucson, AZ, USA Lines: 213 My problem module is no longer a problem, thanks to Mark Peek and Jwahar R. Bammi. Mark sent me the notice from Jwahar that he had seen some time ago. The VxWorks gnu toolkit that we received, uses gas-1.34. A co-worker already had gas-1.38, so I applied the patches from jwahar and our problem seems to be taken care of. Here is Mark's note to me, along with Jwahar's patches. > >I had a similiar thing happen in about the same environment. Attached is >a patch file with some bug fixes for gas. The one for expr.c seemed to do >the trick. If this works, go ahead and repost the answer. I can only take >credit for saving this article... > >Mark >---- > >Name: Mark Peek >Mail: Imagen Division, QMS Inc. > 2650 San Tomas Expressway, P.O. Box 58101 > Santa Clara, CA 95052-8101 >AT&T: (408) 986-9400 >UUCP: mark@imagen.com or ...{decwrl,sun}!imagen!mark Here is Jwahar R Bammi's patches to gas-1.38... =========================================================================== Article 113 of gnu.utils.bug: Path: imagen!sun!newstop!sun-barr!apple!usc!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!UUNET.UU.NET!cadence!bammi%acae127 From: cadence!bammi%acae127@UUNET.UU.NET (Jwahar R. Bammi) Newsgroups: gnu.utils.bug Subject: gas v1.38 bug + suggested fix Message-ID: Date: 8 Feb 91 21:16:38 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: Cadence Design Systems Lines: 162 Approved: bug-gnu-utils@prep.ai.mit.edu here are some of my fixes for gas 1.38 (and any m68k host): the problem was that AOFF mode was always generating 0 offsets, the following example #APP .text movew d1,a0@(two-one) .lcomm one,2 .lcomm two,2 was being assembled as "movew d1,a0@(0)" the diffs below incorporate the following: - diffs from kivinen@JOKER.HUT.FI (Tero Kivinen) fixing a6@(label) being assembled as PC relative rather than A6 relative. - diffs from ntmtv!thompson@AI.MIT.EDU (Mike Thompson) for "bkpt #0" - diff to expr.c: this requires a little explaination. the if condition at around line 530 in v1.38 reads if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol || ( expressionP->X_subtract_symbol->sy_frag==expressionP->X_add_symbol->sy_frag && expressionP->X_subtract_symbol->sy_value==expressionP->X_add_symbol->sy_value)) several people have pointed out that this causes seg. faults and needs to be patched to if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol || (expressionP->X_subtract_symbol && expressionP->X_add_symbol && expressionP->X_subtract_symbol->sy_frag==expressionP->X_add_symbol->sy_frag && expressionP->X_subtract_symbol->sy_value==expressionP->X_add_symbol->sy_value)) but doing so always produces zero for expressions such as ``a6@(two-one)''. (see the #def of "isvar" in m68k.c and its usage for example in the AOFF case at around line 1509 of m68k.c) , so the correct condition seems to be just if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol) (as it was in gas 1.34). with the patches suggested below, it seems to do much better. --- *** ../gas-1.38/expr.c Fri Jan 4 13:13:00 1991 --- expr.c Tue Feb 5 18:48:54 1991 *************** *** 527,535 **** * It is faster to re-cancel them to NULL * than to check for this special case. */ ! if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol ! || ( expressionP->X_subtract_symbol->sy_frag==expressionP->X_add_symbol->sy_frag ! && expressionP->X_subtract_symbol->sy_value==expressionP->X_add_symbol->sy_value)) { expressionP -> X_subtract_symbol = NULL; expressionP -> X_add_symbol = NULL; --- 527,533 ---- * It is faster to re-cancel them to NULL * than to check for this special case. */ ! if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol) { expressionP -> X_subtract_symbol = NULL; expressionP -> X_add_symbol = NULL; *** ../gas-1.38/m68k.c Tue Dec 4 15:50:00 1990 --- m68k.c Wed Feb 6 09:52:38 1991 *************** *** 1258,1265 **** long t; t=get_num(opP->con1,80); ! if(t<1 || t>8 || isvar(opP->con1)) ! losing++; } break; --- 1258,1271 ---- long t; t=get_num(opP->con1,80); ! if (s[1]!='s') { ! if(t<1 || t>8 || isvar(opP->con1)) ! losing++; ! } ! else { ! if(t<0 || t>7 || isvar(opP->con1)) ! losing++; ! } } break; *************** *** 1474,1480 **** if( !issword(nextword) || ( isvar(opP->con1) && ( ( opP->con1->e_siz==0 ! && flagseen['l']==0) || opP->con1->e_siz==3))) { if(opP->reg==PC) --- 1480,1486 ---- if( !issword(nextword) || ( isvar(opP->con1) && ( ( opP->con1->e_siz==0 ! && flagseen['l']!=0) || opP->con1->e_siz==3))) { if(opP->reg==PC) *************** *** 1489,1495 **** break; } else { addword(0x0170); ! add_fix('l',opP->con1,1); } } else addword(0x0170); --- 1495,1501 ---- break; } else { addword(0x0170); ! add_fix('l',opP->con1,0); } } else addword(0x0170); *************** *** 1976,1984 **** break; case 'Q': ! tmpreg=get_num(opP->con1,10); ! if(tmpreg==8) ! tmpreg=0; install_operand(s[1],tmpreg); break; --- 1982,1997 ---- break; case 'Q': ! if (s[1]!='s') { ! tmpreg=get_num(opP->con1,10); ! if(tmpreg==8) ! tmpreg=0; ! } ! else { ! tmpreg=get_num(opP->con1,20); ! if(tmpreg==8) ! tmpreg=0; ! } install_operand(s[1],tmpreg); break; cheers, -- bang: uunet!cadence!bammi jwahar r. bammi domain: bammi@cadence.com GEnie: J.Bammi CIS: 71515,155 -- D'Anne Thompson National Optical Astronomy Observatories P.O. Box 26732 Tucson, AZ 85726