🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #54342

gas-1.37 coff patches for ibm ps/2 aix ...

#54342
From: Minh Tran-Le
Date: Thu, 01 Nov 1990 21:06
1011 lines
32343 bytes
This is a set of patches to be applied to gas-1.37 after having
applied Loic Dachary's gas-coff patches.  This is a extension of Loic's
patches to make gas-1.37 work under ibm ps/2 aix.

Loic's set of patches are available either through ftp thanks to John Hassey
at dg-rtp.dg.com (128.222.1.2) under /pub/gnu/gas-coff.
The patches have also been posted to comp.source.misc

Here comes my set of patches. (I have only tried them on ibm ps/2 aix 1.2)

Minh Tran-Le.

arpanet: tranle@intellicorp.com
uucp:   ..sun!icmv!mtranle

(next: gdb for ibm ps/2 sometime next week)

---------------------------------------------------------------------------
*** README.coff.~1~	Thu Nov 01 08:42:06 1990
--- README.coff	Thu Nov 01 12:31:34 1990
***************
*** 77,79 ****
--- 77,106 ----
  
  	Loic  (loic@adesign.uucp or loic@afp.uucp)
  
+ ---------------------------------------------------------------------------
+ tranle@intellicorp.com - Thu Nov  1 12:00:18 1990
+ 
+ I have added the following changes to Loic gas-coff patch to make it work
+ under ibm ps/2 aix.
+ 
+ - merged Loic Makefile.new and gas-1.37 standard Makefile
+ 
+ - coff.h,aout.h: changed the S_IS_LOCAL macro to check \001 on the 3rd
+ 	character instead of the 1rst. This is so that we can be consistent
+ 	with expr.c which generate ".L0\001" for local label.
+ 
+ - coff.c: the AIX ld program require that the relocation table is sorted
+ 	by r_vaddr like the standard ATT assembler does.
+ 
+ - i386-opcode.h, i386.c: added handling of the following opcodes:
+ 	i/o opcodes - inb, inw, outb and outw.
+ 	string manipulation with att syntax - scmp, slod, smov, ssca, ssto.
+ 
+ - read.c, subsegs.c, write.c :
+ 	 added handling of `.bss` pseudo op for unitialized data. The
+ 	new gcc (1.37.9x) generate these sections.
+ 	.align: will use NOP_OPCODE or 0 for padding. This is just for being
+ 	nice to the disassembler.
+ 
+ Minh Tran-Le.
+ 
*** Makefile.~1~	Thu Sep 27 10:38:29 1990
--- Makefile	Thu Nov 01 11:49:06 1990
***************
*** 21,38 ****
  # SPARC, or ns32k assembler(s).
  
  BINDIR = /usr/local/bin
! #CC=gcc
  
  # If you are on a BSD system, un-comment the next two lines, and comment out
  # the lines for SystemV and HPUX below
! G0 = -g  -I. #-O -Wall
! LDFLAGS = $(CFLAGS)
  #
  # To compile gas on a System Five machine, comment out the two lines above
  # and un-comment out the next three lines
  # Comment out the -lPW on the LOADLIBES line if you are using GCC.
! # G0 = -g -I. -DUSG
! # LDFLAGS = $(CFLAGS)
  # LOADLIBES = -lmalloc -lPW
  #
  # To compile gas for HPUX, link m-hpux.h to m68k.h , and un-comment the
--- 21,38 ----
  # SPARC, or ns32k assembler(s).
  
  BINDIR = /usr/local/bin
! CC=gcc
  
  # If you are on a BSD system, un-comment the next two lines, and comment out
  # the lines for SystemV and HPUX below
! #G0 = -g  -I. #-O -Wall
! #LDFLAGS = $(CFLAGS)
  #
  # To compile gas on a System Five machine, comment out the two lines above
  # and un-comment out the next three lines
  # Comment out the -lPW on the LOADLIBES line if you are using GCC.
! G0 = -I. -DUSG
! LDFLAGS = $(CFLAGS)
  # LOADLIBES = -lmalloc -lPW
  #
  # To compile gas for HPUX, link m-hpux.h to m68k.h , and un-comment the
***************
*** 108,114 ****
  # (This option is automatically enabled when building the sparc assembler.
  #
  
! O1 =  -DNO_VARARGS
  O2 = # -DNON_BROKEN_WORDS
  O3 = # -Dm68851
  O4 = # -DEXEC_VERSION=1
--- 108,114 ----
  # (This option is automatically enabled when building the sparc assembler.
  #
  
! O1 = # -DNO_VARARGS
  O2 = # -DNON_BROKEN_WORDS
  O3 = # -Dm68851
  O4 = # -DEXEC_VERSION=1
***************
*** 126,137 ****
  
  OPTIONS = $(O1) $(O2) $(O3) $(O4) $(O5) $(O6) $(O7) $(O8) $(O9) $(O10)
  
! CFLAGS = $(G0) $(G1) $(G2) $(G3) $(G4)
  
  #
  # To make the 68020 assembler compile as the default, un-comment the next
  # line, and comment out all the other lines that start with DEFAULT_GAS
! DEFAULT_GAS=a68
  #
  # To make the VAX assembler compile as the default, un-comment the next
  # line and commment out all the other lines that start with DEFAULT_GAS
