🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by d90-awe Mon, 10 Aug 1992 17:01
GAS 1.38 bug report
#248
Author: d90-awe
Date: Mon, 10 Aug 1992 17:01
78 lines
2486 bytes
Bug report for gas.

Version: gas-1.38

Machine: sun4

Operating system: SunOS 4.1.2

file:

------------------------------ cut here ------------------------------
/* unimp.s */
.text
	unimp 17
------------------------------ cut here ------------------------------

Options for gas: gas unimp.s -o unimp.o

What's wrong:

unimp.o contains, according to adb, the instruct `unimp 0x4'. The same
source file assembled with SunOS as (/usr/bin/as) produces a file
which isn't identical to unimp.o and with `unimp 0x11'.

My explanation:

Gas thinks unimp takes a 22 bit PC relative operand, when in fact it's
not PC relative.

My patch:

*** sparc-opcode.h.orig	Thu Jun  7 22:22:10 1990
--- sparc-opcode.h	Sat Aug  8 23:12:55 1992
***************
*** 58,63 ****
--- 58,64 ----
     D    crsd coprocessor register
     h    22 high bits.
     i    13 bit Immediate.
+    s    22 bit Immediate.
     l    22 bit PC relative immediate.
     L    30 bit PC relative immediate.
     a    Annul.  The annul bit is set.
***************
*** 497,503 ****
  { "tsubcctv",   0x80580000, 0x40a00000, "1,2,d", 0 },
  { "tsubcctv",   0x80582000, 0x40a00000, "1,i,d", 0 },
  
! { "unimp",      0x00000000, 0x00000000, "l", 0 },
  
  { "iflush",     0x81d80000, 0x40202000, "1+2", 0 },
  { "iflush",     0x81d82000, 0x40200000, "1+i", 0 },
--- 498,504 ----
  { "tsubcctv",   0x80580000, 0x40a00000, "1,2,d", 0 },
  { "tsubcctv",   0x80582000, 0x40a00000, "1,i,d", 0 },
  
! { "unimp",      0x00000000, 0x00000000, "s", 0 },
  
  { "iflush",     0x81d80000, 0x40202000, "1+2", 0 },
  { "iflush",     0x81d82000, 0x40200000, "1+i", 0 },

*** sparc.c.orig	Mon Oct 22 19:04:04 1990
--- sparc.c	Sat Aug  8 23:16:16 1992
***************
*** 665,670 ****
--- 665,674 ----
  	        the_insn.reloc = RELOC_HI22;
  		goto immediate;
  
+ 	    case 's':      /* 22 bit immediate sak */
+ 		the_insn.reloc = RELOC_BASE22;
+ 		goto immediate;
+ 
  	    case 'l':   /* 22 bit PC relative immediate */
  	        the_insn.reloc = RELOC_WDISP22;
  		the_insn.pcrel = 1;

/assar
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads