🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #203

Re: Branch addressing bug in GAS-1.92.3 / 68k

#203
From: John Clark
Date: Wed, 05 Aug 1992 17:35
48 lines
1999 bytes
In article <9208031719.AA08940@zaphod.synoptics.com> asmith@synoptics.com (Andrew Smith) writes:
+
+> In article <9207301722.AA00678@zaphod.synoptics.com> you write:
+> [ ... ]
+> >I have a GAS called gas-1.92.3 which supports all of the 68040 MMU opcodes
+> >but not the 68030 ones. Any ideas?
+> 
+> Can't help you with the 68030 MMU stuff, but I can offer a word of
+> caution:  Don't trust gas-1.92.3.  I've noticed that in some (all?)
+> cases, it miscomputes offsets for relative branches.

The following patch is offered as 'hack' solutions to the m68k branch
calculation errors I have found with gas-1.92.3.


diff -r ./gas-1.92.3/gas/config/tc-m68k.c ../gas-1.92.3/gas/config/tc-m68k.c
2034c2034,2043
< 				/* Needs no offsetting */
---
> #if 0
> 				if (((cpu_of_arch(current_architecture) < m68020) || (0 == adds(opP->con1)))
> 				    && (the_ins.opcode[0] >= 0x6200)
> 				    && (the_ins.opcode[0] <= 0x6f00)) {
> 					add_frag(adds(opP->con1),offs(opP->con1),TAB(BCC68000,SZ_UNDEF));
> 				} else {
> 					add_frag(adds(opP->con1),offs(opP->con1),TAB(BRANCH,SZ_UNDEF));	/* Needs no offsetting */
> 				}
> #else
> 				opP->con1->e_exp.X_add_number -= 1;
2035a2045
> #endif
2039c2049
< 				opP->con1->e_exp.X_add_number += 2;
---
> /*				opP->con1->e_exp.X_add_number += 2;*/
2049c2059
< 				opP->con1->e_exp.X_add_number+=4;
---
> /*				opP->con1->e_exp.X_add_number+=4;*/


------- END M68K hack -----------


-- 

John Clark
jclark@ucsd.edu
Technical Details
Message-ID: <36518@sdcc12.ucsd.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sdcc3.ucsd.edu!jclark
References: <9208031719.AA08940@zaphod.synoptics.com>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sdcc3.ucsd.edu!jclark
From: jclark@sdcc3.ucsd.edu (John Clark)
Subject: Re: Branch addressing bug in GAS-1.92.3 / 68k
Message-ID: <36518@sdcc12.ucsd.edu>
Sender: gnulists@ai.mit.edu
Organization: University of California, San Diego
References: <9208031719.AA08940@zaphod.synoptics.com>
Distribution: gnu
Date: Wed, 5 Aug 1992 17:35:49 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 49