--- 126,137 ----
  
  OPTIONS = $(O1) $(O2) $(O3) $(O4) $(O5) $(O6) $(O7) $(O8) $(O9) $(O10)
  
! CFLAGS = $(CDEBUGFLAGS) $(G0) $(G1) $(G2) $(G3) $(G4)
  
  #
  # To make the 68020 assembler compile as the default, un-comment the next
  # line, and comment out all the other lines that start with DEFAULT_GAS
! #DEFAULT_GAS=a68
  #
  # To make the VAX assembler compile as the default, un-comment the next
  # line and commment out all the other lines that start with DEFAULT_GAS
***************
*** 139,145 ****
  #
  # To make the 80386 assembler compile as the default, un-comment the next
  # line and commment out all the other lines that start with DEFAULT_GAS
! #DEFAULT_GAS=a386
  #
  # To make the ns32k assembler compile as the default, un-comment the next
  # line and commment out all the other lines that start with DEFAULT_GAS
--- 139,145 ----
  #
  # To make the 80386 assembler compile as the default, un-comment the next
  # line and commment out all the other lines that start with DEFAULT_GAS
! DEFAULT_GAS=a386
  #
  # To make the ns32k assembler compile as the default, un-comment the next
  # line and commment out all the other lines that start with DEFAULT_GAS
***************
*** 157,169 ****
  frags.o		input-file.o	input-scrub.o	output-file.o	              \
  subsegs.o	symbols.o					version.o     \
  flonum-const.o	flonum-copy.o	flonum-mult.o	strstr.o	bignum-copy.o \
! obstack.o
  #gdb.o		gdb-file.o	gdb-symbols.o	gdb-blocks.o	gdb-lines.o
  
! a:	$(DEFAULT_GAS)
! 	@rm -f a
! 	@ln $(DEFAULT_GAS) a
  
  # SPARC GAS ------------------------------------------------------------------
  v = sparc.o  atof-ieee.o  write-sparc.o  read-sparc.o
  
--- 157,171 ----
  frags.o		input-file.o	input-scrub.o	output-file.o	              \
  subsegs.o	symbols.o					version.o     \
  flonum-const.o	flonum-copy.o	flonum-mult.o	strstr.o	bignum-copy.o \
! obstack.o	oformat.o
  #gdb.o		gdb-file.o	gdb-symbols.o	gdb-blocks.o	gdb-lines.o
  
! coff_obj = stack.o
  
+ gas:	$(DEFAULT_GAS)
+ 	@rm -f gas
+ 	@ln $(DEFAULT_GAS) gas
+ 
  # SPARC GAS ------------------------------------------------------------------
  v = sparc.o  atof-ieee.o  write-sparc.o  read-sparc.o
  
***************
*** 217,224 ****
  
  atof-ieee.o:	flonum.h
  
! a386: $a $x
! 	$(CC) -o a386 $(LDFLAGS) $a $x $(LOADLIBES)
  
  # 68020 GAS ------------------------------------------------------------------
  y = m68k.o  atof-ieee.o write.o read.o
--- 219,226 ----
  
  atof-ieee.o:	flonum.h
  
! a386: $a $x $(coff_obj)
! 	$(CC) -o a386 $(LDFLAGS) $a $x $(coff_obj) $(LOADLIBES)
  
  # 68020 GAS ------------------------------------------------------------------
  y = m68k.o  atof-ieee.o write.o read.o
***************
*** 269,275 ****
  frags.c		input-file.c	input-scrub.c	output-file.c	read.c \
  subsegs.c	symbols.c	write.c				strstr.c \
  flonum-const.c	flonum-copy.c	flonum-mult.c	app.c		version.c \
! obstack.c \
  #gdb.c		gdb-file.c	gdb-symbols.c	gdb-blocks.c \
  #gdb-lines.c
  
--- 271,277 ----
  frags.c		input-file.c	input-scrub.c	output-file.c	read.c \
  subsegs.c	symbols.c	write.c				strstr.c \
  flonum-const.c	flonum-copy.c	flonum-mult.c	app.c		version.c \
! obstack.c 	coff.c		aout.c \
  #gdb.c		gdb-file.c	gdb-symbols.c	gdb-blocks.c \
  #gdb-lines.c
  
***************
*** 277,283 ****
  a.out.gnu.h	as.h		bignum.h	expr.h		flonum.h \
  frags.h		hash.h		input-file.h	md.h	 \
  obstack.h	read.h		struc-symbol.h	subsegs.h	\
! symbols.h	write.h
  
  dist: COPYING README ChangeLog $A $H $Z $Y $X $W $V Makefile
  	echo gas-`sed -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q < version.c` > .fname
--- 279,285 ----
  a.out.gnu.h	as.h		bignum.h	expr.h		flonum.h \
  frags.h		hash.h		input-file.h	md.h	 \
  obstack.h	read.h		struc-symbol.h	subsegs.h	\
! symbols.h	write.h		coff.h 		aout.h
  
  dist: COPYING README ChangeLog $A $H $Z $Y $X $W $V Makefile
  	echo gas-`sed -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q < version.c` > .fname
***************
*** 289,314 ****
  	-rm .fname
  
  clean:
! 	rm -f a avax a68 a386 a32k asparc $a $v $w $x $y $z a core gmon.out bugs a.out
  
