[gnu.gcc.bug] patches to GAS for VMS

angel@FLIPPER.MIAMI.EDU (angel li) (09/20/88)

Here are some diffs for a GAS module that fixes problems with GCC on VMS.
It is now possible to create shareable images from files compiled with
GCC.  These fixes were obtained from kashtan@iu.ai.sri.com and apply to
version 1.24 of GAS.

Angel Li
University of Miami/RSMAS Remote Sensing Group

Internet: angel@flipper.miami.edu			UUCP: ncar!umigw!angel



*** write.c_orig	Tue Sep 20 09:39:09 1988
--- write.c	Tue Sep 20 09:39:06 1988
***************
*** 154,169
  #define SUB_SEGMENT_ALIGN (2)
    for ( frchainP=frchain_root; frchainP; frchainP=frchainP->frch_next )
      {
! #ifdef VMS
! 	/*
! 	 *	Under VAX/VMS, the linker (and PSECT specifications)
! 	 *	take care of correctly aligning the segments.
! 	 *	Doing the alignment here (on initialized data) can
! 	 *	mess up the calculation of global data PSECT sizes.
! 	 */
! 	if(frchainP->frch_seg == SEG_DATA)
! 		continue;
! #endif
        subseg_new (frchainP -> frch_seg, frchainP -> frch_subseg);
        frag_align (SUB_SEGMENT_ALIGN, 0);
  				/* frag_align will have left a new frag. */

--- 154,169 -----
  #define SUB_SEGMENT_ALIGN (2)
    for ( frchainP=frchain_root; frchainP; frchainP=frchainP->frch_next )
      {
! #ifdef	VMS
!       /*
!        *	Under VAX/VMS, the linker (and PSECT specifications)
!        *	take care of correctly aligning the segments.
!        *	Doing the alignment here (on initialized data) can
!        *	mess up the calculation of global data PSECT sizes.
!        */
! #undef	SUB_SEGMENT_ALIGN
! #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. */
***************
*** 327,333
  	   used instead of 128. */
  		/* JF the \001 bit is to make sure that local labels
  		   ( 1: - 9: don't make it into the symtable either */
! #ifndef VMS
  	if ( !name || (symbolP->sy_nlist.n_type&N_STAB)
  	    || (name[0]!='\001' && (flagseen ['L'] || name [0] != 'L' )))
  #endif	/* not VMS */

--- 327,333 -----
  	   used instead of 128. */
  		/* JF the \001 bit is to make sure that local labels
  		   ( 1: - 9: don't make it into the symtable either */
! #ifndef	VMS	/* Under VMS we need to keep local symbols */
  	if ( !name || (symbolP->sy_nlist.n_type&N_STAB)
  	    || (name[0]!='\001' && (flagseen ['L'] || name [0] != 'L' )))
  #endif	/* not VMS */
***************
*** 333,339
  #endif	/* not VMS */
  	  {
  	    symbolP -> sy_number = symbol_number ++;
! #ifndef VMS
  	    if (name)
  	      {			/* Ordinary case. */
  		symbolP -> sy_name_offset = string_byte_count;

--- 333,339 -----
  #endif	/* not VMS */
  	  {
  	    symbolP -> sy_number = symbol_number ++;
! #ifndef	VMS
  	    if (name)
  	      {			/* Ordinary case. */
  		symbolP -> sy_name_offset = string_byte_count;
***************
*** 344,350
  		symbolP -> sy_name_offset = 0;
  	    symbolPP = & (symbolP -> sy_next);
  	  }
! #ifndef VMS
  	else
  	    * symbolPP = symbolP -> sy_next;
  #endif	/* not VMS */

--- 344,350 -----
  		symbolP -> sy_name_offset = 0;
  	    symbolPP = & (symbolP -> sy_next);
  	  }
! #ifndef	VMS
  	else
  	    * symbolPP = symbolP -> sy_next;
  #endif	/* not VMS */
***************
*** 397,403
  	}			/* switch (fr_type) */
      }				/* for each frag. */
  
! #ifndef VMS
    /*
     * Scan every FixS performing fixups. We had to wait until now to do
     * this because md_convert_frag() may have made some fixSs.

--- 397,403 -----
  	}			/* switch (fr_type) */
      }				/* for each frag. */
  
! #ifndef	VMS
    /*
     * Scan every FixS performing fixups. We had to wait until now to do
     * this because md_convert_frag() may have made some fixSs.
***************
*** 531,537
   * within the segment. Since segments live in different file addresses,
   * these frag addresses may not be the same as final object-file addresses.
   */
! #ifndef VMS
  static
  #endif	/* not VMS */
  void

--- 531,537 -----
   * within the segment. Since segments live in different file addresses,
   * these frag addresses may not be the same as final object-file addresses.
   */
! #ifndef	VMS
  static
  #endif	/* not VMS */
  void