! install:	a
! 	cp a $(BINDIR)/gas
  
  
  # General .o-->.h dependencies
  
  app.o:		as.h
! as.o:		a.out.gnu.h as.h read.h struc-symbol.h write.h
  atof-generic.o:	flonum.h
  bignum-copy.o:	bignum.h
! expr.o:		a.out.gnu.h as.h expr.h flonum.h obstack.h read.h struc-symbol.h
! expr.o:		 symbols.h
  flonum-const.o:	flonum.h
  flonum-copy.o:	flonum.h
  flonum-mult.o:	flonum.h
  flonum-normal.o:flonum.h
  flonum-print.o:	flonum.h
! frags.o:	a.out.gnu.h as.h frags.h obstack.h struc-symbol.h subsegs.h
  #gdb.o:		as.h
  #gdb-blocks.o:	as.h
  #gdb-lines.o:	as.h frags.h obstack.h
--- 291,317 ----
  	-rm .fname
  
  clean:
! 	rm -f gas avax a68 a386 a32k asparc $a $v $w $x $y $z $(coff_obj) core gmon.out bugs a.out
  
! install:	gas
! 	cp gas $(BINDIR)/gas
  
  
  # General .o-->.h dependencies
  
  app.o:		as.h
! as.o:		oformat.h a.out.gnu.h as.h read.h struc-symbol.h write.h
  atof-generic.o:	flonum.h
  bignum-copy.o:	bignum.h
! expr.o:		oformat.h a.out.gnu.h as.h expr.h flonum.h obstack.h read.h
! expr.o:		struc-symbol.h symbols.h
  flonum-const.o:	flonum.h
  flonum-copy.o:	flonum.h
  flonum-mult.o:	flonum.h
  flonum-normal.o:flonum.h
  flonum-print.o:	flonum.h
! frags.o:	oformat.h a.out.gnu.h as.h frags.h obstack.h struc-symbol.h
! frags.o:	subsegs.h
  #gdb.o:		as.h
  #gdb-blocks.o:	as.h
  #gdb-lines.o:	as.h frags.h obstack.h
***************
*** 318,329 ****
  input-scrub.o:	as.h input-file.h read.h
  messages.o:	as.h
  obstack.o:	obstack.h
! read.o:		a.out.gnu.h as.h expr.h flonum.h frags.h hash.h md.h obstack.h
! read.o:		read.h struc-symbol.h symbols.h
! subsegs.o:	a.out.gnu.h as.h frags.h obstack.h struc-symbol.h subsegs.h write.h
! symbols.o:	a.out.gnu.h as.h frags.h hash.h obstack.h struc-symbol.h symbols.h
! write.o:	a.out.gnu.h as.h md.h obstack.h struc-symbol.h subsegs.h
! write.o:	symbols.h write.h
  
  flonum.h:					bignum.h
  
--- 321,335 ----
  input-scrub.o:	as.h input-file.h read.h
  messages.o:	as.h
  obstack.o:	obstack.h
! oformat.o: 	as.h md.h aout.h a.out.gnu.h struc-symbol.h write.h append.h
! read.o:		oformat.h a.out.gnu.h as.h expr.h flonum.h frags.h hash.h md.h
! read.o:		obstack.h read.h struc-symbol.h symbols.h
! subsegs.o:	oformat.h a.out.gnu.h as.h frags.h obstack.h struc-symbol.h
! subsegs.o:	subsegs.h write.h
! symbols.o:	oformat.h a.out.gnu.h as.h frags.h hash.h obstack.h
! symbols.o:	struc-symbol.h symbols.h
! write.o:	oformat.h a.out.gnu.h as.h md.h obstack.h struc-symbol.h
! write.o:	subsegs.h symbols.h write.h
  
  flonum.h:					bignum.h
  
*** aout.h.~1~	Thu Nov 01 08:42:06 1990
--- aout.h	Thu Nov 01 08:56:37 1990
***************
*** 56,62 ****
     nameless symbols come from .stab directives. */
  #define S_IS_LOCAL(s)		(S_GET_NAME(s) && \
  				 !S_IS_DEBUG(s) && \
! 				 (S_GET_NAME(s)[0] == '\001' || \
  				  (S_LOCAL_NAME(s) && !flagseen['L'])))
  /* True if a symbol is not defined in this file */
  #define S_IS_EXTERN(s)		((s)->sy_type & N_EXT)
--- 56,62 ----
     nameless symbols come from .stab directives. */
  #define S_IS_LOCAL(s)		(S_GET_NAME(s) && \
  				 !S_IS_DEBUG(s) && \
! 				 (S_GET_NAME(s)[2] == '\001' || \
  				  (S_LOCAL_NAME(s) && !flagseen['L'])))
  /* True if a symbol is not defined in this file */
  #define S_IS_EXTERN(s)		((s)->sy_type & N_EXT)
*** as.c.~1~	Thu Nov 01 08:42:09 1990
--- as.c	Thu Nov 01 08:44:26 1990
***************
*** 248,253 ****
--- 248,254 ----
  
  	text_fix_root		= NULL;
  	data_fix_root		= NULL;
+ 	bss_fix_root		= NULL;
  	need_pass_2		= FALSE;
  
  	argv++;			/* skip argv[0] */
*** coff.c.~1~	Thu Nov 01 08:42:07 1990
--- coff.c	Thu Nov 01 09:21:55 1990
***************
*** 7,12 ****
--- 7,19 ----
  
  /* Relocation. */
  
+ static int
+ reloc_compare(p1, p2)
+      RELOC *p1, *p2;
+ {
+     return (int)(p1->r_vaddr - p2->r_vaddr);
+ }
+ 
  /*
   *		emit_relocations()
   *
***************
*** 18,31 ****
  register fixS *	fixP;	/* Fixup chain for this segment. */
  relax_addressT	segment_address_in_file;
  {
!     RELOC			ri;
!     register symbolS *		symbolP;
!     
!     bzero((char *)&ri,sizeof(ri));
!     for ( ;  fixP;  fixP = fixP->fx_next) {
  	if (symbolP = fixP->fx_addsy) {
  #if defined(PROCESSOR_68000)
! 	    ri.r_type = (fixP->fx_pcrel ? 
  			 ( fixP->fx_size == 1 ? R_PCRBYTE :
  			  fixP->fx_size == 2 ? R_PCRWORD :
  			  R_PCRLONG):
--- 25,48 ----
  register fixS *	fixP;	/* Fixup chain for this segment. */
  relax_addressT	segment_address_in_file;
  {
!     symbolS	*symbolP;
!     int 	i, count;
!     RELOC 	*ri_table;
!     fixS 	*p;
! 
!     for (count = 0, p = fixP; p ; p = p->fx_next)
! 	if (p->fx_addsy) count++;
!     if (!count)
! 	return;
! 
!     ri_table = (RELOC *)malloc (sizeof(RELOC)*count);
!     if (!ri_table)
! 	as_fatal ("emit_relocaltions: Could not malloc relocation table");
! 
!     for (i = 0 ;  fixP;  fixP = fixP->fx_next) {
  	if (symbolP = fixP->fx_addsy) {
  #if defined(PROCESSOR_68000)
! 	    ri_table[i].r_type = (fixP->fx_pcrel ? 
  			 ( fixP->fx_size == 1 ? R_PCRBYTE :
  			  fixP->fx_size == 2 ? R_PCRWORD :
  			  R_PCRLONG):
***************
*** 34,40 ****
  			  R_RELLONG));
  #elif defined(PROCESSOR_i386)
  	    /* !!!! R_OFF8 & R_DIR16 are a vague guess, completly unested. */
! 	    ri.r_type = (fixP->fx_pcrel ? 
  			 ( fixP->fx_size == 1 ? R_PCRBYTE :
  			  fixP->fx_size == 2 ? R_PCRWORD :
  			  R_PCRLONG):
--- 51,57 ----
  			  R_RELLONG));
  #elif defined(PROCESSOR_i386)
  	    /* !!!! R_OFF8 & R_DIR16 are a vague guess, completly unested. */
! 	    ri_table[i].r_type = (fixP->fx_pcrel ? 
  			 ( fixP->fx_size == 1 ? R_PCRBYTE :
  			  fixP->fx_size == 2 ? R_PCRWORD :
  			  R_PCRLONG):
***************
*** 42,50 ****
  			  fixP->fx_size == 2 ? R_DIR16 :
  			  R_DIR32));
  #else
! 	    you lose
  #endif /* PROCESSOR_68000 || PROCESSOR_i386 */
! 		ri.r_vaddr = fixP->fx_frag->fr_address + fixP->fx_where;
  	    /* If symbol associated to relocation entry is a bss symbol 
  	       or undefined symbol just remember the index of the symbol.
  	       Otherwise store the index of the symbol describing the 
--- 59,67 ----
  			  fixP->fx_size == 2 ? R_DIR16 :
  			  R_DIR32));
  #else
! 	    you lose;
  #endif /* PROCESSOR_68000 || PROCESSOR_i386 */
! 	    ri_table[i].r_vaddr = fixP->fx_frag->fr_address + fixP->fx_where;
  	    /* If symbol associated to relocation entry is a bss symbol 
  	       or undefined symbol just remember the index of the symbol.
  	       Otherwise store the index of the symbol describing the 
***************
*** 65,82 ****
  	       nature of the .bss section. Or maybe this is because the 
  	       bss symbols are declared in the common section and can
  	       be resized later. Can it break code some where ? */
! 	    ri.r_symndx =
  	S_GET_SEGMENT(symbolP) == C_TEXT_SECTION ? dot_text_symbol->sy_number :
  	S_GET_SEGMENT(symbolP) == C_DATA_SECTION ? dot_data_symbol->sy_number :
  	       (SF_GET_LOCAL(symbolP) ? dot_bss_symbol->sy_number :
  		symbolP->sy_number); /* bss or undefined */
  	    
  	    /* md_ri_to_chars((char *) &ri, ri);  /* Last step : write md f */
! 	    append (&next_object_file_charP,
! 		    (char *)& ri,
! 		    (unsigned long)RELSZ);
  	}
      }
  }
  
  /* Coff file generation & utilities */
--- 82,111 ----
  	       nature of the .bss section. Or maybe this is because the 
  	       bss symbols are declared in the common section and can
  	       be resized later. Can it break code some where ? */
! 	    ri_table[i].r_symndx =
  	S_GET_SEGMENT(symbolP) == C_TEXT_SECTION ? dot_text_symbol->sy_number :
  	S_GET_SEGMENT(symbolP) == C_DATA_SECTION ? dot_data_symbol->sy_number :
+ 	S_GET_SEGMENT(symbolP) == C_BSS_SECTION  ? dot_bss_symbol->sy_number :
  	       (SF_GET_LOCAL(symbolP) ? dot_bss_symbol->sy_number :
  		symbolP->sy_number); /* bss or undefined */
  	    
  	    /* md_ri_to_chars((char *) &ri, ri);  /* Last step : write md f */
! 	    i++;
  	}
      }
+ 
+     /*
+      * AIX ld prefer to the reloc table with r_vaddr sorted.
+      * but sorting it should hurt any other ld.
+      */
+     qsort (ri_table, count, sizeof(RELOC), reloc_compare);
+ 
+     for (i = 0; i < count; i++)
+ 	append (&next_object_file_charP,
+ 		(char *)& ri_table[i],
+ 		(unsigned long)RELSZ);
+ 
+     free (ri_table);
  }
  
  /* Coff file generation & utilities */
*** coff.h.~1~	Thu Nov 01 08:42:08 1990
--- coff.h	Thu Nov 01 08:56:16 1990
***************
*** 129,135 ****
  #define S_IS_DEBUG(s)		((s)->sy_scnum == C_DEGUG_SECTION)
  /* True if a symbol is local symbol name */
  /* A symbol name whose name begin with ^A is a gas internal pseudo symbol */
! #define S_IS_LOCAL(s)		(S_GET_NAME(s)[0] == '\001' || \
  				 (S_LOCAL_NAME(s) && !flagseen['L']))
  /* True if a symbol is not defined in this file */
  #define S_IS_EXTERN(s)		((s)->sy_scnum == 0 && (s)->sy_value == 0)
--- 129,135 ----
  #define S_IS_DEBUG(s)		((s)->sy_scnum == C_DEGUG_SECTION)
  /* True if a symbol is local symbol name */
  /* A symbol name whose name begin with ^A is a gas internal pseudo symbol */
! #define S_IS_LOCAL(s)		(S_GET_NAME(s)[2] == '\001' || \
  				 (S_LOCAL_NAME(s) && !flagseen['L']))
  /* True if a symbol is not defined in this file */
  #define S_IS_EXTERN(s)		((s)->sy_scnum == 0 && (s)->sy_value == 0)
*** i386-opcode.h.~1~	Tue Jan 23 11:26:34 1990
--- i386-opcode.h	Thu Nov 01 08:50:34 1990
***************
*** 76,81 ****
--- 76,90 ----
  {"out", 2, 0xe6, _, W|NoModrm, Acc, Imm8, 0 },
  {"out", 2, 0xee, _, W|NoModrm, Acc, InOutPortReg, 0 },
  
+ {"inb",  1, 0xe4, _, NoModrm, Imm8, 0, 0 },
+ {"inb",  1, 0xec, _, NoModrm, WordMem, 0, 0 },
+ {"inw",  1, 0x66e5, _, NoModrm, Imm8, 0, 0 },
+ {"inw",  1, 0x66ed, _, NoModrm, WordMem, 0, 0 },
+ {"outb", 1, 0xe6, _, NoModrm, Imm8, 0, 0 },
+ {"outb", 1, 0xee, _, NoModrm, WordMem, 0, 0 },
+ {"outw", 1, 0x66e7, _, NoModrm, Imm8, 0, 0 },
+ {"outw", 1, 0x66ef, _, NoModrm, WordMem, 0, 0 },
+ 
  /* load effective address */
  {"lea", 2, 0x8d, _, Modrm, WordMem, WordReg, 0 },
  
***************
*** 387,398 ****
--- 396,412 ----
  
  /* string manipulation */
  {"cmps", 0, 0xa6, _, W|NoModrm, 0, 0, 0},
+ {"scmp", 0, 0xa6, _, W|NoModrm, 0, 0, 0},
  {"ins", 0, 0x6c, _, W|NoModrm, 0, 0, 0},
  {"outs", 0, 0x6e, _, W|NoModrm, 0, 0, 0},
  {"lods", 0, 0xac, _, W|NoModrm, 0, 0, 0},
+ {"slod", 0, 0xac, _, W|NoModrm, 0, 0, 0},
  {"movs", 0, 0xa4, _, W|NoModrm, 0, 0, 0},
+ {"smov", 0, 0xa4, _, W|NoModrm, 0, 0, 0},
  {"scas", 0, 0xae, _, W|NoModrm, 0, 0, 0},
+ {"ssca", 0, 0xae, _, W|NoModrm, 0, 0, 0},
  {"stos", 0, 0xaa, _, W|NoModrm, 0, 0, 0},
+ {"ssto", 0, 0xaa, _, W|NoModrm, 0, 0, 0},
  {"xlat", 0, 0xd7, _, NoModrm, 0, 0, 0},
  
  /* bit manipulation */
*** i386.c.~1~	Thu Nov 01 08:42:14 1990
--- i386.c	Thu Nov 01 08:54:58 1990
***************
*** 1513,1518 ****
--- 1513,1524 ----
        as_bad ("register size mismatch in (base,index,scale) expression");
        return 0;
      }
+     /*
+      * special case for (%dx) while doing input/output op
+      */
+     if (((i.base_reg && (i.base_reg->reg_type == (Reg16|InOutPortReg))) &&
+ 	 (i.index_reg == 0)))
+ 	return 1;
      if ((i.base_reg && (i.base_reg->reg_type & Reg32) == 0) ||
  	(i.index_reg && (i.index_reg->reg_type & Reg32) == 0)) {
        as_bad ("base/index register must be 32 bit register");
*** m-i386.h.~1~	Thu Nov 01 08:42:08 1990
--- m-i386.h	Thu Nov 01 09:06:27 1990
***************
*** 8,10 ****
--- 8,19 ----
  
  /* Compiler does not generate symbol names with a leading underscore. */
  #define STRIP_UNDERSCORE 0
+ 
+ /* '.align n' mean align on 'n' bytes */
+ #define OTHER_ALIGN
+ 
+ /* The NOP_OPCODE is for the alignment fill value.
+  * fill it a nop instruction so that the disassembler does not choke
+  * on it
+  */
+ #define NOP_OPCODE 0x90
*** read.c.~1~	Thu Nov 01 08:42:21 1990
--- read.c	Thu Nov 01 09:12:06 1990
***************
*** 52,57 ****
--- 52,61 ----
  #define OTHER_ALIGN
  #endif
  
+ #ifndef NOP_OPCODE
+ #define NOP_OPCODE 0x00
+ #endif
+ 
  char *	input_line_pointer;	/* -> next char of source file to parse. */
  
  
***************
*** 175,182 ****
  #ifdef aout
  void s_desc();
  #endif /* aout */
! void	s_abort(),	s_align(),	s_comm(),	s_data();
! void	s_even(),	s_file(),	s_fill();
  void	s_globl(),	s_lcomm(),	s_line(),	s_lsym();
  void	s_org(),	s_set(),	s_space(),	s_text();
  
--- 179,186 ----
  #ifdef aout
  void s_desc();
  #endif /* aout */
! void	s_abort(),	s_align(),	s_bss(),	s_comm();
! void	s_data(),	s_even(),	s_file(),	s_fill();
  void	s_globl(),	s_lcomm(),	s_line(),	s_lsym();
  void	s_org(),	s_set(),	s_space(),	s_text();
  
***************
*** 199,204 ****
--- 203,209 ----
    { "ascii",	stringer,	0	},
    { "asciz",	stringer,	1	},
    { "byte",	cons,		1	},
+   { "bss",	s_bss,		0	},
    { "comm",	s_comm,		0	},
    { "data",	s_data,		0	},
  #ifdef aout
***************
*** 573,579 ****
  	input_line_pointer ++;
  	temp_fill = get_absolute_expression ();
      } else {
! 	temp_fill = 0;
      }
      /* Only make a frag if we HAVE to. . . */
      if (temp && ! need_pass_2)
--- 578,584 ----
  	input_line_pointer ++;
  	temp_fill = get_absolute_expression ();
      } else {
! 	temp_fill = NOP_OPCODE;
      }
      /* Only make a frag if we HAVE to. . . */
      if (temp && ! need_pass_2)
***************
*** 601,607 ****
  		input_line_pointer ++;
  		temp_fill = get_absolute_expression ();
  	} else
! 		temp_fill = 0;
  	/* Only make a frag if we HAVE to. . . */
  	if ( temp && ! need_pass_2 )
  		frag_align (temp, (int)temp_fill);
--- 606,612 ----
  		input_line_pointer ++;
  		temp_fill = get_absolute_expression ();
  	} else
! 		temp_fill = NOP_OPCODE;
  	/* Only make a frag if we HAVE to. . . */
  	if ( temp && ! need_pass_2 )
  		frag_align (temp, (int)temp_fill);
***************
*** 608,613 ****
--- 613,628 ----
  	demand_empty_rest_of_line();
  }
  #endif
+ 
+ void
+ s_bss()
+ {
+ 	register int temp;
+ 
+ 	temp = get_absolute_expression ();
+ 	subseg_new (SEG_BSS, (subsegT)temp);
+ 	demand_empty_rest_of_line();
+ }
  
  void
  s_comm()
*** subsegs.c.~1~	Thu Nov 01 08:42:22 1990
--- subsegs.c	Thu Nov 01 09:25:23 1990
***************
*** 31,37 ****
  
  frchainS*	frchain_root,
  	*	frchain_now,	/* Commented in "subsegs.h". */
! 	*	data0_frchainP;
  
  
  #ifdef coff
--- 31,38 ----
  
  frchainS*	frchain_root,
  	*	frchain_now,	/* Commented in "subsegs.h". */
! 	*	data0_frchainP,
! 	*	bss0_frchainP;
  
  
  #ifdef coff
***************
*** 165,170 ****
--- 166,173 ----
    now_subseg = 42;		/* Lie for 1st call to subseg_new. */
    subseg_new (SEG_DATA, 0);	/* .data 0 */
    data0_frchainP = frchain_now;
+   subseg_new (SEG_BSS, 0);
+   bss0_frchainP = frchain_now;
  }
  
  /*
***************
*** 184,191 ****
  {
    now_seg	 = seg;
    now_subseg = subseg;
!   if (seg == SEG_DATA)
      {
        seg_fix_rootP = & data_fix_root;
      }
    else
--- 187,198 ----
  {
    now_seg	 = seg;
    now_subseg = subseg;
!   if (seg == SEG_BSS)
      {
+       seg_fix_rootP = & bss_fix_root;
+     }
+   else if (seg == SEG_DATA)
+     {
        seg_fix_rootP = & data_fix_root;
      }
    else
***************
*** 213,224 ****
  
  void
  subseg_new (seg, subseg)	/* begin assembly for a new sub-segment */
!      register segT	seg;	/* SEG_DATA or SEG_TEXT */
       register subsegT	subseg;
  {
    long tmp;		/* JF for obstack alignment hacking */
  
!   know( seg == SEG_DATA || seg == SEG_TEXT );
  
    if (seg != now_seg || subseg != now_subseg)
      {				/* we just changed sub-segments */
--- 220,231 ----
  
  void
  subseg_new (seg, subseg)	/* begin assembly for a new sub-segment */
!      register segT	seg;	/* SEG_DATA or SEG_TEXT or SEG_BSS */
       register subsegT	subseg;
  {
    long tmp;		/* JF for obstack alignment hacking */
  
!   know( seg == SEG_DATA || seg == SEG_TEXT || seg == SEG_BSS );
  
    if (seg != now_seg || subseg != now_subseg)
      {				/* we just changed sub-segments */
*** subsegs.h.~1~	Wed Mar 01 14:48:44 1989
--- subsegs.h	Thu Nov 01 09:38:57 1990
***************
*** 62,65 ****
--- 62,67 ----
  				/* (Which is pointed to by the last text- */
  				/* segment frchain.) */
  
+ extern frchainS * bss0_frchainP;
+ 
  /* end: subsegs.h */
*** write.c.~1~	Thu Nov 01 08:42:26 1990
--- write.c	Thu Nov 01 11:23:26 1990
***************
*** 51,56 ****
--- 51,64 ----
  #define EXEC_MACHINE_TYPE HP9000S200_ID
  #endif
  
+ /* The NOP_OPCODE is for the alignment fill value.
+  * fill it a nop instruction so that the disassembler does not choke
+  * on it
+  */
+ #ifndef NOP_OPCODE
+ #define NOP_OPCODE 0x00
+ #endif
+ 
  #ifdef coff
  extern time_t		time();
  #endif /* coff */
***************
*** 57,65 ****
--- 65,75 ----
  
  static struct frag *	text_frag_root;
  static struct frag *	data_frag_root;
+ static struct frag *	bss_frag_root;
  
  static struct frag *	text_last_frag;	/* Last frag in segment. */
  static struct frag *	data_last_frag;	/* Last frag in segment. */
+ static struct frag *	bss_last_frag;	/* Last frag in segment. */
  
  static object_headers	headers;
  
***************
*** 192,198 ****
  #define	SUB_SEGMENT_ALIGN ((frchainP->frch_seg != SEG_DATA) ? 2 : 0)
  #endif	/* VMS */
        subseg_new (frchainP -> frch_seg, frchainP -> frch_subseg);
!       frag_align (SUB_SEGMENT_ALIGN, 0);
  				/* frag_align will have left a new frag. */
  				/* Use this last frag for an empty ".fill". */
        /*
--- 202,208 ----
  #define	SUB_SEGMENT_ALIGN ((frchainP->frch_seg != SEG_DATA) ? 2 : 0)
  #endif	/* VMS */
        subseg_new (frchainP -> frch_seg, frchainP -> frch_subseg);
!       frag_align (SUB_SEGMENT_ALIGN, NOP_OPCODE);
  				/* frag_align will have left a new frag. */
  				/* Use this last frag for an empty ".fill". */
        /*
***************
*** 216,235 ****
      {
        know( frchainP -> frch_root );
        * prev_fragPP = frchainP -> frch_root;
!       prev_fragPP = & frchainP -> frch_last -> fr_next;
!       if (   ((next_frchainP = frchainP->frch_next) == NULL)
! 	  || next_frchainP == data0_frchainP)
! 	{
  	  prev_fragPP = & data_frag_root;
! 	  if ( next_frchainP )
! 	    {
! 	      text_last_frag = frchainP -> frch_last;
! 	    }
! 	  else
! 	    {
! 	      data_last_frag = frchainP -> frch_last;
! 	    }
! 	}
      }				/* for(each struct frchain) */
  
    /*
--- 226,246 ----
      {
        know( frchainP -> frch_root );
        * prev_fragPP = frchainP -> frch_root;
!       prev_fragPP   = & frchainP -> frch_last -> fr_next;
!       next_frchainP = frchainP->frch_next;
! 
!       if (next_frchainP == NULL)
! 	  bss_last_frag  = frchainP -> frch_last;
!       else if (next_frchainP == data0_frchainP)
!       {
! 	  text_last_frag = frchainP -> frch_last;
  	  prev_fragPP = & data_frag_root;
!       }
!       else if (next_frchainP == bss0_frchainP)
!       {
! 	  data_last_frag = frchainP -> frch_last;
! 	  prev_fragPP = & bss_frag_root;
!       }
      }				/* for(each struct frchain) */
  
    /*
***************
*** 256,261 ****
--- 267,273 ----
  
    relax_segment (text_frag_root, SEG_TEXT);
    relax_segment (data_frag_root, SEG_DATA);
+   relax_segment (bss_frag_root, SEG_BSS);
    /*
     * Now the addresses of frags are correct within the segment.
     */
***************
*** 304,310 ****
  #ifdef SPARC
    local_bss_counter=(local_bss_counter+7)&(~7);
  #endif
!   H_SET_BSS_SIZE(&headers,local_bss_counter);
  	      
    /*
     *
--- 316,333 ----
  #ifdef SPARC
    local_bss_counter=(local_bss_counter+7)&(~7);
  #endif
!   H_SET_BSS_SIZE(&headers, bss_last_frag->fr_address);
! 
!   /*
!    * now fixup all bss frags addresses
!    */
!   if (bss_frag_root)
!   {
!       relax_addressT	slide;
!       slide = bss_address_frag . fr_address;
!       for (fragP = bss_frag_root; fragP; fragP = fragP -> fr_next)
! 	  fragP -> fr_address += slide;
!   }
  	      
    /*
     *
***************
*** 958,964 ****
  void
  relax_segment (segment_frag_root, segment_type)
       struct frag *	segment_frag_root;
!      segT		segment_type; /* SEG_DATA or SEG_TEXT */
  {
    register struct frag *	fragP;
    register relax_addressT	address;
--- 981,987 ----
  void
  relax_segment (segment_frag_root, segment_type)
       struct frag *	segment_frag_root;
!      segT		segment_type; /* SEG_DATA or SEG_TEXT or SEG_BSS */
  {
    register struct frag *	fragP;
    register relax_addressT	address;
***************
*** 965,971 ****
    /* register relax_addressT	old_address; JF unused */
    /* register relax_addressT	new_address; JF unused */
  
!   know( segment_type == SEG_DATA || segment_type == SEG_TEXT );
  
    /* In case md_estimate_size_before_relax() wants to make fixSs. */
    subseg_change (segment_type, 0);
--- 988,996 ----
    /* register relax_addressT	old_address; JF unused */
    /* register relax_addressT	new_address; JF unused */
  
!   know( segment_type == SEG_DATA ||
!         segment_type == SEG_TEXT ||
!         segment_type == SEG_BSS );
  
    /* In case md_estimate_size_before_relax() wants to make fixSs. */
    subseg_change (segment_type, 0);
***************
*** 1105,1111 ****
  		  {
  		    know(S_IS_ABS(symbolP) ||
  			 S_IS_DATA(symbolP) ||
! 			 S_IS_TEXT(symbolP))
  		    know(symbolP -> sy_frag);
  		    know(!S_IS_ABS(symbolP) || 
  			 symbolP->sy_frag==&zero_address_frag );
--- 1130,1136 ----
  		  {
  		    know(S_IS_ABS(symbolP) ||
  			 S_IS_DATA(symbolP) ||
! 			 S_IS_TEXT(symbolP));
  		    know(symbolP -> sy_frag);
  		    know(!S_IS_ABS(symbolP) || 
  			 symbolP->sy_frag==&zero_address_frag );
***************
*** 1137,1143 ****
  		  {
  		    know(S_IS_ABS(symbolP) ||
  			 S_IS_DATA(symbolP) ||
! 			 S_IS_TEXT(symbolP))
  		    know(symbolP -> sy_frag);
  		    know(!S_IS_ABS(symbolP) || 
  			 symbolP->sy_frag==&zero_address_frag );
--- 1162,1168 ----
  		  {
  		    know(S_IS_ABS(symbolP) ||
  			 S_IS_DATA(symbolP) ||
! 			 S_IS_TEXT(symbolP));
  		    know(symbolP -> sy_frag);
  		    know(!S_IS_ABS(symbolP) || 
  			 symbolP->sy_frag==&zero_address_frag );
***************
*** 1353,1358 ****
--- 1378,1384 ----
  	       * So we know how to do the address without relocation.
  	       */
  	      add_number += S_GET_VALUE(add_symbolP);
+ 	      add_number -=
  #ifndef NS32K
  		      size +
  #endif
*** write.h.~1~	Thu Nov 01 08:42:26 1990
--- write.h	Thu Nov 01 09:42:32 1990
***************
*** 70,75 ****
--- 70,76 ----
  
  COMMON fixS *	text_fix_root;	/* Chains fixSs. */
  COMMON fixS *	data_fix_root;	/* Chains fixSs. */
+ COMMON fixS *	bss_fix_root;	/* Chains fixSs. */
  COMMON fixS **	seg_fix_rootP;	/* -> one of above. */
  
  COMMON char *	next_object_file_charP;
-------
Technical Details
Message-ID: <9011012106.AA01312@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!INTELLICORP.COM!TRANLE

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,e9c6d607ae5eda79,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1990-11-01 13:06:23 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!INTELLICORP.COM!TRANLE
From: TRANLE@INTELLICORP.COM (Minh Tran-Le)
Newsgroups: gnu.gcc.help
Subject: gas-1.37 coff patches for ibm ps/2 aix ...
Message-ID: <9011012106.AA01312@life.ai.mit.edu>
Date: 1 Nov 90 21:06:23 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 1011
Posted: Thu Nov  1 22:06:23 1990